Compare commits
2 Commits
7b5650d098
...
baa42fa625
| Author | SHA1 | Date | |
|---|---|---|---|
| baa42fa625 | |||
| 39ce37e69c |
22
src/components/BuildVersion.vue
Normal file
22
src/components/BuildVersion.vue
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
<template>
|
||||||
|
<div class="build-version">{{ version }}</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
const version = __BUILD_VERSION__
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.build-version {
|
||||||
|
position: fixed;
|
||||||
|
top: 8px;
|
||||||
|
right: 8px;
|
||||||
|
font-size: 10px;
|
||||||
|
color: var(--text-secondary, #9aa0a6);
|
||||||
|
background: var(--bg-secondary, rgba(0,0,0,0.1));
|
||||||
|
padding: 2px 6px;
|
||||||
|
border-radius: 3px;
|
||||||
|
z-index: 9999;
|
||||||
|
font-family: monospace;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1796,7 +1796,6 @@ async function executeMerge(targetGroupId: string) {
|
|||||||
target_id: targetTraceId
|
target_id: targetTraceId
|
||||||
})
|
})
|
||||||
successCount++
|
successCount++
|
||||||
updateClusterAfterMerge(g.identity_uuid, targetGroupId)
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Merge trace failed:', srcTraceId, e)
|
console.error('Merge trace failed:', srcTraceId, e)
|
||||||
failCount++
|
failCount++
|
||||||
|
|||||||
11
src/vite-env.d.ts
vendored
Normal file
11
src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare const __BUILD_VERSION__: string
|
||||||
|
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_APP_TITLE: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv
|
||||||
|
}
|
||||||
@@ -1,9 +1,17 @@
|
|||||||
import { defineConfig } from 'vite'
|
import { defineConfig } from 'vite'
|
||||||
import vue from '@vitejs/plugin-vue'
|
import vue from '@vitejs/plugin-vue'
|
||||||
import { resolve } from 'path'
|
import { resolve } from 'path'
|
||||||
|
import { execSync } from 'child_process'
|
||||||
|
|
||||||
|
const gitHash = execSync('git log --format="%h" -1', { encoding: 'utf-8' }).trim()
|
||||||
|
const buildTime = new Date().toISOString().slice(0, 19).replace(/[-:T]/g, '')
|
||||||
|
const buildVersion = `${buildTime}-${gitHash}`
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
plugins: [vue()],
|
plugins: [vue()],
|
||||||
|
define: {
|
||||||
|
__BUILD_VERSION__: JSON.stringify(buildVersion)
|
||||||
|
},
|
||||||
resolve: {
|
resolve: {
|
||||||
alias: {
|
alias: {
|
||||||
'@': resolve(__dirname, 'src')
|
'@': resolve(__dirname, 'src')
|
||||||
|
|||||||
Reference in New Issue
Block a user