diff --git a/files/app/main/app.ut b/files/app/main/app.ut index 6ce26aee..93da4fb4 100755 --- a/files/app/main/app.ut +++ b/files/app/main/app.ut @@ -69,7 +69,7 @@ {{_R("selection")}}
-
+
{{_R(request.page)}}
@@ -105,7 +105,7 @@ {{_R("selection")}}
-
+
{{_R(request.page)}}
diff --git a/files/app/main/status/e/basics.ut b/files/app/main/status/e/basics.ut index d6f005e3..d00fe74e 100755 --- a/files/app/main/status/e/basics.ut +++ b/files/app/main/status/e/basics.ut @@ -178,7 +178,7 @@ if (request.env.REQUEST_METHOD === "DELETE") {
Theme
-
Display theme and colors
+
Display theme and colors

{% @@ -355,7 +355,7 @@ if (request.env.REQUEST_METHOD === "DELETE") { htmx.find("#portable-theme").style.display = ""; } else if (j.portableTheme === true) { - htmx.find("#select-theme .m").innerHTML = "Display theme and colors seen by others. You see your portable theme."; + htmx.find("#select-theme .m").innerHTML = "Display theme and colors seen by others. You see your portable theme when possible."; } }); } diff --git a/files/app/main/status/e/packages.ut b/files/app/main/status/e/packages.ut index ef0ded10..cf19a092 100755 --- a/files/app/main/status/e/packages.ut +++ b/files/app/main/status/e/packages.ut @@ -426,7 +426,7 @@ const po = getPackageOptions(); }); }); htmx.on("#dialog-done", "click", _ => { - htmx.ajax("GET", "/a/packages", { + htmx.ajax("GET", "/a/u-packages", { swap: "none" }); }); diff --git a/files/app/main/dhcp.ut b/files/app/main/u-dhcp.ut similarity index 100% rename from files/app/main/dhcp.ut rename to files/app/main/u-dhcp.ut diff --git a/files/app/main/health.ut b/files/app/main/u-health.ut similarity index 100% rename from files/app/main/health.ut rename to files/app/main/u-health.ut diff --git a/files/app/main/local-and-neighbor-devices.ut b/files/app/main/u-local-and-neighbor-devices.ut similarity index 100% rename from files/app/main/local-and-neighbor-devices.ut rename to files/app/main/u-local-and-neighbor-devices.ut diff --git a/files/app/main/mesh-summary.ut b/files/app/main/u-mesh-summary.ut similarity index 100% rename from files/app/main/mesh-summary.ut rename to files/app/main/u-mesh-summary.ut diff --git a/files/app/main/u-mesh.ut b/files/app/main/u-mesh.ut new file mode 100755 index 00000000..3a05cc0f --- /dev/null +++ b/files/app/main/u-mesh.ut @@ -0,0 +1,35 @@ +{% +/* + * Part of AREDN® -- Used for creating Amateur Radio Emergency Data Networks + * Copyright (C) 2024 Tim Wilkinson + * See Contributors file for additional contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Additional Terms: + * + * Additional use restrictions exist on the AREDN® trademark and logo. + * See AREDNLicense.txt for more info. + * + * Attributions to the AREDN® Project must be retained in the source code. + * If importing this code into a new or existing project attribution + * to the AREDN® project must be added to the source code. + * + * You must not misrepresent the origin of the material contained within. + * + * Modified versions must be modified to attribute to the original source + * and be marked in reasonable ways as differentiate it from the original + * version + */ +%} +{{_R("mesh")}} diff --git a/files/app/main/messages.ut b/files/app/main/u-messages.ut similarity index 100% rename from files/app/main/messages.ut rename to files/app/main/u-messages.ut diff --git a/files/app/main/packages.ut b/files/app/main/u-packages.ut similarity index 96% rename from files/app/main/packages.ut rename to files/app/main/u-packages.ut index dd63ce0f..a372bc6c 100755 --- a/files/app/main/packages.ut +++ b/files/app/main/u-packages.ut @@ -32,6 +32,6 @@ * version */ %} -div id="packages" hx-swap-oob="innerHTML"> +
{{_R("packages", "oob")}}
diff --git a/files/app/main/u-status.ut b/files/app/main/u-status.ut new file mode 100755 index 00000000..4c4aa3ff --- /dev/null +++ b/files/app/main/u-status.ut @@ -0,0 +1,35 @@ +{% +/* + * Part of AREDN® -- Used for creating Amateur Radio Emergency Data Networks + * Copyright (C) 2024 Tim Wilkinson + * See Contributors file for additional contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * + * Additional Terms: + * + * Additional use restrictions exist on the AREDN® trademark and logo. + * See AREDNLicense.txt for more info. + * + * Attributions to the AREDN® Project must be retained in the source code. + * If importing this code into a new or existing project attribution + * to the AREDN® project must be added to the source code. + * + * You must not misrepresent the origin of the material contained within. + * + * Modified versions must be modified to attribute to the original source + * and be marked in reasonable ways as differentiate it from the original + * version + */ +%} +{{_R("status")}} diff --git a/files/app/main/tunnels.ut b/files/app/main/u-tunnels.ut similarity index 100% rename from files/app/main/tunnels.ut rename to files/app/main/u-tunnels.ut diff --git a/files/app/partial/changes.ut b/files/app/partial/changes.ut index 61fa9899..b2ef0a32 100755 --- a/files/app/partial/changes.ut +++ b/files/app/partial/changes.ut @@ -41,7 +41,7 @@ else if (request.args.commit) { pwchanged = configuration.isPasswordChanged(); configuration.commitChanges(); - print(`
${_R(request.page)}
`); + print(`
${_R(request.page)}
`); } } %} diff --git a/files/app/partial/general.ut b/files/app/partial/general.ut index a459be7c..c26668f6 100755 --- a/files/app/partial/general.ut +++ b/files/app/partial/general.ut @@ -47,7 +47,7 @@
{% } %}
-
+
{{_R("health")}}
{{_R("firmware")}} diff --git a/files/app/partial/mesh.ut b/files/app/partial/mesh.ut index 824f39ea..8730bc5b 100755 --- a/files/app/partial/mesh.ut +++ b/files/app/partial/mesh.ut @@ -49,8 +49,15 @@ For example, typing "cam" in the box will filter out everything except names containsing "cam" ... which are probably cameras.

-
+ {% if (!config.resourcehash) { %} {% } else { %} diff --git a/files/app/partial/status.ut b/files/app/partial/status.ut index f145e015..871da0b2 100755 --- a/files/app/partial/status.ut +++ b/files/app/partial/status.ut @@ -43,7 +43,7 @@
-
+
{% if (messages.haveMessages() || (auth.isAdmin && messages.haveToDos())) { %}
{{_R("messages")}} @@ -58,7 +58,7 @@

-
+
{{_R("local-and-neighbor-devices")}}
@@ -69,13 +69,13 @@

-
+
{{_R("mesh-summary")}}

-
+
{{_R("dhcp")}}
@@ -88,7 +88,7 @@ {% if (fs.access("/usr/bin/wg") || fs.access("/usr/sbin/vtund")) { %}

-
+
{{_R("tunnels")}}
diff --git a/files/app/resource/js/meshpage.js b/files/app/resource/js/meshpage.js index 80434e9d..809d3820 100755 --- a/files/app/resource/js/meshpage.js +++ b/files/app/resource/js/meshpage.js @@ -2,41 +2,55 @@ function render() { const search = document.querySelector("#meshfilter input"); -const page = document.getElementById("meshpage"); const help = document.getElementById("meshpage-help"); const etx = mesh.etx; const hosts = mesh.hosts; const services = mesh.services; +let page = document.getElementById("meshpage"); +if (!page) { + page = document.createElement("div"); + page.id = "meshpage"; + document.getElementById("main").appendChild(page); +} let filtering; let cfilter; function filter() { clearTimeout(filtering); - filtering = setTimeout(function() { - const filter = search.value.toLowerCase(); - if (filter === cfilter) { - return; - } - cfilter = filter; - const filtered = document.querySelectorAll(".valid"); - for (let i = 0; i < filtered.length; i++) { - filtered[i].classList.remove("valid"); - } - if (filter === "") { - page.classList.remove("filtering"); + filtering = setTimeout(doFilter, 200); +} +function doFilter() { + const filter = search.value.toLowerCase(); + if (filter === cfilter) { + return; + } + cfilter = filter; + if (history) { + if (search.value) { + history.replaceState(null, "", `${location.origin}${location.pathname}?q=${search.value}`); } else { - page.classList.add("filtering"); - const targets = document.querySelectorAll("[data-search]"); - for (let i = 0; i < targets.length; i++) { - const target = targets[i]; - if (target.dataset.search.indexOf(filter) !== -1) { - target.classList.add("valid"); - } + history.replaceState(null, "", `${location.origin}${location.pathname}`); + } + } + const filtered = document.querySelectorAll(".valid"); + for (let i = 0; i < filtered.length; i++) { + filtered[i].classList.remove("valid"); + } + if (filter === "") { + page.classList.remove("filtering"); + } + else { + page.classList.add("filtering"); + const targets = document.querySelectorAll("[data-search]"); + for (let i = 0; i < targets.length; i++) { + const target = targets[i]; + if (target.dataset.search.indexOf(filter) !== -1) { + target.classList.add("valid"); } } - }, 200); + } } search.addEventListener("keyup", filter); search.addEventListener("click", filter); @@ -110,11 +124,12 @@ for (let i = 0; i < etx.length; i++) { } page.innerHTML = data + "
"; +document.querySelector("input[type=search]").focus(); +doFilter(); + help.addEventListener("click", () => { document.querySelector(".meshpage-help").classList.toggle("visible"); }); -document.querySelector("input[type=search]").focus(); - } render();