v0.38.6
This commit is contained in:
1 parent
a977cf78a5
commit
1239ff524d
17 files changed
+245
-50
No files matched your search
@@ -50,25 +50,79 @@ window.rustProxyChartScale = (() => {
|
||||
}
|
||||
return `${format(n)}${unit === "percent" ? "%" : unit === "ms" ? " ms" : unit === "rate" ? "/s" : ""}`;
|
||||
}
|
||||
// Crosshair: with axes enabled, dashed guide lines follow the pointer and
|
||||
// label the Y value and X sample under it. Values come from the same
|
||||
// axis data the overlay uses, so they match the drawn scale.
|
||||
// Crosshair (Grafana-style): with value tooltips enabled, a dashed vertical line
|
||||
// snaps to the nearest sample, each series gets a dot, and a tooltip lists
|
||||
// every series' value at that sample; a dashed horizontal line marks the
|
||||
// Y value under the pointer. Values are read back from the drawn lines
|
||||
// with the chart's own axis scale, so they match what is plotted.
|
||||
function lineSeries(svg) {
|
||||
const box = svg.viewBox?.baseVal, height = box?.height || svg.clientHeight || 1;
|
||||
return [...svg.querySelectorAll("polyline, path")].filter(node => !node.classList.contains("chart-grid") && !node.closest(".rp-chart-crosshair")).map(node => {
|
||||
const style = getComputedStyle(node);
|
||||
if (style.display === "none" || style.visibility === "hidden" || style.stroke === "none" || Number(style.strokeOpacity) === 0) return null;
|
||||
const numbers = (node.getAttribute(node.tagName.toLowerCase() === "polyline" ? "points" : "d") || "").match(/-?\d*\.?\d+(?:e[-+]?\d+)?/gi) || [];
|
||||
const points = []; for (let i = 0; i + 1 < numbers.length; i += 2) points.push([Number(numbers[i]), Number(numbers[i + 1])]);
|
||||
return points.length ? { node, points, color: style.stroke, height } : null;
|
||||
}).filter(Boolean);
|
||||
}
|
||||
function legendItems(svg) {
|
||||
const card = svg.closest(".card, .stat, .mini-live-chart, .vhost-chart, .docker-service-metrics, article") || svg.parentElement?.parentElement;
|
||||
if (!card) return [];
|
||||
const swatch = item => {
|
||||
const key = item.querySelector(":scope > i");
|
||||
for (const [node, pseudo] of [[key, null], [item, "::before"], [key, "::before"]]) {
|
||||
if (!node) continue;
|
||||
const style = getComputedStyle(node, pseudo), visible = value => value && value !== "rgba(0, 0, 0, 0)" && value !== "transparent";
|
||||
if (visible(style.backgroundColor)) return style.backgroundColor;
|
||||
for (const side of ["Top", "Left", "Bottom"]) if (parseFloat(style[`border${side}Width`]) > 0 && visible(style[`border${side}Color`])) return style[`border${side}Color`];
|
||||
}
|
||||
return "";
|
||||
};
|
||||
return [...card.querySelectorAll("[class*=legend] > span, [class*=legend] > *[class*=key], [class*=-key]")].filter(item => !item.closest("svg, .rp-chart-axis-host") && (item.querySelector(":scope > i") || /(^|\s)\S*(key|legend-)\S*/.test(item.className))).map(item => {
|
||||
const label = [...item.childNodes].filter(node => node.nodeType === 3 || (node.nodeType === 1 && !["B", "STRONG", "I"].includes(node.tagName))).map(node => node.textContent).join(" ").replace(/\s+/g, " ").trim();
|
||||
return label ? { label, color: swatch(item) } : null;
|
||||
}).filter(Boolean);
|
||||
}
|
||||
function seriesName(svg, series, index, legend, scales, total) {
|
||||
if (total < 2) return "";
|
||||
if (scales?.[index]) return scales[index][0];
|
||||
const byColor = legend.filter(item => item.color === series.color);
|
||||
if (byColor.length === 1) return byColor[0].label;
|
||||
if (legend.length === total) return legend[index].label;
|
||||
const token = `${series.node.id || ""} ${series.node.getAttribute("class") || ""}`.match(/(?:-|^)(h1|h2|h3|total|transform|hit|miss|bypass|open|exchange|rx|tx|[a-z0-9_]+?)-(?:line|sparkline)\b/i)?.[1];
|
||||
return token ? token.replace(/_/g, " ").toUpperCase() : "";
|
||||
}
|
||||
function crosshairValues(svg, event) {
|
||||
const data = svg.rustProxyAxisData, box = svg.getBoundingClientRect();
|
||||
if (!data || !box.width || !box.height) return null;
|
||||
const fx = Math.min(1, Math.max(0, (event.clientX - box.left) / box.width));
|
||||
const fy = Math.min(1, Math.max(0, (event.clientY - box.top) / box.height));
|
||||
const span = data.bottom - data.top || 1, ratio = Math.max(0, (data.bottom - fy) / span);
|
||||
const sample = data.count > 1 ? Math.round(fx * (data.count - 1)) + 1 : data.count;
|
||||
const span = data.bottom - data.top || 1, ratio = y => Math.max(0, (data.bottom - y) / span);
|
||||
const scales = Array.isArray(data.seriesScales) && data.seriesScales.length ? data.seriesScales : null;
|
||||
const y = scales ? scales.map(([name, peak]) => `${name}: ${axisValue(peak * ratio, data.unit)}`).join(" · ") : `Y ${axisValue(data.peak * ratio, data.unit)}`;
|
||||
return { box, fx, fy, y, x: data.count ? `X ${sample}/${data.count}` : "X –" };
|
||||
const series = lineSeries(svg), width = svg.viewBox?.baseVal?.width || box.width;
|
||||
let snap = fx, sample = data.count > 1 ? Math.round(fx * (data.count - 1)) + 1 : data.count;
|
||||
const rows = [];
|
||||
if (series.length) {
|
||||
const xs = series[0].points.map(([x]) => x), target = fx * width;
|
||||
let index = 0; for (let i = 1; i < xs.length; i++) if (Math.abs(xs[i] - target) < Math.abs(xs[index] - target)) index = i;
|
||||
snap = xs[index] / width;
|
||||
sample = data.count ? Math.min(data.count, Math.max(1, data.count - (xs.length - 1 - index))) : index + 1;
|
||||
const legend = legendItems(svg);
|
||||
series.forEach((line, i) => {
|
||||
const point = line.points.reduce((best, current) => Math.abs(current[0] - xs[index]) < Math.abs(best[0] - xs[index]) ? current : best, line.points[0]);
|
||||
const peak = scales?.[i]?.[1] ?? data.peak, fraction = point[1] / line.height;
|
||||
rows.push({ name: seriesName(svg, line, i, legend, scales, series.length), color: line.color, value: axisValue(peak * ratio(fraction), data.unit), fy: fraction });
|
||||
});
|
||||
}
|
||||
const y = scales ? "" : `Y ${axisValue(data.peak * ratio(fy), data.unit)}`;
|
||||
return { box, fx, fy, snap, y, sample, count: data.count, rows };
|
||||
}
|
||||
let activeCrosshair = null;
|
||||
function attachCrosshair(host, svg) {
|
||||
const cross = document.createElement("div"); cross.className = "rp-chart-crosshair"; cross.hidden = true; cross.setAttribute("aria-hidden", "true");
|
||||
const vertical = document.createElement("i"), horizontal = document.createElement("i"), yLabel = document.createElement("span"), xLabel = document.createElement("span");
|
||||
vertical.className = "rp-chart-crosshair-v"; horizontal.className = "rp-chart-crosshair-h"; yLabel.className = "rp-chart-crosshair-y"; xLabel.className = "rp-chart-crosshair-x";
|
||||
cross.append(vertical, horizontal, yLabel, xLabel); host.append(cross);
|
||||
const vertical = document.createElement("i"), horizontal = document.createElement("i"), yLabel = document.createElement("span"), dots = document.createElement("div"), tip = document.createElement("div");
|
||||
vertical.className = "rp-chart-crosshair-v"; horizontal.className = "rp-chart-crosshair-h"; yLabel.className = "rp-chart-crosshair-y"; dots.className = "rp-chart-crosshair-dots"; tip.className = "rp-chart-tooltip";
|
||||
cross.append(vertical, horizontal, yLabel, dots, tip); host.append(cross);
|
||||
let frame = 0, last = null;
|
||||
const draw = () => {
|
||||
frame = 0; if (!last || !host.isConnected) return;
|
||||
@@ -77,14 +131,24 @@ window.rustProxyChartScale = (() => {
|
||||
// overlay is positioned in the host's own (unscaled) pixels.
|
||||
const hostBox = host.getBoundingClientRect(), scale = host.offsetWidth ? hostBox.width / host.offsetWidth : 1;
|
||||
const left = (values.box.left - hostBox.left) / scale, top = (values.box.top - hostBox.top) / scale, width = values.box.width / scale, height = values.box.height / scale;
|
||||
const x = left + values.fx * width, y = top + values.fy * height;
|
||||
const x = left + values.snap * width, y = top + values.fy * height, pointerX = left + values.fx * width;
|
||||
cross.style.setProperty("--rp-cross-left", `${left}px`); cross.style.setProperty("--rp-cross-top", `${top}px`);
|
||||
cross.style.setProperty("--rp-cross-width", `${width}px`); cross.style.setProperty("--rp-cross-height", `${height}px`);
|
||||
cross.style.setProperty("--rp-cross-x", `${x}px`); cross.style.setProperty("--rp-cross-y", `${y}px`);
|
||||
cross.classList.toggle("is-right", values.fx > .6); cross.classList.toggle("is-low", values.fy > .7);
|
||||
yLabel.textContent = values.y; xLabel.textContent = values.x; cross.hidden = false;
|
||||
yLabel.textContent = values.y; yLabel.hidden = !values.y;
|
||||
dots.replaceChildren(...values.rows.map(row => { const dot = document.createElement("i"); dot.style.left = `${x}px`; dot.style.top = `${top + row.fy * height}px`; dot.style.background = row.color; return dot; }));
|
||||
const head = document.createElement("b"); head.textContent = values.count ? `${t("chartAxisSample")} ${values.sample}/${values.count}` : "–";
|
||||
tip.replaceChildren(head, ...values.rows.map(row => {
|
||||
const line = document.createElement("span"), key = document.createElement("i"), name = document.createElement("span"), value = document.createElement("strong");
|
||||
key.style.background = row.color; name.textContent = row.name; value.textContent = row.value; line.append(key, name, value); return line;
|
||||
}));
|
||||
tip.hidden = !values.rows.length; cross.hidden = false;
|
||||
if (activeCrosshair && activeCrosshair !== cross) activeCrosshair.hidden = true; activeCrosshair = cross;
|
||||
const hostWidth = host.offsetWidth, tipWidth = tip.offsetWidth || 160, tipHeight = tip.offsetHeight || 40;
|
||||
const tipLeft = pointerX + 14 + tipWidth > hostWidth ? Math.max(0, pointerX - 14 - tipWidth) : pointerX + 14;
|
||||
tip.style.left = `${tipLeft}px`; tip.style.top = `${Math.max(0, Math.min(top + height - tipHeight, y - tipHeight / 2))}px`;
|
||||
};
|
||||
const move = event => { if (event.target.closest?.(".rp-chart-axis-x, .rp-chart-axis-series")) { cross.hidden = true; return; } last = event; if (!frame) frame = requestAnimationFrame(draw); };
|
||||
const move = event => { if (!tooltipsOn() || event.target.closest?.(".rp-chart-axis-x, .rp-chart-axis-series")) { cross.hidden = true; return; } last = event; if (!frame) frame = requestAnimationFrame(draw); };
|
||||
const leave = () => { last = null; cross.hidden = true; };
|
||||
host.addEventListener("pointermove", move); host.addEventListener("pointerdown", move);
|
||||
host.addEventListener("pointerleave", leave); host.addEventListener("pointercancel", leave);
|
||||
@@ -92,6 +156,11 @@ window.rustProxyChartScale = (() => {
|
||||
function setAxisText(node, value) {
|
||||
if (node.textContent !== value) node.textContent = value;
|
||||
}
|
||||
// The overlay host is needed for X/Y scales and for value tooltips; each
|
||||
// is a separate appearance preference, both off by default.
|
||||
const axesOn = () => document.documentElement.dataset.chartAxes === "true";
|
||||
const tooltipsOn = () => document.documentElement.dataset.chartTooltips === "true";
|
||||
const axesWanted = () => axesOn() || tooltipsOn();
|
||||
function renderAxes(svg) {
|
||||
if (!svg?.isConnected || !svg.rustProxyAxisData) return;
|
||||
let host = svg.parentElement;
|
||||
@@ -123,6 +192,7 @@ window.rustProxyChartScale = (() => {
|
||||
attachCrosshair(host, svg);
|
||||
}
|
||||
const { peak: maximum, unit, count, top, bottom, clipped, seriesScales } = svg.rustProxyAxisData;
|
||||
host.classList.toggle("rp-chart-axis-off", !axesOn());
|
||||
const compact = svg.closest(".stat-chart") !== null;
|
||||
host.classList.toggle("rp-chart-axis-compact", compact);
|
||||
const multi = Array.isArray(seriesScales) && seriesScales.length > 0;
|
||||
@@ -163,10 +233,10 @@ window.rustProxyChartScale = (() => {
|
||||
seriesScales: Array.isArray(seriesScales) ? seriesScales.filter(row =>
|
||||
Array.isArray(row) && typeof row[0] === "string" && Number.isFinite(row[1]) && row[1] >= 0) : null,
|
||||
};
|
||||
if (document.documentElement.dataset.chartAxes === "true") renderAxes(svg);
|
||||
if (axesWanted()) renderAxes(svg);
|
||||
}
|
||||
function refreshAxes() {
|
||||
const show = document.documentElement.dataset.chartAxes === "true";
|
||||
const show = axesWanted();
|
||||
for (const svg of document.querySelectorAll("svg:not(.ui-icon)")) {
|
||||
if (show && svg.rustProxyAxisData) renderAxes(svg);
|
||||
else if (!show && svg.parentElement?.classList.contains("rp-chart-axis-host")) {
|
||||
|
||||
@@ -13,7 +13,7 @@ const ADMIN_DEFAULT_HIDDEN_WIDGETS = Object.freeze([...new Set([
|
||||
])]);
|
||||
const ADMIN_APPEARANCE_DEFAULTS = Object.freeze({
|
||||
theme: "dark", language: "auto", ui_scale: 100, time_format: "24h", chart_style: "default",
|
||||
chart_axes: false, interface_icons: false, logo_animation: false, stable_dialog_position: true, switch_controls: true,
|
||||
chart_axes: false, chart_tooltips: false, interface_icons: false, logo_animation: false, stable_dialog_position: true, switch_controls: true,
|
||||
button_style: "normal", corner_style: "default", table_density: "normal", dashboard_density: ADMIN_DASHBOARD_DEFAULTS.dashboard_density, dashboard_widgets: [...ADMIN_DASHBOARD_WIDGETS], dashboard_hidden_widgets: [...ADMIN_DEFAULT_HIDDEN_WIDGETS], dashboard_widget_sizes: null, dashboard_widget_heights: null, dashboard_widget_positions: null, dashboard_auto_fit: true, sidebar_collapsed: false,
|
||||
});
|
||||
const CHART_STYLE_KEYS = Object.freeze({ default: "chartStyleDefault", soft: "chartStyleSoft", technical: "chartStyleTechnical", high_contrast: "chartStyleHighContrast", neon: "chartStyleNeon", monochrome: "chartStyleMonochrome", warm: "chartStyleWarm", cool: "chartStyleCool", sunset: "chartStyleSunset", aurora: "chartStyleAurora", ocean: "chartStyleOcean", forest: "chartStyleForest", pastel: "chartStylePastel", terminal: "chartStyleTerminal", blueprint: "chartStyleBlueprint", colorblind: "chartStyleColorblind" });
|
||||
@@ -137,6 +137,13 @@ function applyAdminChartStyle(value) {
|
||||
const style = normalizeAdminChartStyle(value); document.documentElement.dataset.chartStyle = style;
|
||||
const select = $("ui-chart-style"); if (select) select.value = style; refreshChartStylePalette(style); return style;
|
||||
}
|
||||
function applyAdminChartTooltips(value) {
|
||||
const enabled = value === true;
|
||||
document.documentElement.dataset.chartTooltips = String(enabled);
|
||||
const input = $("ui-chart-tooltips"); if (input) input.checked = enabled;
|
||||
window.rustProxyChartScale?.refreshAxes?.();
|
||||
return enabled;
|
||||
}
|
||||
function applyAdminChartAxes(value) {
|
||||
const enabled = value === true;
|
||||
document.documentElement.dataset.chartAxes = String(enabled);
|
||||
@@ -337,7 +344,7 @@ function applyAdminPreferences(value, cache = true) {
|
||||
...value,
|
||||
refresh: normalizeRefreshPreferences(value.refresh),
|
||||
theme: applyAdminTheme(value.theme, cache), language: applyAdminLanguage(value.language, cache, false), ui_scale: applyAdminUiScale(value.ui_scale, cache),
|
||||
time_format: applyAdminTimeFormat(value.time_format), chart_style: applyAdminChartStyle(value.chart_style), chart_axes: applyAdminChartAxes(value.chart_axes), interface_icons: applyAdminInterfaceIcons(value.interface_icons), logo_animation: applyAdminLogoAnimation(value.logo_animation), stable_dialog_position: applyAdminStableDialogPosition(value.stable_dialog_position), switch_controls: applyAdminSwitchControls(value.switch_controls), button_style: applyAdminButtonStyle(value.button_style), corner_style: applyAdminCornerStyle(value.corner_style, cache), table_density: applyAdminTableDensity(value.table_density),
|
||||
time_format: applyAdminTimeFormat(value.time_format), chart_style: applyAdminChartStyle(value.chart_style), chart_axes: applyAdminChartAxes(value.chart_axes), chart_tooltips: applyAdminChartTooltips(value.chart_tooltips), interface_icons: applyAdminInterfaceIcons(value.interface_icons), logo_animation: applyAdminLogoAnimation(value.logo_animation), stable_dialog_position: applyAdminStableDialogPosition(value.stable_dialog_position), switch_controls: applyAdminSwitchControls(value.switch_controls), button_style: applyAdminButtonStyle(value.button_style), corner_style: applyAdminCornerStyle(value.corner_style, cache), table_density: applyAdminTableDensity(value.table_density),
|
||||
dashboard_density: applyAdminDashboardDensity(value.dashboard_density), dashboard_widgets: savedOrder, dashboard_hidden_widgets: savedHidden, dashboard_widget_sizes: savedSizes, dashboard_widget_heights: savedHeights, dashboard_widget_positions: savedPositions, dashboard_auto_fit: savedAutoFit,
|
||||
};
|
||||
adminPreferences = normalized;
|
||||
@@ -389,7 +396,7 @@ function updateAdminPreferences(patch) {
|
||||
const next = { ...current, ...patch };
|
||||
next.refresh = normalizeRefreshPreferences(next.refresh);
|
||||
next.theme = normalizeAdminTheme(next.theme); next.language = normalizeAdminLanguage(next.language); next.ui_scale = normalizeAdminUiScale(next.ui_scale);
|
||||
next.time_format = normalizeAdminTimeFormat(next.time_format); next.chart_style = normalizeAdminChartStyle(next.chart_style); next.chart_axes = next.chart_axes === true; next.interface_icons = next.interface_icons === true; next.logo_animation = next.logo_animation === true; next.stable_dialog_position = next.stable_dialog_position !== false; next.switch_controls = next.switch_controls !== false; next.button_style = normalizeAdminButtonStyle(next.button_style); next.corner_style = normalizeAdminCornerStyle(next.corner_style); next.table_density = normalizeAdminDensity(next.table_density);
|
||||
next.time_format = normalizeAdminTimeFormat(next.time_format); next.chart_style = normalizeAdminChartStyle(next.chart_style); next.chart_axes = next.chart_axes === true; next.chart_tooltips = next.chart_tooltips === true; next.interface_icons = next.interface_icons === true; next.logo_animation = next.logo_animation === true; next.stable_dialog_position = next.stable_dialog_position !== false; next.switch_controls = next.switch_controls !== false; next.button_style = normalizeAdminButtonStyle(next.button_style); next.corner_style = normalizeAdminCornerStyle(next.corner_style); next.table_density = normalizeAdminDensity(next.table_density);
|
||||
next.dashboard_density = normalizeAdminDensity(next.dashboard_density, "compact"); next.dashboard_widgets = normalizeDashboardWidgets(next.dashboard_widgets); next.dashboard_hidden_widgets = normalizeHiddenDashboardWidgets(next.dashboard_hidden_widgets); next.dashboard_widget_sizes = normalizeDashboardWidgetSizes(next.dashboard_widget_sizes); next.dashboard_widget_heights = normalizeDashboardWidgetHeights(next.dashboard_widget_heights); next.dashboard_widget_positions = normalizeDashboardWidgetPositions(next.dashboard_widget_positions); next.dashboard_auto_fit = next.dashboard_auto_fit !== false; next.sidebar_collapsed = next.sidebar_collapsed === true;
|
||||
const saved = await api("/api/preferences", { method: "PUT", body: JSON.stringify(next) });
|
||||
if (!authenticated || epoch !== authEpoch) return adminPreferences;
|
||||
@@ -473,6 +480,14 @@ $("ui-chart-axes")?.addEventListener("change", () => {
|
||||
applyAdminChartAxes(previous);
|
||||
});
|
||||
});
|
||||
$("ui-chart-tooltips")?.addEventListener("change", () => {
|
||||
const control = $("ui-chart-tooltips"), previous = adminPreferences?.chart_tooltips === true, next = control.checked;
|
||||
applyAdminChartTooltips(next); if (adminPreferences) adminPreferences.chart_tooltips = next;
|
||||
void saveAppearancePreference({ chart_tooltips: next }, control, () => {
|
||||
if (adminPreferences) adminPreferences.chart_tooltips = previous;
|
||||
applyAdminChartTooltips(previous);
|
||||
});
|
||||
});
|
||||
$("ui-interface-icons")?.addEventListener("change", () => {
|
||||
const control = $("ui-interface-icons"), previous = adminPreferences?.interface_icons === true, next = control.checked;
|
||||
applyAdminInterfaceIcons(next); if (adminPreferences) adminPreferences.interface_icons = next;
|
||||
@@ -536,7 +551,7 @@ async function resetAppearancePatch(patch, control, messageKey = "appearanceSect
|
||||
}
|
||||
document.querySelectorAll("[data-appearance-reset]").forEach(control => control.addEventListener("click", () => {
|
||||
const patches = {
|
||||
interface: { theme: "dark", language: "auto", ui_scale: 100, time_format: "24h", interface_icons: false, logo_animation: false, stable_dialog_position: true, switch_controls: true, button_style: "normal", corner_style: "default" }, charts: { chart_style: "default", chart_axes: false }, tables: { table_density: "normal" },
|
||||
interface: { theme: "dark", language: "auto", ui_scale: 100, time_format: "24h", interface_icons: false, logo_animation: false, stable_dialog_position: true, switch_controls: true, button_style: "normal", corner_style: "default" }, charts: { chart_style: "default", chart_axes: false, chart_tooltips: false }, tables: { table_density: "normal" },
|
||||
dashboard: { dashboard_density: ADMIN_DASHBOARD_DEFAULTS.dashboard_density, dashboard_widgets: [...ADMIN_DASHBOARD_WIDGETS], dashboard_hidden_widgets: [...ADMIN_APPEARANCE_DEFAULTS.dashboard_hidden_widgets], dashboard_widget_sizes: null, dashboard_widget_heights: null, dashboard_auto_fit: true },
|
||||
};
|
||||
void resetAppearancePatch(patches[control.dataset.appearanceReset] || {}, control);
|
||||
|
||||
@@ -456,7 +456,7 @@ function renderNetworkInterfaceCharts(interfaces, appendSample) {
|
||||
if (children.length !== target.children.length || children.some((node, index) => node !== target.children[index])) {
|
||||
target.replaceChildren(...children);
|
||||
|
||||
if (document.documentElement.dataset.chartAxes === "true") window.rustProxyChartScale.refreshAxes();
|
||||
if (document.documentElement.dataset.chartAxes === "true" || document.documentElement.dataset.chartTooltips === "true") window.rustProxyChartScale.refreshAxes();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,6 +169,11 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
gap: 2px;
|
||||
}
|
||||
|
||||
/* Value tooltips without X/Y scales: keep the host for the crosshair only. */
|
||||
.rp-chart-axis-off :is(.rp-chart-axis-y, .rp-chart-axis-x, .rp-chart-axis-series, .rp-chart-crosshair-h, .rp-chart-crosshair-y) {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rp-chart-crosshair {
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
@@ -203,9 +208,11 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
border-top-width: 1px;
|
||||
}
|
||||
|
||||
.rp-chart-crosshair-y,
|
||||
.rp-chart-crosshair-x {
|
||||
.rp-chart-crosshair-y {
|
||||
position: absolute;
|
||||
top: var(--rp-cross-y);
|
||||
left: calc(var(--rp-cross-left) + 3px);
|
||||
transform: translateY(-120%);
|
||||
padding: 1px 4px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: min(3px, var(--rp-radius-control, 3px));
|
||||
@@ -214,24 +221,62 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.rp-chart-crosshair-y {
|
||||
top: var(--rp-cross-y);
|
||||
left: calc(var(--rp-cross-left) + 3px);
|
||||
transform: translateY(-120%);
|
||||
.rp-chart-crosshair-y[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rp-chart-crosshair.is-low .rp-chart-crosshair-y {
|
||||
transform: translateY(20%);
|
||||
.rp-chart-crosshair-dots>i {
|
||||
position: absolute;
|
||||
width: 7px;
|
||||
height: 7px;
|
||||
margin: -3.5px 0 0 -3.5px;
|
||||
border: 1px solid var(--panel);
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.rp-chart-crosshair-x {
|
||||
top: calc(var(--rp-cross-top) + var(--rp-cross-height) - 2px);
|
||||
left: var(--rp-cross-x);
|
||||
transform: translate(6px, -100%);
|
||||
.rp-chart-tooltip {
|
||||
position: absolute;
|
||||
display: grid;
|
||||
gap: 2px;
|
||||
min-width: 120px;
|
||||
max-width: min(280px, 90%);
|
||||
padding: 5px 7px;
|
||||
border: 1px solid var(--line);
|
||||
border-radius: min(6px, var(--rp-radius-surface, 6px));
|
||||
background: color-mix(in srgb, var(--panel) 94%, transparent);
|
||||
box-shadow: 0 4px 14px var(--shadow-mid);
|
||||
color: var(--text);
|
||||
font: 10px/1.35 var(--mono);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.rp-chart-crosshair.is-right .rp-chart-crosshair-x {
|
||||
transform: translate(calc(-100% - 6px), -100%);
|
||||
.rp-chart-tooltip[hidden] {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.rp-chart-tooltip>b {
|
||||
color: var(--muted);
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.rp-chart-tooltip>span {
|
||||
display: grid;
|
||||
grid-template-columns: 8px minmax(0, 1fr) auto;
|
||||
align-items: center;
|
||||
gap: 6px;
|
||||
}
|
||||
|
||||
.rp-chart-tooltip>span>i {
|
||||
width: 8px;
|
||||
height: 3px;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
.rp-chart-tooltip>span>span {
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
color: var(--muted);
|
||||
}
|
||||
|
||||
.rp-chart-axis-series {
|
||||
@@ -582,23 +627,23 @@ html[data-theme=cream] :is(.card, .stat, dialog) {
|
||||
width: 12px;
|
||||
height: 2px;
|
||||
display: inline-block;
|
||||
background: var(--muted);
|
||||
background: var(--chart-septenary);
|
||||
}
|
||||
|
||||
.traffic-protocol-legend .legend-h1 i {
|
||||
background: var(--accent);
|
||||
background: var(--chart-accent);
|
||||
}
|
||||
|
||||
.traffic-protocol-legend .legend-h2 i {
|
||||
background: var(--green);
|
||||
background: var(--chart-secondary);
|
||||
}
|
||||
|
||||
.traffic-protocol-legend .legend-h3 i {
|
||||
background: var(--blue);
|
||||
background: var(--chart-tertiary);
|
||||
}
|
||||
|
||||
.traffic-protocol-legend .legend-transform i {
|
||||
background: var(--transform-chart);
|
||||
background: var(--chart-quaternary);
|
||||
}
|
||||
|
||||
.traffic-protocol-legend b {
|
||||
@@ -1027,11 +1072,11 @@ html[data-dashboard-density=ultra] #panel-overview .stat-cache-outcomes .cache-m
|
||||
}
|
||||
|
||||
.connection-open-key {
|
||||
color: var(--accent) !important;
|
||||
color: var(--chart-accent) !important;
|
||||
}
|
||||
|
||||
.connection-exchange-key {
|
||||
color: var(--green) !important;
|
||||
color: var(--chart-secondary) !important;
|
||||
}
|
||||
|
||||
.dashboard-widget-setting-label {
|
||||
|
||||
@@ -83,7 +83,8 @@
|
||||
.appearance-logo-animation-setting,
|
||||
.appearance-stable-dialog-position-setting,
|
||||
.appearance-switch-controls-setting,
|
||||
.appearance-chart-axes-setting {
|
||||
.appearance-chart-axes-setting,
|
||||
.appearance-chart-tooltips-setting {
|
||||
align-self: center;
|
||||
min-width: 0;
|
||||
}
|
||||
@@ -92,17 +93,20 @@
|
||||
.appearance-logo-animation-setting>span,
|
||||
.appearance-stable-dialog-position-setting>span,
|
||||
.appearance-switch-controls-setting>span,
|
||||
.appearance-chart-axes-setting>span {
|
||||
.appearance-chart-axes-setting>span,
|
||||
.appearance-chart-tooltips-setting>span {
|
||||
display: grid;
|
||||
gap: 4px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.appearance-chart-axes-setting>span b {
|
||||
.appearance-chart-axes-setting>span b,
|
||||
.appearance-chart-tooltips-setting>span b {
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.appearance-chart-axes-setting>span small {
|
||||
.appearance-chart-axes-setting>span small,
|
||||
.appearance-chart-tooltips-setting>span small {
|
||||
color: var(--muted);
|
||||
font-size: 10px;
|
||||
line-height: 1.45;
|
||||
|
||||
@@ -487,11 +487,26 @@ html[data-dashboard-density] #panel-overview .dashboard-overview-grid>.card.pool
|
||||
}
|
||||
|
||||
.cache-queue-key {
|
||||
color: var(--blue);
|
||||
color: var(--chart-tertiary);
|
||||
}
|
||||
|
||||
.cache-io-key {
|
||||
color: var(--transform-chart);
|
||||
color: var(--chart-quaternary);
|
||||
}
|
||||
|
||||
/* Legend keys use the same chart palette variables as their lines, so they
|
||||
still match when a chart style (for example colour-blind) is selected. */
|
||||
.cache-hit-key,
|
||||
.cache-fill-key {
|
||||
color: var(--chart-secondary);
|
||||
}
|
||||
|
||||
.cache-miss-key {
|
||||
color: var(--chart-accent);
|
||||
}
|
||||
|
||||
.cache-bypass-key {
|
||||
color: var(--chart-tertiary);
|
||||
}
|
||||
|
||||
.config-history-dialog {
|
||||
|
||||
@@ -2206,6 +2206,11 @@
|
||||
charts</b><small data-i18n="chartAxesHelp">Keep automatic scaling;
|
||||
show Y values and sample indices on X (not elapsed
|
||||
time).</small></span></label>
|
||||
<label class="check appearance-chart-tooltips-setting"><input class="switch" id="ui-chart-tooltips"
|
||||
type="checkbox" /><span><b data-i18n="chartTooltips">Show values on
|
||||
hover</b><small data-i18n="chartTooltipsHelp">Pointing at a chart
|
||||
shows a guide line at the nearest sample and every series'
|
||||
value there.</small></span></label>
|
||||
<div class="appearance-chart-preview" aria-hidden="true">
|
||||
<svg viewBox="0 0 300 74" preserveAspectRatio="none">
|
||||
<path class="chart-grid" d="M0 18H300 M0 37H300 M0 56H300"></path>
|
||||
|
||||
Reference in new issue
Block a user