Skip to content

Commit

Permalink
Show static IP settings in the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrancis committed Oct 16, 2024
1 parent 4b75352 commit 7499640
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions static/js/views/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -874,9 +874,22 @@ const SettingsScreen = {
API.getLanSettings()
.then((body) => {
this.elements.network.client.ethernet.mode.value = body.mode || 'dhcp';
this.elements.network.client.ethernet.ip.value = body.ipdaddr || '';
this.elements.network.client.ethernet.netmask.value = body.netmask || '255.255.255.0';
this.elements.network.client.ethernet.gateway.value = body.gateway || '';
this.elements.network.client.ethernet.ip.value = body.options.ipaddr || '';
this.elements.network.client.ethernet.netmask.value = body.options.netmask || '255.255.255.0';
this.elements.network.client.ethernet.gateway.value = body.options.gateway || '';
const ethernetEls = [
this.elements.network.client.ethernet.ipLabel,
this.elements.network.client.ethernet.ip,
this.elements.network.client.ethernet.netmaskLabel,
this.elements.network.client.ethernet.netmask,
this.elements.network.client.ethernet.gatewayLabel,
this.elements.network.client.ethernet.gateway,
];
if (body.mode === 'static') {
ethernetEls.forEach((el) => el.classList.remove('hidden'));
} else {
ethernetEls.forEach((el) => el.classList.add('hidden'));
}
})
.catch((e) => {
console.error(`Failed to get ethernet config: ${e}`);
Expand Down

0 comments on commit 7499640

Please sign in to comment.