summaryrefslogtreecommitdiffhomepage
path: root/modules/luci-base/htdocs/luci-static
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-04-06 20:49:44 +0200
committerJo-Philipp Wich <jo@mein.io>2020-04-06 20:49:44 +0200
commit249b5bb8c640f0c3ffcb716965cf729c3df0817b (patch)
tree92041ab7cb213cf587667b8baf4a354035318fa0 /modules/luci-base/htdocs/luci-static
parent77158e2a968734b285a2969d70f6836e04b6bb18 (diff)
luci-base: reintroduce accidentally lost isCreateable() function
Fixes: FS#2976 Fixes: 711f75927 ("luci-base: harmonize JS class naming and requesting") Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2976 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/htdocs/luci-static')
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/network.js18
1 files changed, 18 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 34a802fdfd..0cd4f29bc4 100644
--- a/modules/luci-base/htdocs/luci-static/resources/network.js
+++ b/modules/luci-base/htdocs/luci-static/resources/network.js
@@ -2306,6 +2306,24 @@ Protocol = baseclass.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<void>}
+ * Returns a promise resolving if new interface is createable, else
+ * rejects with an error message string.
+ */
+ isCreateable: function(ifname) {
+ return Promise.resolve(null);
+ },
+
+ /**
* Checks whether the protocol functionality is installed.
*
* This function exists for compatibility with old code, it always