summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-03-04 20:26:57 +0100
committerGitHub <noreply@github.com>2020-03-04 20:26:57 +0100
commitfc94ff1881dc50539fc03a734ada264590121883 (patch)
tree14577d3e9270216d080980bbd4f2b8dee3055ff7 /modules/luci-base/htdocs
parent2c036b36ce76c3c7430bf936e131f0d9d4ab83c4 (diff)
parent506dc5a9036fdce9e8e12eed1d882496d4f3e17e (diff)
Merge pull request #3712 from TDT-AG/pr/20200303-luci-base
luci-base: extended network.js for check if new interface is createable
Diffstat (limited to 'modules/luci-base/htdocs')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/network.js17
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js
index 796b613be..c79022968 100644
--- a/modules/luci-base/htdocs/luci-static/resources/network.js
+++ b/modules/luci-base/htdocs/luci-static/resources/network.js
@@ -2303,6 +2303,23 @@ Protocol = L.Class.extend(/** @lends LuCI.Network.Protocol.prototype */ {
},
/**
+ * Check function for the protocol handler if a new interface is createable.
+ *
+ * This function should be overwritten by protocol specific subclasses.
+ *
+ * @abstract
+ *
+ * @param {string} ifname
+ * The name of the interface to be created.
+ *
+ * @returns {Promise<null|error message>}
+ * Returns `null` if new interface is createable, else returns (error) message.
+ */
+ isCreateable: function(ifname) {
+ return Promise.resolve(null);
+ },
+
+ /**
* Checks whether the protocol functionality is installed.
*
* This function exists for compatibility with old code, it always