Merge pull request #6626 from oskarirauta/luci-cni-protocol
authorFlorian Eckert <fe@dev.tdt.de>
Tue, 10 Oct 2023 05:57:59 +0000 (07:57 +0200)
committerPaul Donald <newtwen@gmail.com>
Mon, 4 Dec 2023 22:10:48 +0000 (23:10 +0100)
luci-proto-cni: protocol update
(cherry picked from commit 88d1893b9c21ce716d9bec4c40f6c9720becf220)

protocols/luci-proto-cni/htdocs/luci-static/resources/protocol/cni.js

index 7e2239848542ae2f892c03c2c67c363061aaaa66..273067fd438b44c7b0b1906b6875fd697c4a1467 100644 (file)
@@ -1,8 +1,42 @@
 'use strict';
+'require form';
 'require network';
 
 return network.registerProtocol('cni', {
        getI18n: function () {
                return _('CNI (Externally managed interface)');
+       },
+
+       getOpkgPackage: function() {
+               return "cni-protocol";
+       },
+
+       isFloating: function() {
+               return true;
+       },
+
+       isVirtual: function() {
+               return true;
+       },
+
+       getDevices: function() {
+               return null;
+       },
+
+       renderFormOptions: function(s) {
+               var o;
+
+               o = s.taboption('general', form.Value, '_device', _('Device'));
+               o.ucioption = 'device';
+               o.optional = false;
+               o.rmempty = false;
+
+               o = s.taboption('general', form.Value, '_delay', _('Delay'), _('Afer making changes to network using CNI protocol, network must be manually restarted.'));
+               o.ucioption = 'delay';
+               o.placeholder = '10';
+               o.datatype = 'min(1)';
+               o.optional = true;
+               o.rmempty = true;
        }
+
 });