* luci/statistics: moving the graph controller to admin caused the images to be generated by the root user which rendered the linked-in public statistics pages unusable because of missing permissions to write the generated graphics as nobody to directories created by root
* luci/core: store the actual dispatching path to .path in node() - this permits dispatcher modules to get the canonical path as luci.dispatcher.dispatched.path
This commit is contained in:
parent
b871cadf34
commit
48e06817da
2 changed files with 9 additions and 3 deletions
|
@ -70,7 +70,10 @@ function index()
|
||||||
|
|
||||||
|
|
||||||
-- output views
|
-- output views
|
||||||
entry( { "admin", "statistics", "graph" }, call("statistics_index"), _i18n("graphs"), 80).i18n = "statistics"
|
local page = entry( { "admin", "statistics", "graph" }, call("statistics_index"), _i18n("graphs"), 80)
|
||||||
|
page.i18n = "statistics"
|
||||||
|
page.setuser = "nobody"
|
||||||
|
page.setgroup = "nogroup"
|
||||||
|
|
||||||
local vars = luci.http.formvalues()
|
local vars = luci.http.formvalues()
|
||||||
local span = vars.timespan or nil
|
local span = vars.timespan or nil
|
||||||
|
@ -142,13 +145,14 @@ function statistics_render()
|
||||||
|
|
||||||
local vars = luci.http.formvalues()
|
local vars = luci.http.formvalues()
|
||||||
local req = luci.dispatcher.request
|
local req = luci.dispatcher.request
|
||||||
|
local path = luci.dispatcher.dispatched.path
|
||||||
local uci = luci.model.uci.Session()
|
local uci = luci.model.uci.Session()
|
||||||
local spans = luci.util.split( uci:get( "luci_statistics", "collectd_rrdtool", "RRATimespans" ), "%s+", nil, true )
|
local spans = luci.util.split( uci:get( "luci_statistics", "collectd_rrdtool", "RRATimespans" ), "%s+", nil, true )
|
||||||
local span = vars.timespan or uci:get( "luci_statistics", "rrdtool", "default_timespan" ) or spans[1]
|
local span = vars.timespan or uci:get( "luci_statistics", "rrdtool", "default_timespan" ) or spans[1]
|
||||||
local graph = luci.statistics.rrdtool.Graph( luci.util.parse_units( span ) )
|
local graph = luci.statistics.rrdtool.Graph( luci.util.parse_units( span ) )
|
||||||
|
|
||||||
local plugin = req[4]
|
local plugin = path[4]
|
||||||
local instances = { req[5] }
|
local instances = { path[5] }
|
||||||
local images = { }
|
local images = { }
|
||||||
|
|
||||||
-- no instance requested, find all instances
|
-- no instance requested, find all instances
|
||||||
|
|
|
@ -336,6 +336,8 @@ function node(...)
|
||||||
c = c.nodes[v]
|
c = c.nodes[v]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
c.path = arg
|
||||||
|
|
||||||
return c
|
return c
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue