luci-base: reintroduce accidentally lost isCreateable() function
authorJo-Philipp Wich <jo@mein.io>
Mon, 6 Apr 2020 18:49:44 +0000 (20:49 +0200)
committerJo-Philipp Wich <jo@mein.io>
Mon, 6 Apr 2020 18:49:44 +0000 (20:49 +0200)
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>
modules/luci-base/htdocs/luci-static/resources/network.js

index 34a802fdfdb0fc7660949e24ba48d180adf2af71..0cd4f29bc4d5aa3b3a28f25a37aed87d0e05aaf5 100644 (file)
@@ -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<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.
         *