- add missing ui files
This commit is contained in:
parent
10dea0a623
commit
a15633a38a
36
alterator-net-eth/ui/net-eth/advanced/ajax.scm
Normal file
36
alterator-net-eth/ui/net-eth/advanced/ajax.scm
Normal 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))
|
40
alterator-net-eth/ui/net-eth/advanced/index.html
Normal file
40
alterator-net-eth/ui/net-eth/advanced/index.html
Normal 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> </td>
|
||||
<td>
|
||||
<input type="button" class="btn" name="wireless" style="display:none" value="Wireless settings..."/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2"> </td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> </td>
|
||||
<td>
|
||||
<input type="button" name="ok" value="OK" class="btn"/>
|
||||
|
||||
<input type="button" name="cancel" value="Cancel" class="btn"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
Loading…
x
Reference in New Issue
Block a user