From 5ccf2b110824be43162acb667a2774ec4cd3bdbb Mon Sep 17 00:00:00 2001 From: Aleksandr Bogomiakov Date: Wed, 7 Oct 2026 15:32:20 +0100 Subject: [PATCH] Show the running version next to the brand; bump to 0.2.1 Co-Authored-By: Claude --- Cargo.lock | 2 +- Cargo.toml | 2 +- helm/meguri/Chart.yaml | 4 ++-- src/web.rs | 4 ++-- static/app.css | 4 ++++ static/app.js | 4 ++-- static/index.html | 2 ++ static/locales/messages.json | 5 +++++ tests/browser-access.cjs | 12 ++++++++++++ 9 files changed, 31 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 90020ed..be46ceb 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1794,7 +1794,7 @@ dependencies = [ [[package]] name = "meguri" -version = "0.2.0" +version = "0.2.1" dependencies = [ "argon2", "base64 0.23.1", diff --git a/Cargo.toml b/Cargo.toml index 7db14b9..85cfdcb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "meguri" -version = "0.2.0" +version = "0.2.1" edition = "2024" rust-version = "1.97" description = "Provider-independent on-call scheduling and configuration control plane" diff --git a/helm/meguri/Chart.yaml b/helm/meguri/Chart.yaml index adc1e50..87e9d79 100644 --- a/helm/meguri/Chart.yaml +++ b/helm/meguri/Chart.yaml @@ -2,6 +2,6 @@ apiVersion: v2 name: meguri description: On-call schedules, replacements and escalation policies as a source of truth type: application -version: 0.2.0 -appVersion: "0.2.0" +version: 0.2.1 +appVersion: "0.2.1" kubeVersion: ">=1.29.0-0" diff --git a/src/web.rs b/src/web.rs index 1058799..f151747 100644 --- a/src/web.rs +++ b/src/web.rs @@ -285,10 +285,10 @@ async fn dispatch(request: Request) -> Result { json!({"oidc":config.oidc.is_some(),"password":config.password_form_available()}); return match identity { Ok(i) => response( - json!({"user":i.user,"csrf":i.csrf,"auth":auth,"demo":crate::demo_runtime::active(),"demo_lifecycle":crate::demo_runtime::notice()}), + json!({"version":env!("CARGO_PKG_VERSION"),"user":i.user,"csrf":i.csrf,"auth":auth,"demo":crate::demo_runtime::active(),"demo_lifecycle":crate::demo_runtime::notice()}), ), Err(Error::Unauthorized) => response( - json!({"user":null,"auth":auth,"demo":crate::demo_runtime::active(),"demo_lifecycle":crate::demo_runtime::notice()}), + json!({"version":env!("CARGO_PKG_VERSION"),"user":null,"auth":auth,"demo":crate::demo_runtime::active(),"demo_lifecycle":crate::demo_runtime::notice()}), ), Err(e) => Err(e), }; diff --git a/static/app.css b/static/app.css index ed06204..e253a60 100644 --- a/static/app.css +++ b/static/app.css @@ -220,3 +220,7 @@ a.button{display:inline-block;text-decoration:none;border:1px solid #dbe3de;bord .event-details{display:flex;flex-wrap:wrap;gap:4px 18px;margin:6px 0 0}.event-details>div{min-width:0;max-width:100%}.event-details dt{display:inline;color:var(--muted);font-size:11px}.event-details dt::after{content:": "}.event-details dd{display:inline;margin:0;overflow-wrap:anywhere;word-break:break-word;font-size:12px} .chips{display:inline-flex;flex-wrap:wrap;gap:4px}.chip{font:11px/1.4 Consolas,monospace;background:#eef3f0;padding:1px 6px;border-radius:10px;overflow-wrap:anywhere} @media(max-width:700px){.event-search{flex-wrap:wrap}.event-search input{flex-basis:100%}.event-time{margin-left:0;flex-basis:100%}} + +.brand .app-version{align-self:flex-end;margin-bottom:7px;font-size:11px;font-weight:500;letter-spacing:0;color:var(--muted)} +@media(max-width:950px){.sidebar .brand{flex-direction:column;gap:2px}.sidebar .brand .app-version{align-self:center;margin:0}} +@media(max-width:700px){.sidebar{gap:4px;padding:8px}.sidebar nav :is(button,a){padding:8px 4px}.sidebar .brand .app-version{margin:0;font-size:10px}} diff --git a/static/app.js b/static/app.js index b863e80..bd6fc7b 100644 --- a/static/app.js +++ b/static/app.js @@ -18,7 +18,7 @@ document.addEventListener('alpine:init', () => { })); Alpine.data('meguri', () => ({ ...generationUi(), - user: null, csrf: '', ready: false, busy: false, error: '', toast: '', demo: false, demoLifecycle:null, auth:{oidc:false,password:true}, loginError:null, admin:null, events:[], eventsMore:false, eventSearch:'', eventsLoading:false, + user: null, csrf: '', version: '', ready: false, busy: false, error: '', toast: '', demo: false, demoLifecycle:null, auth:{oidc:false,password:true}, loginError:null, admin:null, events:[], eventsMore:false, eventSearch:'', eventsLoading:false, loginForm: { username: '', password: '' }, directoryState: { workspaces: [] }, selected: '', detail: null, calendar: { days: [], assignments: [] }, view: 'calendar', scheduleId: '', startDay: '', modal: '', form: {}, menu: false, @@ -131,7 +131,7 @@ document.addEventListener('alpine:init', () => { this.consumeLoginError(); {const query=new URLSearchParams(location.search);this.eventSearch=(query.get('ref')||query.get('search')||'').slice(0,200);} const initial=this.readNavigation();this.selected=initial.workspace;this.view=initial.view;window.addEventListener('popstate',()=>this.restoreNavigation()); - await this.run(async () => { const session = await this.api('/api/session'); this.user = session.user; this.csrf = session.csrf || ''; this.auth = session.auth || {oidc:false,password:true}; this.demo = session.demo;this.demoLifecycle=session.demo_lifecycle; if (this.user) { if(this.view==='instance' && !this.user.instance_admin)this.view='calendar'; await this.loadWorkspaces(); if(this.view==='instance')await this.loadAdmin(); } }); + await this.run(async () => { const session = await this.api('/api/session'); this.version = session.version || ''; this.user = session.user; this.csrf = session.csrf || ''; this.auth = session.auth || {oidc:false,password:true}; this.demo = session.demo;this.demoLifecycle=session.demo_lifecycle; if (this.user) { if(this.view==='instance' && !this.user.instance_admin)this.view='calendar'; await this.loadWorkspaces(); if(this.view==='instance')await this.loadAdmin(); } }); if(this.setupView)this.setupOpen=true;this.ready = true;this.writeNavigation(true);this.$nextTick(()=>{const update=()=>document.documentElement.style.setProperty('--demo-offset',(this.$refs.demoBanner?.getBoundingClientRect().height||0)+'px');new ResizeObserver(update).observe(this.$refs.demoBanner);update();});if(this.view==='configuration')this.loadGenerationDraft(); setInterval(() => { if (this.user && this.workspace && this.view!=='configuration' && !this.modal && !this.busy && !this.draggedRoute) this.run(() => this.loadWorkspace()); }, 20000); }, diff --git a/static/index.html b/static/index.html index e7b8b86..77121c9 100644 --- a/static/index.html +++ b/static/index.html @@ -33,6 +33,7 @@