From 0dd348c87f590861c252194b1720921d8779b4a1 Mon Sep 17 00:00:00 2001 From: Oskari Rauta Date: Thu, 30 Nov 2023 07:35:48 +0200 Subject: [PATCH] luci-proto-external: migrate from support to cni-protocol to external-protocol As previously introduced cni protocol support (for netifd) has evolved more to a multipurpose protocol useful for cni/netavark/some vpn/etc connections I have decided to rename it from cni-protocol to external-protocol. That's why also it's luci companion, luci-proto-cni, should be renamed to luci-proto-external and migrated to support external-protocol. This patch also adds support for new option in external-protocol, delay. This closes promise made in #22702 on openwrt packages repository. Signed-off-by: Oskari Rauta --- .../Makefile | 4 ++-- .../luci-static/resources/protocol/external.js} | 13 +++++++++---- 2 files changed, 11 insertions(+), 6 deletions(-) rename protocols/{luci-proto-cni => luci-proto-external}/Makefile (54%) rename protocols/{luci-proto-cni/htdocs/luci-static/resources/protocol/cni.js => luci-proto-external/htdocs/luci-static/resources/protocol/external.js} (62%) diff --git a/protocols/luci-proto-cni/Makefile b/protocols/luci-proto-external/Makefile similarity index 54% rename from protocols/luci-proto-cni/Makefile rename to protocols/luci-proto-external/Makefile index 6405fca0fd..b9b146d7bd 100644 --- a/protocols/luci-proto-cni/Makefile +++ b/protocols/luci-proto-external/Makefile @@ -1,7 +1,7 @@ include $(TOPDIR)/rules.mk -LUCI_TITLE:=Support for CNI protocol -LUCI_DEPENDS:=+cni-protocol +LUCI_TITLE:=Support for externally managed protocol +LUCI_DEPENDS:=+external-protocol include ../../luci.mk diff --git a/protocols/luci-proto-cni/htdocs/luci-static/resources/protocol/cni.js b/protocols/luci-proto-external/htdocs/luci-static/resources/protocol/external.js similarity index 62% rename from protocols/luci-proto-cni/htdocs/luci-static/resources/protocol/cni.js rename to protocols/luci-proto-external/htdocs/luci-static/resources/protocol/external.js index 273067fd43..06bd5f3f66 100644 --- a/protocols/luci-proto-cni/htdocs/luci-static/resources/protocol/cni.js +++ b/protocols/luci-proto-external/htdocs/luci-static/resources/protocol/external.js @@ -2,13 +2,13 @@ 'require form'; 'require network'; -return network.registerProtocol('cni', { +return network.registerProtocol('external', { getI18n: function () { - return _('CNI (Externally managed interface)'); + return _('Externally managed interface'); }, getOpkgPackage: function() { - return "cni-protocol"; + return "external-protocol"; }, isFloating: function() { @@ -31,12 +31,17 @@ return network.registerProtocol('cni', { 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 = s.taboption('general', form.Value, '_delay', _('Delay'), _('Afer making changes to network using external protocol, network must be manually restarted.')); o.ucioption = 'delay'; o.placeholder = '10'; o.datatype = 'min(1)'; o.optional = true; o.rmempty = true; + + o = s.taboption('general', form.Value, '_searchdomain', _('Search domain')); + o.ucioption = 'searchdomain' + o.optional = true; + o.rmempty = true; } });