fixes version not showing up in web ui
This commit is contained in:
@@ -3,3 +3,6 @@
|
|||||||
Dockerfile
|
Dockerfile
|
||||||
.dockerignore
|
.dockerignore
|
||||||
docker-compose.yml
|
docker-compose.yml
|
||||||
|
node_modules
|
||||||
|
tests
|
||||||
|
vitest.config.js
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1 +1,2 @@
|
|||||||
node_modules/
|
node_modules/
|
||||||
|
js/version.js
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
FROM nginx:alpine
|
FROM nginx:alpine
|
||||||
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
COPY nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
COPY . /usr/share/nginx/html
|
COPY . /usr/share/nginx/html
|
||||||
|
RUN awk -F'"' '/"version"/{printf "const VERSION = \"%s\";\n", $4; exit}' \
|
||||||
|
/usr/share/nginx/html/package.json \
|
||||||
|
> /usr/share/nginx/html/js/version.js
|
||||||
|
|||||||
@@ -177,6 +177,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.10.2/sql-wasm.js"></script>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/sql.js/1.10.2/sql-wasm.js"></script>
|
||||||
|
<script src="js/version.js" onerror="window.VERSION=null"></script>
|
||||||
<script src="js/config.js"></script>
|
<script src="js/config.js"></script>
|
||||||
<script src="js/db.js"></script>
|
<script src="js/db.js"></script>
|
||||||
<script src="js/ui.js"></script>
|
<script src="js/ui.js"></script>
|
||||||
|
|||||||
@@ -37,10 +37,7 @@ window.addEventListener('popstate', e => {
|
|||||||
|
|
||||||
// ── Bootstrap ─────────────────────────────────────────────────────────────────
|
// ── Bootstrap ─────────────────────────────────────────────────────────────────
|
||||||
|
|
||||||
fetch('/package.json')
|
if (VERSION) document.getElementById('nav-version').textContent = `v${VERSION}`;
|
||||||
.then(r => r.json())
|
|
||||||
.then(pkg => { document.getElementById('nav-version').textContent = `v${pkg.version}`; })
|
|
||||||
.catch(() => {});
|
|
||||||
|
|
||||||
initDB().then(() => {
|
initDB().then(() => {
|
||||||
renderDashboard();
|
renderDashboard();
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
{
|
{
|
||||||
"name": "catalyst",
|
"name": "catalyst",
|
||||||
"version": "1.0.2",
|
"version": "1.0.3",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "vitest run",
|
"test": "vitest run",
|
||||||
"test:watch": "vitest"
|
"test:watch": "vitest",
|
||||||
|
"version:write": "node -e \"const {version}=JSON.parse(require('fs').readFileSync('package.json','utf8'));require('fs').writeFileSync('js/version.js','const VERSION = \\\"'+version+'\\\";\\n');\""
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"vitest": "^2.0.0",
|
"vitest": "^2.0.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user