From 446b96c6c0aad11675e9086a34759f859fec3393 Mon Sep 17 00:00:00 2001 From: Rostislav Dugin Date: Wed, 11 Mar 2026 11:39:53 +0300 Subject: [PATCH] FEATURE (arch): Add architecture to Databasus version in the bottom left of UI --- .github/ISSUE_TEMPLATE/bug_report.md | 4 +++- Dockerfile | 5 ++++- frontend/src/constants.ts | 5 +++++ frontend/src/widgets/main/MainScreenComponent.tsx | 4 +++- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 5fbd780..5f99bf2 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -4,7 +4,9 @@ about: Report a bug or unexpected behavior in Databasus labels: bug --- -## Databasus version +## Databasus version (screenshot) + +It is displayed in the bottom left corner of the Databasus UI. Please attach screenshot, not just version text diff --git a/Dockerfile b/Dockerfile index f672b4e..91ed847 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,8 +71,10 @@ FROM debian:bookworm-slim # Add version metadata to runtime image ARG APP_VERSION=dev +ARG TARGETARCH LABEL org.opencontainers.image.version=$APP_VERSION ENV APP_VERSION=$APP_VERSION +ENV CONTAINER_ARCH=$TARGETARCH # Set production mode for Docker containers ENV ENV_MODE=production @@ -269,7 +271,8 @@ window.__RUNTIME_CONFIG__ = { GITHUB_CLIENT_ID: '\${GITHUB_CLIENT_ID:-}', GOOGLE_CLIENT_ID: '\${GOOGLE_CLIENT_ID:-}', IS_EMAIL_CONFIGURED: '\$IS_EMAIL_CONFIGURED', - CLOUDFLARE_TURNSTILE_SITE_KEY: '\${CLOUDFLARE_TURNSTILE_SITE_KEY:-}' + CLOUDFLARE_TURNSTILE_SITE_KEY: '\${CLOUDFLARE_TURNSTILE_SITE_KEY:-}', + CONTAINER_ARCH: '\${CONTAINER_ARCH:-unknown}' }; JSEOF diff --git a/frontend/src/constants.ts b/frontend/src/constants.ts index a21b16b..d316449 100644 --- a/frontend/src/constants.ts +++ b/frontend/src/constants.ts @@ -4,6 +4,7 @@ interface RuntimeConfig { GOOGLE_CLIENT_ID?: string; IS_EMAIL_CONFIGURED?: string; CLOUDFLARE_TURNSTILE_SITE_KEY?: string; + CONTAINER_ARCH?: string; } declare global { @@ -45,6 +46,10 @@ export const CLOUDFLARE_TURNSTILE_SITE_KEY = import.meta.env.VITE_CLOUDFLARE_TURNSTILE_SITE_KEY || ''; +const archMap: Record = { amd64: 'x64', arm64: 'arm64' }; +const rawArch = window.__RUNTIME_CONFIG__?.CONTAINER_ARCH || 'unknown'; +export const CONTAINER_ARCH = archMap[rawArch] || rawArch; + export function getOAuthRedirectUri(): string { return `${window.location.origin}/auth/callback`; } diff --git a/frontend/src/widgets/main/MainScreenComponent.tsx b/frontend/src/widgets/main/MainScreenComponent.tsx index 2580c4c..69c9f79 100644 --- a/frontend/src/widgets/main/MainScreenComponent.tsx +++ b/frontend/src/widgets/main/MainScreenComponent.tsx @@ -2,7 +2,7 @@ import { LoadingOutlined, MenuOutlined } from '@ant-design/icons'; import { App, Button, Spin, Tooltip } from 'antd'; import { useEffect, useState } from 'react'; -import { APP_VERSION } from '../../constants'; +import { APP_VERSION, CONTAINER_ARCH } from '../../constants'; import { type DiskUsage, diskApi } from '../../entity/disk'; import { type UserProfile, @@ -365,6 +365,8 @@ export const MainScreenComponent = () => {
v{APP_VERSION} +
+ {CONTAINER_ARCH}
)}