From 0b06a9d18889bf7fcca47379a5c0ec986e29ca3d Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Wed, 8 Jul 2009 15:14:58 +0000 Subject: Show graph-image in popup window --- rrdtool-model.lua | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'rrdtool-model.lua') diff --git a/rrdtool-model.lua b/rrdtool-model.lua index 834cae3..fa124b7 100644 --- a/rrdtool-model.lua +++ b/rrdtool-model.lua @@ -204,21 +204,16 @@ function view_graph(self, graph_grp, graph_id) } local graphs = list_graphs() - local settings = graphs[tostring(graph_grp)]["value"][tonumber(self.clientdata.id)] - local filename = "/"..tostring(graph_grp).."_"..tostring(graph_id) .. + local settings = graphs[tostring(graph_grp)][tonumber(self.clientdata.id)] + local filename = "/".. string.lower(tostring(graph_grp)).."_"..tostring(graph_id) .. (settings.filenameextention or ".png") - settings.value = tostring(filename) + settings.output = tostring(filename) --TODO: Loop the defaultsettings and put it in the settings table if there is missing some information local cmd = "/usr/bin/rrdtool graph /usr/share/acf/www" .. tostring(filename) .. " " - for k,v in pairs(settings.option) do - if (v) and (#v > 0) then - cmd = cmd .. "--".. format.escapespecialcharacters(k) .. " " .. - format.escapespecialcharacters(v) .. " " - end - end - cmd = cmd .. tostring(settings.variables) + + cmd = cmd .. tostring(settings.value) settings.cmd_query = cmd local f = io.popen( tostring(cmd) .. " 2>&1" ) settings.cmd_result = f:read("*a") or "" -- cgit v1.2.3