diff options
l--------- | dhcp-createhost-html.lsp | 1 | ||||
-rw-r--r-- | dhcp-edithost-html.lsp | 13 | ||||
-rw-r--r-- | dhcp-listhosts-html.lsp | 27 |
3 files changed, 41 insertions, 0 deletions
diff --git a/dhcp-createhost-html.lsp b/dhcp-createhost-html.lsp new file mode 120000 index 0000000..1b2c3b9 --- /dev/null +++ b/dhcp-createhost-html.lsp @@ -0,0 +1 @@ +dhcp-edithost-html.lsp
\ No newline at end of file diff --git a/dhcp-edithost-html.lsp b/dhcp-edithost-html.lsp new file mode 100644 index 0000000..e02e5b3 --- /dev/null +++ b/dhcp-edithost-html.lsp @@ -0,0 +1,13 @@ +<% local form, viewlibrary, page_info = ... +require("viewfunctions") +%> + +<H1><%= form.label %></H1> +<% + form.action = page_info.script .. page_info.prefix .. page_info.controller .. "/" .. page_info.action + if page_info.action == "edithost" then + form.value.host.contenteditable = false + end + local order = {"host", "mac", "ip"} + displayform(form, order) +%> diff --git a/dhcp-listhosts-html.lsp b/dhcp-listhosts-html.lsp new file mode 100644 index 0000000..2ef1646 --- /dev/null +++ b/dhcp-listhosts-html.lsp @@ -0,0 +1,27 @@ +<% local view, viewlibrary, page_info, session = ... %> +<% require("viewfunctions") %> + +<H1>Host Declarations</H1> + +<DL> +<TABLE> + <TR style="background:#eee;font-weight:bold;"> + <TD style="padding-right:20px;white-space:nowrap;text-align:left;" class="header">Action</TD> + <TD style="white-space:nowrap;text-align:left;" class="header">Host</TD> + </TR> +<% for i,host in ipairs(view.value) do %> + <TR> + <TD style="padding-right:20px;white-space:nowrap;"> + <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/edithost?host="..host, label="Edit "} %> + <%= html.link{value=page_info.script..page_info.prefix..page_info.controller.."/delhost?host="..host, label="Delete "} %> + </TD> + <TD style="white-space:nowrap;"><%= host %></TD> + </TR> +<% end %> +</TABLE> + +<dt>Add new host</dt> +<dd><form action="<%= page_info.script .. page_info.prefix .. page_info.controller .. "/createhost" %>" method="POST"> +<input type=submit value="New" class="submit"> +</form></dd> +</DL> |