summaryrefslogtreecommitdiffstats
path: root/rrdtool-model.lua
diff options
context:
space:
mode:
Diffstat (limited to 'rrdtool-model.lua')
-rw-r--r--rrdtool-model.lua16
1 files changed, 16 insertions, 0 deletions
diff --git a/rrdtool-model.lua b/rrdtool-model.lua
index e9ff4e6..b3f6dee 100644
--- a/rrdtool-model.lua
+++ b/rrdtool-model.lua
@@ -226,3 +226,19 @@ end
function getgraphlist()
return list_files(graphpath,".*graph")
end
+
+function getgraphfile(path)
+ if (path) and not (validfilename(path)) then
+ path = nil
+ end
+ local filedetails = modelfunctions.getfiledetails(path)
+ local output = {value={filename=filedetails.value.filename,
+ filecontent=filedetails.value.filecontent,}}
+-- output.value.filecontent.rows="30" -- FIXME: For some reason I can't control the size of a textarea
+ if not (path) then
+ output.value.filename.errtxt=nil
+ else
+ output.value.filename.disabled="true"
+ end
+ return output
+end