summaryrefslogtreecommitdiffstats
path: root/interfaces-read-html.lsp
diff options
context:
space:
mode:
Diffstat (limited to 'interfaces-read-html.lsp')
-rw-r--r--interfaces-read-html.lsp34
1 files changed, 34 insertions, 0 deletions
diff --git a/interfaces-read-html.lsp b/interfaces-read-html.lsp
new file mode 100644
index 0000000..0b377bb
--- /dev/null
+++ b/interfaces-read-html.lsp
@@ -0,0 +1,34 @@
+<? local view = ... ?>
+<h1>Interfaces file</h1>
+
+<table border=1>
+<? for i=0,table.maxn(view.iface) do
+ local iface=""
+ if i > 0 then do
+ j = view.iface[i]
+ iface = j.name.value ?>
+ <tr><td><?= j.name.value ?></td><td><?= j.method.value ?></td> <td><?
+ if ( j.method.value == "dhcp" ) then
+ io.write (j.hostname.value )
+ else
+ io.write ( j.address.value .. "/" .. j.netmask.value )
+ end ?></td><td><?
+ for x=3,4 do
+ a=view.actions.action[x]
+ io.write ("<a href=\"" .. view.actions.link .. a ..
+ "?iface=" .. j.name.value .. "\"" ..
+ ">" .. a .. "</a>\n&nbsp;" )
+ end
+ ?></td></tr><?
+ end
+end ?>
+<tr><td></td><td></td><td></td><td><?
+ a = view.actions.action[1]
+ io.write ("<a href=\"" .. view.actions.link .. a ..
+ "?iface=" .. iface .. "\"" ..
+ ">" .. a .. "</a>\n&nbsp;" )
+ ?></td></tr>
+<?
+end
+?>
+</table>