feat(frontend): inject commit ID into frontend build for version tracking

- Added a new build argument `COMMIT_ID_ARG` to pass the commit ID during the Docker build process.
- Updated the Dockerfile to set an environment variable `VITE_FRONTEND_COMMIT` with the commit ID.
- Enhanced the Vite configuration to resolve the frontend commit ID from the environment or Git.
- Modified the SystemInfo component to display the frontend commit ID in the UI.
- Implemented a version info preparation step in the GitHub Actions workflow to capture the commit ID.
This commit is contained in:
wizardchen
2026-06-09 17:50:00 +08:00
committed by lyingbug
parent 4de3c3efbd
commit 589d2a6e52
7 changed files with 42 additions and 1 deletions
@@ -61,6 +61,9 @@
size="small"
style="margin-left: 8px;"
>{{ $t('system.versionMismatch') }}</t-tag>
<span v-if="frontendCommit && frontendCommit !== 'unknown'" class="commit-info">
({{ frontendCommit }})
</span>
</span>
</div>
</div>
@@ -203,6 +206,7 @@ const systemInfo = ref<SystemInfo | null>(null)
const loading = ref(true)
const error = ref('')
const frontendVersion = __FRONTEND_VERSION__
const frontendCommit = __FRONTEND_COMMIT__
let uptimeTicker: ReturnType<typeof setInterval> | null = null
const uptimeTick = ref(0)
@@ -260,6 +264,7 @@ const reportIssueURL = computed(() => {
'### Environment',
`- WeKnora version: ${systemInfo.value?.version || 'unknown'}`,
`- Commit: ${systemInfo.value?.commit_id || 'unknown'}`,
`- Frontend version: ${frontendVersion} (${frontendCommit})`,
`- DB version reported: ${systemInfo.value?.db_version || 'unknown'}`,
'',
'### Migration error',