mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
Convert luci-app-macvlan to client side rendering
This commit is contained in:
parent
7953a89337
commit
c8be607e09
9 changed files with 60 additions and 115 deletions
|
@ -0,0 +1,35 @@
|
|||
'use strict';
|
||||
'require rpc';
|
||||
'require form';
|
||||
'require tools.widgets as widgets';
|
||||
|
||||
return L.view.extend({
|
||||
callHostHints: rpc.declare({
|
||||
object: 'luci-rpc',
|
||||
method: 'getHostHints',
|
||||
expect: { '': {} }
|
||||
}),
|
||||
|
||||
load: function() {
|
||||
return this.callHostHints();
|
||||
},
|
||||
|
||||
render: function(hosts) {
|
||||
var m, s, o;
|
||||
|
||||
m = new form.Map('macvlan', _('Macvlan'));
|
||||
|
||||
s = m.section(form.GridSection, 'macvlan', _('Interfaces'));
|
||||
s.addremove = true;
|
||||
s.anonymous = true;
|
||||
|
||||
o = s.option(form.Value, 'name', _('Name'));
|
||||
o.datatype = 'uciname';
|
||||
o.rmempty = false;
|
||||
|
||||
o = s.option(widgets.DeviceSelect, 'ifname', _('Interface'));
|
||||
o.rmempty = false;
|
||||
|
||||
return m.render();
|
||||
}
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue