Merge pull request #3712 from TDT-AG/pr/20200303-luci-base

luci-base: extended network.js for check if new interface is createable
This commit is contained in:
Jo-Philipp Wich 2020-03-04 20:26:57 +01:00 committed by GitHub
commit fc94ff1881
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2302,6 +2302,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.
*