fix: Version stand an zwei Stellen und lief auseinander
Die Oberfläche zeigte 0.2, während die Images schon 0.4 hiessen: os.js trug eine eigene Konstante, die ich beim Taggen nie mitgezogen habe. Jetzt steht sie nur noch in main.go. build.sh liest sie von dort und vergibt denselben Tag, die Oberfläche holt sie über /api/public und /api/me. Ein Test schlaegt an, falls je wieder eine zweite Version in os.js auftaucht. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
5ed4e30179
commit
5cf210ae97
5 files changed
+52
-9
No files matched your search
@@ -18,7 +18,6 @@
|
||||
|
||||
const LS_SETTINGS = "honeyos.settings";
|
||||
const SS_BOOTED = "honeyos.booted";
|
||||
const VERSION = "0.2";
|
||||
|
||||
const DEFAULT_SETTINGS = {
|
||||
mode: "terminal", // terminal | desktop
|
||||
@@ -30,7 +29,7 @@ const DEFAULT_SETTINGS = {
|
||||
};
|
||||
|
||||
const state = {
|
||||
cfg: { user: "", hostname: "honeyos", version: VERSION, apps: [] },
|
||||
cfg: { user: "", hostname: "honeyos", version: "…", apps: [] },
|
||||
me: null, // {sub, name, picture} sobald angemeldet
|
||||
oidc: false,
|
||||
settings: { ...DEFAULT_SETTINGS },
|
||||
@@ -217,6 +216,7 @@ function cookie(name) {
|
||||
async function loadFromServer() {
|
||||
const me = await api("/api/me");
|
||||
state.me = { sub: me.sub, name: me.name, picture: me.picture };
|
||||
if (me.version) state.cfg.version = me.version;
|
||||
state.oidc = !!me.oidc;
|
||||
state.cfg.user = me.name || "";
|
||||
|
||||
@@ -1132,7 +1132,7 @@ function showLogin(pub) {
|
||||
|
||||
const fehler = new URLSearchParams(location.search).get("fehler");
|
||||
const lines = [
|
||||
`HoneyOS ${VERSION} — ${state.cfg.hostname}`,
|
||||
`HoneyOS ${state.cfg.version} — ${state.cfg.hostname}`,
|
||||
"",
|
||||
"prüfe sitzung".padEnd(28, ".") + " keine",
|
||||
"anmeldung erforderlich",
|
||||
@@ -1181,6 +1181,7 @@ async function main() {
|
||||
let pub = { oidc: false, buttonLabel: "Anmelden" };
|
||||
try {
|
||||
pub = await api("/api/public");
|
||||
if (pub.version) state.cfg.version = pub.version;
|
||||
} catch {
|
||||
/* Server nicht erreichbar — der Anmeldeschirm sagt es gleich selbst */
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user