From 506dc5a9036fdce9e8e12eed1d882496d4f3e17e Mon Sep 17 00:00:00 2001 From: Helge Mader Date: Tue, 25 Feb 2020 09:29:32 +0100 Subject: luci-base: extended network.js for check if new interface is createable Signed-off-by: Helge Mader --- .../luci-base/htdocs/luci-static/resources/network.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'modules/luci-base') diff --git a/modules/luci-base/htdocs/luci-static/resources/network.js b/modules/luci-base/htdocs/luci-static/resources/network.js index 68abb939fc..9dcc1c8ffa 100644 --- a/modules/luci-base/htdocs/luci-static/resources/network.js +++ b/modules/luci-base/htdocs/luci-static/resources/network.js @@ -2297,6 +2297,23 @@ Protocol = L.Class.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 `null` if new interface is createable, else returns (error) message. + */ + isCreateable: function(ifname) { + return Promise.resolve(null); + }, + /** * Checks whether the protocol functionality is installed. * -- cgit v1.2.3