Merge pull request #6755 from EvanTheB/modemaster
luci-base: Display 'Access Point' in the wireless page instead of 'Master'
This commit is contained in:
commit
c3fc80c92a
2 changed files with 16 additions and 11 deletions
|
@ -3823,8 +3823,8 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
|
||||||
* Query the current operation mode from runtime information.
|
* Query the current operation mode from runtime information.
|
||||||
*
|
*
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
* Returns the human readable mode name as reported by `ubus` runtime
|
* Returns the human readable mode name as reported by iwinfo or uci mode.
|
||||||
* state. Possible returned values are:
|
* Possible returned values are:
|
||||||
* - `Master`
|
* - `Master`
|
||||||
* - `Ad-Hoc`
|
* - `Ad-Hoc`
|
||||||
* - `Client`
|
* - `Client`
|
||||||
|
@ -3837,13 +3837,13 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
|
||||||
* - `Unknown`
|
* - `Unknown`
|
||||||
*/
|
*/
|
||||||
getActiveMode: function() {
|
getActiveMode: function() {
|
||||||
var mode = this.ubus('net', 'iwinfo', 'mode') || this.ubus('net', 'config', 'mode') || this.get('mode') || 'ap';
|
var mode = this.ubus('net', 'iwinfo', 'mode') || this.getMode();
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 'ap': return 'Master';
|
case 'ap': return 'Master';
|
||||||
case 'sta': return 'Client';
|
case 'sta': return 'Client';
|
||||||
case 'adhoc': return 'Ad-Hoc';
|
case 'adhoc': return 'Ad-Hoc';
|
||||||
case 'mesh': return 'Mesh';
|
case 'mesh': return 'Mesh Point';
|
||||||
case 'monitor': return 'Monitor';
|
case 'monitor': return 'Monitor';
|
||||||
default: return mode;
|
default: return mode;
|
||||||
}
|
}
|
||||||
|
@ -3861,12 +3861,17 @@ WifiNetwork = baseclass.extend(/** @lends LuCI.network.WifiNetwork.prototype */
|
||||||
var mode = this.getActiveMode();
|
var mode = this.getActiveMode();
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
case 'Master': return _('Master');
|
case 'Master': return _('Access Point');
|
||||||
case 'Client': return _('Client');
|
case 'Ad-Hoc': return _('Ad-Hoc');
|
||||||
case 'Ad-Hoc': return _('Ad-Hoc');
|
case 'Client': return _('Client');
|
||||||
case 'Mash': return _('Mesh');
|
case 'Monitor': return _('Monitor');
|
||||||
case 'Monitor': return _('Monitor');
|
case 'Master(VLAN)': return _('Master (VLAN)');
|
||||||
default: return mode;
|
case 'WDS': return _('WDS');
|
||||||
|
case 'Mesh Point': return _('Mesh Point');
|
||||||
|
case 'P2P Client': return _('P2P Client');
|
||||||
|
case 'P2P Go': return _('P2P Go');
|
||||||
|
case 'Unknown': return _('Unknown');
|
||||||
|
default: return mode;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
@ -1761,7 +1761,7 @@ function wifinet.active_mode(self)
|
||||||
if m == "ap" then m = "Master"
|
if m == "ap" then m = "Master"
|
||||||
elseif m == "sta" then m = "Client"
|
elseif m == "sta" then m = "Client"
|
||||||
elseif m == "adhoc" then m = "Ad-Hoc"
|
elseif m == "adhoc" then m = "Ad-Hoc"
|
||||||
elseif m == "mesh" then m = "Mesh"
|
elseif m == "mesh" then m = "Mesh Point"
|
||||||
elseif m == "monitor" then m = "Monitor"
|
elseif m == "monitor" then m = "Monitor"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue