mirror of
https://github.com/pi-hole/web.git
synced 2025-12-19 18:28:24 +00:00
Add basic interface information on Settings->System page
Signed-off-by: DL6ER <dl6er@dl6er.de>
This commit is contained in:
@@ -362,4 +362,23 @@ $(function () {
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "/api/network/gateway",
|
||||
})
|
||||
.done(function (data) {
|
||||
const gateway = data.gateway;
|
||||
// Get first object in gateway that has family == "inet"
|
||||
const inet = gateway.find(obj => obj.family === "inet");
|
||||
// Get first object in gateway that has family == "inet6"
|
||||
const inet6 = gateway.find(obj => obj.family === "inet6");
|
||||
|
||||
$("#sysinfo-gw-v4-addr").text(inet ? inet.local.join('\n') : "N/A");
|
||||
$("#sysinfo-gw-v4-iface").text(inet ? inet.interface : "N/A");
|
||||
$("#sysinfo-gw-v6-addr").text(inet6 ? inet6.local.join('\n') : "N/A");
|
||||
$("#sysinfo-gw-v6-iface").text(inet6 ? inet6.interface : "N/A");
|
||||
})
|
||||
.fail(function (data) {
|
||||
apiFailure(data);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -54,6 +54,18 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<table class="table table-striped table-bordered nowrap">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th scope="row">IPv4 address:</th>
|
||||
<td><code id="sysinfo-gw-v4-addr">?</code> @ <code id="sysinfo-gw-v4-iface">?</code></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th scope="row">IPv6 address:</th>
|
||||
<td><code id="sysinfo-gw-v6-addr">?</code> @ <code id="sysinfo-gw-v6-iface">?</code></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user