From a9168ab7089d89c965696c139d6dc27e653e775c Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Apr 2014 00:27:57 +0000 Subject: Started changes to use new htmlviewfunctions functions --- rrdtool-config-html.lsp | 10 ++++++---- rrdtool-createrrd-html.lsp | 10 ---------- rrdtool-listgraphcfg-html.lsp | 11 ++--------- rrdtool-listrrd-html.lsp | 9 --------- rrdtool-model.lua | 12 ++++++------ 5 files changed, 14 insertions(+), 38 deletions(-) delete mode 100644 rrdtool-createrrd-html.lsp diff --git a/rrdtool-config-html.lsp b/rrdtool-config-html.lsp index fa879a1..a1e0210 100644 --- a/rrdtool-config-html.lsp +++ b/rrdtool-config-html.lsp @@ -5,9 +5,11 @@ htmlviewfunctions = require("htmlviewfunctions") <% htmlviewfunctions.displaycommandresults({"install","editgraphcfg"}, session) %> <% htmlviewfunctions.displaycommandresults({"delete", "rrdinfo"}, session) %> -

Configure

- -<% if viewlibrary and viewlibrary.dispatch_component then +<% +local header_level = htmlviewfunctions.displaysectionstart(cfe({label="Configure"}), page_info) +if viewlibrary and viewlibrary.dispatch_component then viewlibrary.dispatch_component("listrrd") viewlibrary.dispatch_component("listgraphcfg") -end %> +end +htmlviewfunctions.displaysectionend(header_level) +%> diff --git a/rrdtool-createrrd-html.lsp b/rrdtool-createrrd-html.lsp deleted file mode 100644 index 8522a0d..0000000 --- a/rrdtool-createrrd-html.lsp +++ /dev/null @@ -1,10 +0,0 @@ -<% local form, viewlibrary, page_info, session = ... -htmlviewfunctions = require("htmlviewfunctions") -%> -<% htmlviewfunctions.displaycommandresults({"createrrd"}, session) %> - -

Create new RRD

-<% - local order = {"filename", "start", "step", "ds", "rra"} - htmlviewfunctions.displayform(form, order) -%> diff --git a/rrdtool-listgraphcfg-html.lsp b/rrdtool-listgraphcfg-html.lsp index db6ef05..1b844d3 100644 --- a/rrdtool-listgraphcfg-html.lsp +++ b/rrdtool-listgraphcfg-html.lsp @@ -47,7 +47,7 @@ function javascript_confirm_graph(formID,filename) { } -

<%= form.label %>

+<% local header_level = htmlviewfunctions.displaysectionstart(form, page_info) %>
@@ -84,11 +84,4 @@ function javascript_confirm_graph(formID,filename) { <% end %> - -<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then - local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %> -

Create new Domain

-<% - newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/newfile" - htmlviewfunctions.displayform(newfileform) -end %> +<% htmlviewfunctions.displaysectionend(header_level) %> diff --git a/rrdtool-listrrd-html.lsp b/rrdtool-listrrd-html.lsp index cee087c..c9aaf24 100644 --- a/rrdtool-listrrd-html.lsp +++ b/rrdtool-listrrd-html.lsp @@ -84,12 +84,3 @@ function javascript_confirm_demo(formID,filename) { <% end %> - -<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then - local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %> -

Create new Domain

-<% - newfileform.action = page_info.script .. page_info.prefix .. page_info.controller .. "/newfile" - htmlviewfunctions.displayform(newfileform) -end %> - diff --git a/rrdtool-model.lua b/rrdtool-model.lua index 8f97738..ea92fc4 100644 --- a/rrdtool-model.lua +++ b/rrdtool-model.lua @@ -83,16 +83,16 @@ end function mymodule.createnewrrd() local newdb = {} - newdb.filename = cfe({label="Name",value="mydb.rrd",descr="The name of the RRD you want to create. RRD files should end with the extension .rrd. However, RRDtool will accept any filename."}) + newdb.filename = cfe({label="Name",value="mydb.rrd",descr="The name of the RRD you want to create. RRD files should end with the extension .rrd. However, RRDtool will accept any filename.", seq=1}) newdb.start = cfe({label="Start",value="",descr="Specifies the time in seconds since 1970-01-01 UTC when the first value should be added to the RRD. RRDtool will not accept any data timed before or at the time specified.\ (Your system saids that your current time is '" .. tostring(os.time(os.date("*t"))) .. "' in the format you should specify above. The startvalue should be smaller than your current time.)\ -(Default: now - 10s)"}) +(Default: now - 10s)", seq=2}) newdb.step = cfe({label="Step",value="",descr="Specifies the base interval in seconds with which data will be fed into the RRD.\ -(Default: 300)"}) +(Default: 300)", seq=3}) newdb.ds = cfe({label="Data store(s)",value="",descr="DS:ds-name:GAUGE | COUNTER | DERIVE | ABSOLUTE:heartbeat:min:max \ -DS:ds-name:COMPUTE:rpn-expression",type="longtext"}) - newdb.rra = cfe({label="Round Robin Archive(s)",value="",descr="RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows",type="longtext"}) - return {value=newdb} +DS:ds-name:COMPUTE:rpn-expression",type="longtext", seq=4}) + newdb.rra = cfe({label="Round Robin Archive(s)",value="",descr="RRA:AVERAGE | MIN | MAX | LAST:xff:steps:rows",type="longtext", seq=5}) + return cfe({value=newdb, label="Create new RRD"}) end function mymodule.remove_file(self, path, userid) -- cgit v1.2.3