- add missing ui files

This commit is contained in:
Stanislav Ievlev 2009-03-18 17:04:11 +03:00
parent 10dea0a623
commit a15633a38a
2 changed files with 76 additions and 0 deletions

View File

@ -0,0 +1,36 @@
(define-module (ui net-eth advanced ajax)
:use-module (alterator ajax)
:use-module (alterator woo)
:export (init))
(define (ui-read name)
(catch/message
(lambda()
(let ((cmd (woo-read-first "/net-eth" 'name name)))
(form-update-enum "controlled" (woo-list "/net-eth/avail_controlled"))
(form-update-enum "hw_binding" (woo-list "/net-eth/avail_hw_bindings"))
(form-update-value "iface" name)
(form-update-visibility "wireless" (woo-get-option cmd 'wireless))
(form-update-value-list '("name" "controlled" "hw_binding") cmd)))))
(define (ui-exit)
(form-replace (format #f "/net-eth?iface=~A" (form-value "name"))))
(define (ui-write)
(catch/message
(lambda()
(woo-write "/net-eth"
'name (form-value "name")
'hw_binding (form-value "hw_binding")
'controlled (form-value "controlled"))
(ui-exit))))
(define (ui-wireless)
(form-replace (format #f "/net-wifi?iface=~A" (form-value "name"))))
(define (init)
(ui-read (form-value "iface"))
(form-bind "ok" "click" ui-write)
(form-bind "cancel" "click" ui-exit)
(form-bind "wireless" "click" ui-wireless))

View File

@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
<!-- tcp connections module -->
<html wf="none">
<body>
<form method="POST" id="ajax-select">
<input type="hidden" name="name"/>
<table class="form-table">
<tr>
<td><span translate="_">Interface:</span></td>
<td><span name="iface" class="alterator-label"/></td>
</tr>
<tr>
<td><span translate="_">Controlled:</span></td>
<td><select name="controlled" enumref="/net-eth/avail_controlled"></select></td>
</tr>
<tr>
<td><span translate="_">Hardware binding:</span></td>
<td><select name="hw_binding" enumref="/net-eth/avail_hw_bindings"></select></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="button" class="btn" name="wireless" style="display:none" value="Wireless settings..."/>
</td>
</tr>
<tr>
<td colspan="2">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<input type="button" name="ok" value="OK" class="btn"/>
&nbsp;
<input type="button" name="cancel" value="Cancel" class="btn"/>
</td>
</tr>
</table>
</form>
</body>
</html>