summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMika Havela <mika.havela@gmail.com>2009-07-21 09:35:15 +0000
committerMika Havela <mika.havela@gmail.com>2009-07-21 09:35:15 +0000
commitdf139d6795334165c4fa84aaeba9e2cea85b0c2d (patch)
treeef79da3b90ebf49277ddb6e1f788347649ea1e93
parentaaea25c0807cabfc64c272f25d293d9653923c86 (diff)
downloadacf-rrdtool-df139d6795334165c4fa84aaeba9e2cea85b0c2d.tar.bz2
acf-rrdtool-df139d6795334165c4fa84aaeba9e2cea85b0c2d.tar.xz
New view to be able to create new graph-configs
-rw-r--r--rrdtool-controller.lua2
-rw-r--r--rrdtool-listgraphcfg-html.lsp2
-rwxr-xr-xrrdtool-newgraphcfg-html.lsp37
-rw-r--r--rrdtool.roles2
4 files changed, 41 insertions, 2 deletions
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 %>
<TR>
<TD style="padding-right:20px;white-space:nowrap;">
- <% io.write(html.link{value = "editgraphcfg", label="Create new graph " }) %>
+ <% io.write(html.link{value = "newgraphcfg", label="Create new graph " }) %>
</TD>
<TD>&nbsp;</TD><TD>&nbsp;</TD><TD>&nbsp;</TD>
</TR>
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("<H1>DEBUGGING</H1><span style='color:red'><H2>DEBUG INFO: CFE</H2>")
+io.write(html.cfe_unpack(form))
+io.write("</span>")
+--]]
+%>
+
+<H1>Create new rrdtool-graph file</H1>
+
+<% if form.type == "form" then %>
+<% form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action %>
+<% displayformstart(form) %>
+<H3>File Details</H3>
+<DL>
+<DT><% io.write(form.value.filename.label) %></DT>
+<DD>
+<input class="text" type="text" name="filename" value="<%= html.html_escape(form.value.filename.value) %>">
+<% if form.value.filename.errtxt then %><P CLASS='error'><%= string.gsub(html.html_escape(form.value.filename.errtxt), "\n", "<BR>") %></P><% end %>
+<% if form.value.filename.descr then %><P CLASS='descr'><%= string.gsub(html.html_escape(form.value.filename.descr), "\n", "<BR>") %></P><% end %>
+</DD>
+</DL>
+<% end %>
+<H3>File Content</H3>
+<textarea name="filecontent">
+<%= html.html_escape(form.value.filecontent.value) %>
+</textarea>
+<% if form.value.filecontent.errtxt then %><P CLASS='error'><%= string.gsub(html.html_escape(form.value.filecontent.errtxt), "\n", "<BR>") %></P><% end %>
+<% if form.value.filecontent.descr then %><P CLASS='descr'><%= string.gsub(html.html_escape(form.value.filecontent.descr), "\n", "<BR>") %></P><% end %>
+
+<% if form.type == "form" then %>
+<H3>Save</H3>
+<% displayformend(form) %>
+<% end %>
+</form>
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