Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Network: change wpa-none to none #206

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ app.post('/api/networkedit', [check('conName').isUUID(),
check('conSettings.ipaddresstype.value').isIn(['auto', 'manual', 'shared']),
check('conSettings.ipaddress.value').optional().isIP(),
check('conSettings.subnet.value').optional().isIP(),
check('conSettings.wpaType.value').optional().isIn(['wpa-none', 'wpa-psk']),
check('conSettings.wpaType.value').optional().isIn(['none', 'wpa-psk']),
check('conSettings.password.value').optional().escape(),
check('conSettings.ssid.value').optional().escape(),
check('conSettings.attachedIface.value').optional().escape(),
Expand Down Expand Up @@ -827,7 +827,7 @@ app.post('/api/networkedit', [check('conName').isUUID(),
app.post('/api/networkadd', [check('conSettings.ipaddresstype.value').isIn(['auto', 'manual', 'shared']),
check('conSettings.ipaddress.value').optional().isIP(),
check('conSettings.subnet.value').optional().isIP(),
check('conSettings.wpaType.value').optional().isIn(['wpa-none', 'wpa-psk']),
check('conSettings.wpaType.value').optional().isIn(['none', 'wpa-psk']),
check('conSettings.password.value').optional().escape(),
check('conSettings.ssid.value').optional().escape(),
check('conSettings.band.value').optional().isIn(['a', 'bg']),
Expand Down
4 changes: 2 additions & 2 deletions server/networkManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ function editConnectionPSK (conName, conSettings, callback) {
// now sort out Wifi client/ap settings - password and security type
if (conSettings.mode.value === 'infrastructure' || conSettings.mode.value === 'ap') {
// psk network
if (conSettings.wpaType.value !== 'wpa-none' &&
if (conSettings.wpaType.value !== 'none' &&
Object.keys(conSettings.ssid).length !== 0 &&
Object.keys(conSettings.password).length !== 0) {
exec('nmcli connection mod ' + conName + ' 802-11-wireless-security.key-mgmt ' + conSettings.wpaType.value + ' &&' +
Expand All @@ -308,7 +308,7 @@ function editConnectionPSK (conName, conSettings, callback) {
})
}
// no psk. Note the dirty hack to remove psk
else if (conSettings.wpaType.value === 'wpa-none' &&
else if (conSettings.wpaType.value === 'none' &&
Object.keys(conSettings.ssid).length !== 0) {
exec('nmcli connection mod ' + conName + ' 802-11-wireless-security.key-mgmt ' + conSettings.wpaType.value + ' &&' +
'nmcli -s connection mod ' + conName + ' 802-11-wireless-security.psk 00000000', (error, stdout, stderr) => {
Expand Down
14 changes: 7 additions & 7 deletions src/networkconfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class NetworkConfig extends basePage {
netConnectionDetails: {},
netConnectionSimilarIfaces: [],
showIP: false,
wpaTypes: [{ value: 'wpa-none', text: 'None' }, { value: 'wpa-psk', text: 'WPA (PSK)' }],
wpaTypes: [{ value: 'none', text: 'None' }, { value: 'wpa-psk', text: 'WPA (PSK)' }],
bandTypes: [{ value: 'a', text: '5 GHz' }, { value: 'bg', text: '2.4 GHz' }],
availChannels: [],
curSettings: {
Expand Down Expand Up @@ -469,7 +469,7 @@ class NetworkConfig extends basePage {
var nm = this.state.netConnectionFilteredSelected.label;
this.setState({
netConnectionFilteredSelected: { value: 'new', label: nm, type: this.state.netDeviceSelected.type, state: "" },
curSettings: { mode: { value: "infrastructure" }, ipaddresstype: { value: "auto" }, band: { value: "" }, channel: { value: '0' }, ssid: { value: selssid }, ipaddress: { value: "" }, subnet: { value: "" }, wpaType: { value: selsecurity === '' ? 'wpa-none' : 'wpa-psk' }, password: { value: "" }, attachedIface: { value: '""' } }
curSettings: { mode: { value: "infrastructure" }, ipaddresstype: { value: "auto" }, band: { value: "" }, channel: { value: '0' }, ssid: { value: selssid }, ipaddress: { value: "" }, subnet: { value: "" }, wpaType: { value: selsecurity === '' ? 'none' : 'wpa-psk' }, password: { value: "" }, attachedIface: { value: '""' } }
});
}

Expand Down Expand Up @@ -713,12 +713,12 @@ class NetworkConfig extends basePage {
</select>
</div>
</div>
<div style={{ display: (this.state.curSettings.wpaType.value !== "wpa-none") ? "block" : "none" }}>
<div style={{ display: (this.state.curSettings.wpaType.value !== "none") ? "block" : "none" }}>
<div className="form-group row" style={{ marginBottom: '5px' }}>
<label className="col-sm-4 col-form-label">Password</label>
<div className="col-sm-8">
<input name="password" type={this.state.showPW === true ? "text" : "password"} disabled={this.state.curSettings.wpaType.value === "wpa-none"} value={this.state.curSettings.wpaType.value === "wpa-none" ? '' : this.state.curSettings.password.value} onChange={this.changeHandler} /><br />
<input name="showpassword" type="checkbox" checked={this.state.showPW} disabled={this.state.curSettings.wpaType.value === "wpa-none"} onChange={this.togglePasswordVisible} /><label>Show Password</label>
<input name="password" type={this.state.showPW === true ? "text" : "password"} disabled={this.state.curSettings.wpaType.value === "none"} value={this.state.curSettings.wpaType.value === "none" ? '' : this.state.curSettings.password.value} onChange={this.changeHandler} /><br />
<input name="showpassword" type="checkbox" checked={this.state.showPW} disabled={this.state.curSettings.wpaType.value === "none"} onChange={this.togglePasswordVisible} /><label>Show Password</label>
</div>
</div>
</div>
Expand Down Expand Up @@ -768,8 +768,8 @@ class NetworkConfig extends basePage {
<div className="form-group row" style={{ marginBottom: '5px' }}>
<label className="col-sm-4 col-form-label">Password</label>
<div className="col-sm-8">
<input name="password" type={this.state.showPW === true ? "text" : "password"} disabled={this.state.curSettings.wpaType.value === "wpa-none"} value={this.state.curSettings.wpaType.value === "wpa-none" ? '' : this.state.curSettings.password.value} onChange={this.changeHandler} /><br />
<input name="showpassword" type="checkbox" checked={this.state.showPW} disabled={this.state.curSettings.wpaType.value === "wpa-none"} onChange={this.togglePasswordVisible} /><label>Show Password</label>
<input name="password" type={this.state.showPW === true ? "text" : "password"} disabled={this.state.curSettings.wpaType.value === "none"} value={this.state.curSettings.wpaType.value === "none" ? '' : this.state.curSettings.password.value} onChange={this.changeHandler} /><br />
<input name="showpassword" type="checkbox" checked={this.state.showPW} disabled={this.state.curSettings.wpaType.value === "none"} onChange={this.togglePasswordVisible} /><label>Show Password</label>
</div>
</div>

Expand Down
Loading