Skip to content

Commit

Permalink
Support systems without IPv4 or IPv6 gateways
Browse files Browse the repository at this point in the history
Signed-off-by: DL6ER <[email protected]>
  • Loading branch information
DL6ER committed Jul 18, 2024
1 parent 0ecb182 commit b6cfe29
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 8 additions & 1 deletion scripts/pi-hole/js/interfaces.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,14 @@ $(function () {
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");
const gateways = new Set([inet.interface, inet6.interface]);
// Create a set of the gateways when they are found
const gateways = new Set();
if (inet !== undefined) {
gateways.add(inet.gateway);
}
if (inet6 !== undefined) {

Check failure on line 26 in scripts/pi-hole/js/interfaces.js

View workflow job for this annotation

GitHub Actions / Node

Expected blank line before this statement.
gateways.add(inet6.gateway);
}

var json = [];

Expand Down
5 changes: 3 additions & 2 deletions settings-system.lp
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,15 @@ mg.include('scripts/pi-hole/lua/settings_header.lp','r')
</tr>
</tbody>
</table>
<h4>Primary IP addresses</h4>
<table class="table table-striped table-bordered nowrap">
<tbody>
<tr>
<th scope="row">IPv4 address:</th>
<th scope="row">IPv4</th>
<td><code id="sysinfo-gw-v4-addr">?</code>&nbsp;@&nbsp;<code id="sysinfo-gw-v4-iface">?</code></td>
</tr>
<tr>
<th scope="row">IPv6 address:</th>
<th scope="row">IPv6</th>
<td><code id="sysinfo-gw-v6-addr">?</code>&nbsp;@&nbsp;<code id="sysinfo-gw-v6-iface">?</code></td>
</tr>
</tbody>
Expand Down

0 comments on commit b6cfe29

Please sign in to comment.