diff options
author | Jo-Philipp Wich <jo@mein.io> | 2023-10-10 23:49:59 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-10 23:49:59 +0200 |
commit | bd9e79b974c557a2a4e4452e1f72b1c60d6ccd7f (patch) | |
tree | d1094c84f935ec01fbea5ed94e0b535eef21a85e /applications/luci-app-ksmbd | |
parent | 88d1893b9c21ce716d9bec4c40f6c9720becf220 (diff) | |
parent | 55643d2075ee6cc4b6c4e16dd8e45b9899fe02fb (diff) |
Merge pull request #6631 from raenye/ksmbd-multi-iface
luci-app-ksmbd: add UI for multiple interfaces
Diffstat (limited to 'applications/luci-app-ksmbd')
-rw-r--r-- | applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js b/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js index 3c94b15eb3..7408c33c44 100644 --- a/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js +++ b/applications/luci-app-ksmbd/htdocs/luci-static/resources/view/ksmbd.js @@ -2,6 +2,7 @@ 'require view'; 'require fs'; 'require form'; +'require uci'; 'require tools.widgets as widgets'; return view.extend({ @@ -32,8 +33,20 @@ return view.extend({ s.tab('general', _('General Settings')); s.tab('template', _('Edit Template'), _('Edit the template that is used for generating the ksmbd configuration.')); - s.taboption('general', widgets.NetworkSelect, 'interface', _('Interface'), + o = s.taboption('general', widgets.NetworkSelect, 'interface', _('Interface'), _('Listen only on the given interface or, if unspecified, on lan')); + o.multiple = true; + o.cfgvalue = (section_id => L.toArray(uci.get('ksmbd', section_id, 'interface'))); + o.write = function(section_id, formvalue) { + var cfgvalue = this.cfgvalue(section_id), + oldNetworks = L.toArray(cfgvalue), + newNetworks = L.toArray(formvalue); + oldNetworks.sort(); + newNetworks.sort(); + if (oldNetworks.join(' ') == newNetworks.join(' ')) + return; + return uci.set('ksmbd', section_id, 'interface', newNetworks.join(' ')); + }; o = s.taboption('general', form.Value, 'workgroup', _('Workgroup')); o.placeholder = 'WORKGROUP'; |