summaryrefslogtreecommitdiffstats
path: root/interfaces-create-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces-create-html.lsp')
-rw-r--r--interfaces-create-html.lsp37
1 files changed, 37 insertions, 0 deletions
diff --git a/interfaces-create-html.lsp b/interfaces-create-html.lsp
new file mode 100644
index 0000000..56e9790
--- /dev/null
+++ b/interfaces-create-html.lsp
@@ -0,0 +1,37 @@
+<? local form = ...
+ require ("html") ?>
+<h1>Create Interface</h1>
+
+<form action="<?= form.option.script .. "/" .. form.option.prefix ..
+ form.option.controller .. "/" .. form.option.action ..
+ form.option.extra ?>" method="POST">
+<table>
+
+<? local myform = form.value
+
+-- We redefine the list of tags from the model (iface_tags) because
+-- the VIEW can choose the order to display the data. The Controller
+-- does not care what order the data is presented.
+
+-- In this case, we don do show "name"
+local tags = { "name", "comment", "method", "address", "netmask", "gateway",
+ "hostname", "provider", "pre-up", "up", "down", "post-down", "cmd" }
+
+for i,v in pairs(tags) do
+ local val = myform[v] ?>
+<tr><td><? if (val.label) then io.write(val.label) else io.write (v) end ?></td><td>
+ <? if val.name == "" then
+ val.name = v
+ end
+
+ if val.type == "longtext" then
+ val.cols = 60
+ val.rows = 3
+ end
+
+ ?>
+ <?= html.form[val.type](val) ?>
+</td></tr>
+<? end ?>
+</table>
+</form>