Preserve col-span-2 on stats line when className is updated
All updateHostRow() and greyOutUI() className assignments were dropping col-span-2, causing the stats line to only span column 1 instead of both grid columns.
This commit is contained in:
11
src/main.js
11
src/main.js
@@ -720,19 +720,20 @@ function updateHostRow(host, index) {
|
||||
`<span class="text-gray-400">avg </span><span class="${latencyClass(avg, "online")}">${avg}ms</span>` +
|
||||
` <span class="text-gray-500">/</span> ` +
|
||||
`<span class="text-gray-400">max </span><span class="${latencyClass(max, "online")}">${max}ms</span>`;
|
||||
statusEl.className = "status-text text-xs whitespace-nowrap text-right";
|
||||
statusEl.className =
|
||||
"status-text text-xs whitespace-nowrap text-right col-span-2";
|
||||
} else if (host.status === "offline") {
|
||||
statusEl.textContent = "unreachable";
|
||||
statusEl.className =
|
||||
"status-text text-xs text-red-400 whitespace-nowrap text-right";
|
||||
"status-text text-xs text-red-400 whitespace-nowrap text-right col-span-2";
|
||||
} else if (host.status === "error") {
|
||||
statusEl.textContent = "timeout";
|
||||
statusEl.className =
|
||||
"status-text text-xs text-orange-400 whitespace-nowrap text-right";
|
||||
"status-text text-xs text-orange-400 whitespace-nowrap text-right col-span-2";
|
||||
} else {
|
||||
statusEl.textContent = "connecting...";
|
||||
statusEl.className =
|
||||
"status-text text-xs text-gray-500 whitespace-nowrap text-right text-right";
|
||||
"status-text text-xs text-gray-500 whitespace-nowrap text-right col-span-2";
|
||||
}
|
||||
|
||||
SparklineRenderer.draw(canvas, host.history);
|
||||
@@ -1044,7 +1045,7 @@ function greyOutUI(state) {
|
||||
if (statusEl) {
|
||||
statusEl.textContent = "paused";
|
||||
statusEl.className =
|
||||
"status-text text-xs text-gray-500 whitespace-nowrap text-right";
|
||||
"status-text text-xs text-gray-500 whitespace-nowrap text-right col-span-2";
|
||||
}
|
||||
// Grey out the status dot
|
||||
const row = document.querySelector(`.host-row[data-index="${i}"]`);
|
||||
|
||||
Reference in New Issue
Block a user