feat(frontend): add i18n support and navigation

- Install vue-i18n and configure locales (zh/en)
- Add complete navigation bar with 5 items: Home, About, Submit, Status, Tool Guide
- Add language switcher (中文/EN) with localStorage persistence
- Create HomeView with hero section, features, and quick links
- Create AboutView with features and usage guide
- Create ToolInfoView explaining BtToxin_Shoter principles (no formulas, no Digger)
- Update TaskSubmitForm: single file upload, genome/protein toggle, tooltips
- Update TaskMonitorView: i18n, queue status display
- Add queue_position field to TaskStatusResponse type

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
zly
2026-01-13 16:57:03 +08:00
parent e19f51c660
commit 547328ad44
14 changed files with 1436 additions and 204 deletions

View File

@@ -1,12 +1,35 @@
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { createI18n } from 'vue-i18n'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import App from './App.vue'
import router from './router'
// Import translation files
import zh from './locales/zh.json'
import en from './locales/en.json'
// Create i18n instance
const i18n = createI18n({
legacy: false, // Use Composition API
locale: localStorage.getItem('locale') || 'zh', // Get from localStorage or default to Chinese
fallbackLocale: 'zh',
messages: {
zh,
en
}
})
const app = createApp(App)
app.use(createPinia())
app.use(router)
app.use(i18n)
app.use(ElementPlus)
// Make i18n available globally
app.config.globalProperties.$t = i18n.global.t
app.mount('#app')