deploy: add PWA version and finalize desktop build
This commit is contained in:
parent
40634acc2b
commit
c50c88836d
@ -54,11 +54,13 @@ WORKDIR /workspace
|
||||
ARG VITE_API_BASE_URL=""
|
||||
ARG VITE_KEYCLOAK_ISSUER=""
|
||||
ARG VITE_KEYCLOAK_CLIENT_ID="fieldlens"
|
||||
ARG VITE_APP_RELEASE="0.1.0"
|
||||
ARG FIELDLENS_VERSION="dev"
|
||||
|
||||
ENV VITE_API_BASE_URL=$VITE_API_BASE_URL
|
||||
ENV VITE_KEYCLOAK_ISSUER=$VITE_KEYCLOAK_ISSUER
|
||||
ENV VITE_KEYCLOAK_CLIENT_ID=$VITE_KEYCLOAK_CLIENT_ID
|
||||
ENV VITE_APP_RELEASE=$VITE_APP_RELEASE
|
||||
ENV VITE_APP_VERSION=$FIELDLENS_VERSION
|
||||
|
||||
COPY package.json ./
|
||||
|
||||
@ -51,6 +51,9 @@ export function SettingsView({ storageStatus, updateAvailable, isUpdating, updat
|
||||
}
|
||||
|
||||
const storageLabel = storageStatus === 'persistent' ? 'Durable' : storageStatus === 'checking' ? 'Checking' : storageStatus === 'unsupported' ? 'Browser managed' : 'Best effort'
|
||||
const releaseVersion = (import.meta.env.VITE_APP_RELEASE || '0.1.0').trim()
|
||||
const rawBuildId = (import.meta.env.VITE_APP_VERSION || 'dev').trim()
|
||||
const buildId = /^[0-9a-f]{12,}$/i.test(rawBuildId) ? rawBuildId.slice(0, 8) : rawBuildId
|
||||
|
||||
return (
|
||||
<section className="workspace-view settings-view" aria-labelledby="settings-title">
|
||||
@ -87,6 +90,7 @@ export function SettingsView({ storageStatus, updateAvailable, isUpdating, updat
|
||||
|
||||
<section className="settings-section">
|
||||
<header><span className="settings-icon"><CloudDownload /></span><div><h2>Application</h2><p>PWA lifecycle</p></div></header>
|
||||
<div className="setting-row"><div><strong>App version</strong><small>Build {buildId}</small></div><b>v{releaseVersion}</b></div>
|
||||
<div className="setting-row"><div><strong>{updateAvailable ? 'Update available' : 'Service worker active'}</strong><small>{updateError || (isUpdating ? 'Installing the latest build…' : updateAvailable ? 'A newer build is ready.' : 'Updates are managed by the PWA service worker.')}</small></div><button className="quiet-button" type="button" disabled={!updateAvailable || isUpdating} onClick={() => void onApplyUpdate()}><CloudDownload size={15} /> {isUpdating ? 'Updating' : 'Update'}</button></div>
|
||||
</section>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user