This commit is contained in:
Mateusz Gruszczyński committed 2026-11-06 23:38:00 +01:00
1 parent f4606cce18
commit 51f22a72cc
11 files changed
+54 -33

No files matched your search

+13 -4
View File
@@ -9,18 +9,27 @@ window.rustProxyOverviewSamples = (() => {
} catch { /* Private browsing or storage policy: temporary selection still works. */ }
let limit = saved;
const callbacks = new Set();
let confirmationTimer = null;
const getLimit = () => limit;
const trim = array => {
if (Array.isArray(array) && array.length > limit) array.splice(0, array.length - limit);
return array;
};
function sync(messageKey = limit === saved ? "overviewSamplesSaved" : "overviewSamplesTemporary") {
// The status is shown only for a temporary choice, a storage problem or briefly after saving.
function sync(messageKey = limit === saved ? null : "overviewSamplesTemporary", confirmation = false) {
const select = document.getElementById("overview-live-samples");
if (select) select.value = String(limit);
const state = document.getElementById("overview-samples-state");
if (state) {
state.dataset.i18n = messageKey;
state.textContent = t(messageKey);
clearTimeout(confirmationTimer);
if (messageKey) {
state.dataset.i18n = messageKey;
state.textContent = t(messageKey);
state.style.visibility = "visible";
} else {
state.style.visibility = "hidden";
}
if (confirmation) confirmationTimer = setTimeout(() => { state.style.visibility = "hidden"; }, 2500);
}
const save = document.getElementById("overview-samples-save");
if (save) save.disabled = limit === saved;
@@ -43,7 +52,7 @@ window.rustProxyOverviewSamples = (() => {
const changed = count !== limit;
limit = count;
if (changed) for (const callback of callbacks) callback(limit);
sync();
if (persist) sync("overviewSamplesSaved", true); else sync();
return true;
}
function init() {
+10 -6
View File
@@ -5,10 +5,6 @@
"bandwidth",
"errors",
"memory",
"extra_backends_healthy",
"extra_error_share",
"extra_rejected_rate",
"extra_cert_expiry",
"websocket",
"backend_traffic",
"extra_response_latency",
@@ -82,7 +78,11 @@
"www_failures",
"www_traffic",
"www_top_services",
"www_status_trend"
"www_status_trend",
"extra_backends_healthy",
"extra_error_share",
"extra_rejected_rate",
"extra_cert_expiry"
],
"dashboard_hidden_widgets": [
"cache_outcomes",
@@ -136,7 +136,11 @@
"www_status_trend",
"extra_cold_queue_memory",
"wide_cache_activity",
"backend_rotations"
"backend_rotations",
"extra_backends_healthy",
"extra_error_share",
"extra_rejected_rate",
"extra_cert_expiry"
],
"dashboard_density": "compact",
"overview_samples": 600
+4 -4
View File
@@ -876,7 +876,7 @@
"data_source": "backend_status",
"no_data": "neutral_dash",
"category": "backends",
"default_hidden": false,
"default_hidden": true,
"display_type": "value_chart"
},
{
@@ -887,7 +887,7 @@
"data_source": "status_metrics",
"no_data": "neutral_dash",
"category": "performance",
"default_hidden": false,
"default_hidden": true,
"display_type": "value_chart"
},
{
@@ -898,7 +898,7 @@
"data_source": "status_metrics",
"no_data": "neutral_dash",
"category": "performance",
"default_hidden": false,
"default_hidden": true,
"display_type": "value_chart"
},
{
@@ -909,7 +909,7 @@
"data_source": "system_status",
"no_data": "neutral_dash",
"category": "overview",
"default_hidden": false,
"default_hidden": true,
"display_type": "value_chart"
}
]