From df139d6795334165c4fa84aaeba9e2cea85b0c2d Mon Sep 17 00:00:00 2001 From: Mika Havela Date: Tue, 21 Jul 2009 09:35:15 +0000 Subject: New view to be able to create new graph-configs --- rrdtool-controller.lua | 2 ++ rrdtool-listgraphcfg-html.lsp | 2 +- rrdtool-newgraphcfg-html.lsp | 37 +++++++++++++++++++++++++++++++++++++ rrdtool.roles | 2 +- 4 files changed, 41 insertions(+), 2 deletions(-) create mode 100755 rrdtool-newgraphcfg-html.lsp diff --git a/rrdtool-controller.lua b/rrdtool-controller.lua index 7efd8fa..8fbdab5 100644 --- a/rrdtool-controller.lua +++ b/rrdtool-controller.lua @@ -74,3 +74,5 @@ function editgraphcfg(self) end return config end + +newgraphcfg = editgraphcfg diff --git a/rrdtool-listgraphcfg-html.lsp b/rrdtool-listgraphcfg-html.lsp index 9c1d944..d415675 100644 --- a/rrdtool-listgraphcfg-html.lsp +++ b/rrdtool-listgraphcfg-html.lsp @@ -51,7 +51,7 @@ function javascript_confirm_graph(formID,filename) { <% if session.permissions[page_info.controller].createrrd then %> - <% io.write(html.link{value = "editgraphcfg", label="Create new graph " }) %> + <% io.write(html.link{value = "newgraphcfg", label="Create new graph " }) %>     diff --git a/rrdtool-newgraphcfg-html.lsp b/rrdtool-newgraphcfg-html.lsp new file mode 100755 index 0000000..2142095 --- /dev/null +++ b/rrdtool-newgraphcfg-html.lsp @@ -0,0 +1,37 @@ +<% local form, viewlibrary, page_info = ... %> +<% require("viewfunctions") %> +<% +--[[ DEBUG INFORMATION +io.write("

DEBUGGING

DEBUG INFO: CFE

") +io.write(html.cfe_unpack(form)) +io.write("
") +--]] +%> + +

Create new rrdtool-graph file

+ +<% if form.type == "form" then %> +<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %> +<% displayformstart(form) %> +

File Details

+
+
<% io.write(form.value.filename.label) %>
+
+ +<% if form.value.filename.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filename.errtxt), "\n", "
") %>

<% end %> +<% if form.value.filename.descr then %>

<%= string.gsub(html.html_escape(form.value.filename.descr), "\n", "
") %>

<% end %> +
+
+<% end %> +

File Content

+ +<% if form.value.filecontent.errtxt then %>

<%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "
") %>

<% end %> +<% if form.value.filecontent.descr then %>

<%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "
") %>

<% end %> + +<% if form.type == "form" then %> +

Save

+<% displayformend(form) %> +<% end %> + diff --git a/rrdtool.roles b/rrdtool.roles index 679df3e..ad480a1 100644 --- a/rrdtool.roles +++ b/rrdtool.roles @@ -1,4 +1,4 @@ USER=rrdtool:status,rrdtool:welcome,rrdtool:startstop,rrdtool:rrdinfo,rrdtool:listgraphs,rrdtool:viewgraph,rrdtool:listgraphcfg EDITOR=rrdtool:config,rrdtool:listrrd EXPERT=rrdtool:expert -ADMIN=rrdtool:status,rrdtool:welcome,rrdtool:startstop,rrdtool:config,rrdtool:listrrd,rrdtool:expert,rrdtool:delete,rrdtool:createrrd,rrdtool:rrdinfo,rrdtool:listgraphs,rrdtool:viewgraph,rrdtool:listgraphcfg,rrdtool:editgraphcfg +ADMIN=rrdtool:status,rrdtool:welcome,rrdtool:startstop,rrdtool:config,rrdtool:listrrd,rrdtool:expert,rrdtool:delete,rrdtool:createrrd,rrdtool:rrdinfo,rrdtool:listgraphs,rrdtool:viewgraph,rrdtool:listgraphcfg,rrdtool:editgraphcfg,rrdtool:newgraphcfg -- cgit v1.2.3