From 249b5bb8c640f0c3ffcb716965cf729c3df0817b Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Mon, 6 Apr 2020 20:49:44 +0200 Subject: [PATCH] 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 --- .../htdocs/luci-static/resources/network.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 34a802fdf..0cd4f29bc 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -2305,6 +2305,24 @@ Protocol = baseclass.extend(/** @lends LuCI.network.Protocol.prototype */ { return null; }, + /** + * 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} + * 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. * -- 2.25.1