1.3.3 + add easy way to tell the version
This commit is contained in:
@@ -17,7 +17,7 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
var AgentVersion = "1.3.2"
|
var AgentVersion = "1.3.3"
|
||||||
|
|
||||||
var DefaultPersistence = "false"
|
var DefaultPersistence = "false"
|
||||||
var DefaultServerURL = "wss://127.0.0.1:5173"
|
var DefaultServerURL = "wss://127.0.0.1:5173"
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "overlord-server",
|
"name": "overlord-server",
|
||||||
"version": "1.3.2",
|
"version": "1.3.3",
|
||||||
"private": true,
|
"private": true,
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -540,6 +540,13 @@ function formatFileSize(bytes) {
|
|||||||
return Math.round((bytes / Math.pow(k, i)) * 100) / 100 + " " + sizes[i];
|
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) {
|
function saveBuildToStorage(buildId, buildData) {
|
||||||
try {
|
try {
|
||||||
const builds = JSON.parse(localStorage.getItem("overlord_builds") || "[]");
|
const builds = JSON.parse(localStorage.getItem("overlord_builds") || "[]");
|
||||||
@@ -736,7 +743,15 @@ function showBuildFilesForContainer(build, containerId, timerId) {
|
|||||||
fileName.textContent = file.filename;
|
fileName.textContent = file.filename;
|
||||||
const filePlatform = document.createElement("div");
|
const filePlatform = document.createElement("div");
|
||||||
filePlatform.className = "text-sm text-gray-400";
|
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(fileName);
|
||||||
fileText.appendChild(filePlatform);
|
fileText.appendChild(filePlatform);
|
||||||
fileMeta.appendChild(fileIcon);
|
fileMeta.appendChild(fileIcon);
|
||||||
|
|||||||
@@ -1580,6 +1580,14 @@ mark.search-current {
|
|||||||
box-shadow: 0 8px 20px rgba(30, 64, 175, 0.25);
|
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-status,
|
||||||
#filter-os,
|
#filter-os,
|
||||||
#sort {
|
#sort {
|
||||||
|
|||||||
@@ -36,12 +36,41 @@ const bulkScreenshotBtn = document.getElementById("bulk-screenshot");
|
|||||||
const bulkDisconnectBtn = document.getElementById("bulk-disconnect");
|
const bulkDisconnectBtn = document.getElementById("bulk-disconnect");
|
||||||
const bulkUninstallBtn = document.getElementById("bulk-uninstall");
|
const bulkUninstallBtn = document.getElementById("bulk-uninstall");
|
||||||
const bulkClearBtn = document.getElementById("bulk-clear");
|
const bulkClearBtn = document.getElementById("bulk-clear");
|
||||||
|
const serverVersionText = document.getElementById("server-version-text");
|
||||||
const selectedClients = new Set();
|
const selectedClients = new Set();
|
||||||
let lastNonOnlineStatus = "all";
|
let lastNonOnlineStatus = "all";
|
||||||
|
|
||||||
let currentUser = null;
|
let currentUser = null;
|
||||||
let contextCard = null;
|
let contextCard = null;
|
||||||
let availableOsList = new Set();
|
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) => {
|
const setContext = (id) => {
|
||||||
contextCard = id;
|
contextCard = id;
|
||||||
};
|
};
|
||||||
@@ -108,6 +137,7 @@ function applyMenuSupportRules(clientId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function loadCurrentUser() {
|
async function loadCurrentUser() {
|
||||||
|
loadServerVersion();
|
||||||
try {
|
try {
|
||||||
const res = await fetch("/api/auth/me");
|
const res = await fetch("/api/auth/me");
|
||||||
if (res.ok) {
|
if (res.ok) {
|
||||||
|
|||||||
@@ -222,9 +222,6 @@
|
|||||||
placeholder="wss://your-server:5173"
|
placeholder="wss://your-server:5173"
|
||||||
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"
|
class="w-full px-3 py-2 bg-slate-800/60 border border-slate-700 rounded-lg focus:outline-none focus:border-blue-500 transition-colors"
|
||||||
/>
|
/>
|
||||||
<p class="text-xs text-slate-500 mt-1">
|
|
||||||
Optional: Override the default server URL in the build
|
|
||||||
</p>
|
|
||||||
<label class="mt-2 flex items-center gap-2 text-xs text-slate-400">
|
<label class="mt-2 flex items-center gap-2 text-xs text-slate-400">
|
||||||
<input type="checkbox" id="raw-server-list" name="raw-server-list" class="w-4 h-4" />
|
<input type="checkbox" id="raw-server-list" name="raw-server-list" class="w-4 h-4" />
|
||||||
Use raw HTTPS server list (fetches multiple wss:// endpoints)
|
Use raw HTTPS server list (fetches multiple wss:// endpoints)
|
||||||
|
|||||||
@@ -39,6 +39,9 @@
|
|||||||
<div>
|
<div>
|
||||||
<h1 class="text-2xl font-semibold">Clients</h1>
|
<h1 class="text-2xl font-semibold">Clients</h1>
|
||||||
<p class="text-slate-400">KDOT wants YOU to have a good day!</p>
|
<p class="text-slate-400">KDOT wants YOU to have a good day!</p>
|
||||||
|
<p id="server-version-text" class="text-xs text-slate-500 mt-1">
|
||||||
|
Server version: loading...
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<span
|
<span
|
||||||
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-blue-900/40 text-blue-100 border border-blue-700/60"
|
class="inline-flex items-center gap-2 px-3 py-2 rounded-full bg-blue-900/40 text-blue-100 border border-blue-700/60"
|
||||||
|
|||||||
@@ -563,6 +563,7 @@ export interface BuildRecord {
|
|||||||
name: string;
|
name: string;
|
||||||
filename: string;
|
filename: string;
|
||||||
platform: string;
|
platform: string;
|
||||||
|
version?: string;
|
||||||
size: number;
|
size: number;
|
||||||
}>;
|
}>;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,17 @@ type BuildProcessDeps = {
|
|||||||
sanitizeOutputName: (name: string) => string;
|
sanitizeOutputName: (name: string) => string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function detectAgentVersion(clientDir: string): string {
|
||||||
|
try {
|
||||||
|
const configPath = path.join(clientDir, "cmd", "agent", "config", "config.go");
|
||||||
|
const content = fs.readFileSync(configPath, "utf8");
|
||||||
|
const match = content.match(/var\s+AgentVersion\s*=\s*"([^"]+)"/);
|
||||||
|
return match?.[1]?.trim() || "unknown";
|
||||||
|
} catch {
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export async function startBuildProcess(
|
export async function startBuildProcess(
|
||||||
buildId: string,
|
buildId: string,
|
||||||
config: BuildProcessConfig,
|
config: BuildProcessConfig,
|
||||||
@@ -150,6 +161,7 @@ export async function startBuildProcess(
|
|||||||
`Overlord-Client source not found (missing go.mod). Checked: ${path.join(rootDir, "dist", "Overlord-Client")}, ${path.join(rootDir, "Overlord-Client")}`,
|
`Overlord-Client source not found (missing go.mod). Checked: ${path.join(rootDir, "dist", "Overlord-Client")}, ${path.join(rootDir, "Overlord-Client")}`,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
const agentVersion = detectAgentVersion(clientDir);
|
||||||
const outDir = path.join(rootDir, "dist-clients");
|
const outDir = path.join(rootDir, "dist-clients");
|
||||||
const cacheRoot = resolveClientBuildCacheRoot();
|
const cacheRoot = resolveClientBuildCacheRoot();
|
||||||
const goBuildCacheDir = path.join(cacheRoot, "go-build");
|
const goBuildCacheDir = path.join(cacheRoot, "go-build");
|
||||||
@@ -160,6 +172,7 @@ export async function startBuildProcess(
|
|||||||
fs.mkdirSync(goModCacheDir, { recursive: true });
|
fs.mkdirSync(goModCacheDir, { recursive: true });
|
||||||
sendToStream({ type: "output", text: `Build directory: ${outDir}\n`, level: "info" });
|
sendToStream({ type: "output", text: `Build directory: ${outDir}\n`, level: "info" });
|
||||||
sendToStream({ type: "output", text: `Client source: ${clientDir}\n`, level: "info" });
|
sendToStream({ type: "output", text: `Client source: ${clientDir}\n`, level: "info" });
|
||||||
|
sendToStream({ type: "output", text: `Stub version: ${agentVersion}\n`, level: "info" });
|
||||||
sendToStream({ type: "output", text: `Client build cache: ${cacheRoot}\n`, level: "info" });
|
sendToStream({ type: "output", text: `Client build cache: ${cacheRoot}\n`, level: "info" });
|
||||||
|
|
||||||
const platformsToBuild = (config.platforms || []).filter((p) => ALLOWED_PLATFORMS.has(p));
|
const platformsToBuild = (config.platforms || []).filter((p) => ALLOWED_PLATFORMS.has(p));
|
||||||
@@ -371,6 +384,7 @@ export async function startBuildProcess(
|
|||||||
name: outputName,
|
name: outputName,
|
||||||
filename: outputName,
|
filename: outputName,
|
||||||
platform,
|
platform,
|
||||||
|
version: agentVersion,
|
||||||
size,
|
size,
|
||||||
});
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
|||||||
@@ -1 +1 @@
|
|||||||
export const SERVER_VERSION = "1.3.2";
|
export const SERVER_VERSION = "1.3.3";
|
||||||
|
|||||||
Reference in New Issue
Block a user