luci-base: extended network.js for check if new interface is createable 3712/head
authorHelge Mader <ma@dev.tdt.de>
Tue, 25 Feb 2020 08:29:32 +0000 (09:29 +0100)
committerHelge Mader <ma@dev.tdt.de>
Tue, 3 Mar 2020 12:53:09 +0000 (13:53 +0100)
Signed-off-by: Helge Mader <ma@dev.tdt.de>
modules/luci-base/htdocs/luci-static/resources/network.js

index 68abb939fc63ad578b425fbbaabbf8467f645299..9dcc1c8ffa90bc663ae1de905ca9b7989407cf78 100644 (file)
@@ -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<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.
         *