From 6cb05ce009fe2cea709aa2300ca43d73f96fd92f Mon Sep 17 00:00:00 2001 From: Simon Smith Date: Thu, 18 Jan 2024 21:42:17 +0000 Subject: [PATCH] add dns servers to details tab (#5709) Signed-off-by: si458 --- agents/meshcore.js | 1 + views/default-mobile.handlebars | 7 ++++++- views/default.handlebars | 9 +++++++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/agents/meshcore.js b/agents/meshcore.js index a88d31c5..1c6284e8 100644 --- a/agents/meshcore.js +++ b/agents/meshcore.js @@ -1921,6 +1921,7 @@ function getSystemInformation(func) { } catch (ex) { } } results.hardware.agentvers = process.versions; + results.hardware.network = { dns: require('os').dns() }; replaceSpacesWithUnderscoresRec(results); var hasher = require('SHA384Stream').create(); // results.hash = hasher.syncHash(JSON.stringify(results)).toString('hex'); diff --git a/views/default-mobile.handlebars b/views/default-mobile.handlebars index 386b684c..d230e06b 100644 --- a/views/default-mobile.handlebars +++ b/views/default-mobile.handlebars @@ -6015,7 +6015,12 @@ if (iplayer.family == 'IPv6') { x += addDetailItem("IPv6 Layer", items.join(", ")); } } } - x += ''; + x += ''; + } + if (hardware.network && hardware.network.dns) { + x += '
'; + x += addDetailItem("DNS Servers", hardware.network.dns.join(", ")); + x += '
'; } x += ''; if (x != '') { sections.push({ name: "Networking", html: x, img: 'networking' }); } diff --git a/views/default.handlebars b/views/default.handlebars index 7394de2f..7c333d52 100644 --- a/views/default.handlebars +++ b/views/default.handlebars @@ -11877,7 +11877,7 @@ if (ipv4layer.v4addr) { x += addDetailItem("IPv4 Layer", format("IP: {0}", EscapeHtml(ipv4layer.v4addr))); } } } - x += ''; + x += ''; } x += ''; if (x != '') { sections.push({ name: "Networking", html: x, img: 'networking64.png'}); } @@ -11915,7 +11915,12 @@ if (iplayer.family == 'IPv6') { x += addDetailItem("IPv6 Layer", items.join(", ")); } } } - x += ''; + x += ''; + } + if (hardware.network && hardware.network.dns) { + x += '
'; + x += addDetailItem("DNS Servers", hardware.network.dns.join(", ")); + x += '
'; } x += ''; if (x != '') { sections.push({ name: "Networking", html: x, img: 'networking64.png'}); }