gluon-status-page: fix display of non-string values from respondd data

Fixes the display of client counts, which are numbers and not strings
in the respondd data.

Fixes: 3a885a1b22 ("gluon-status-page: make "gateway nexthop" a link (#2278)")
(cherry picked from commit a357278464)
This commit is contained in:
Matthias Schiffer 2021-08-08 12:08:50 +02:00
parent b46e1839df
commit 89ad149f93
2 changed files with 3 additions and 4 deletions

File diff suppressed because one or more lines are too long

View File

@ -230,14 +230,13 @@
try { try {
var format_result = formats[format](value, valuePrev, diff); var format_result = formats[format](value, valuePrev, diff);
switch (typeof format_result) { switch (typeof format_result) {
case "string":
elem.textContent = format_result;
break;
case "object": case "object":
if (elem.lastChild) if (elem.lastChild)
elem.removeChild(elem.lastChild); elem.removeChild(elem.lastChild);
elem.appendChild(format_result); elem.appendChild(format_result);
break; break;
default:
elem.textContent = format_result;
} }
} catch (e) { } catch (e) {
console.error(e); console.error(e);