feat: profile-aware routes, provider sync, channel settings improvements
- Add hermes-profile.ts for dynamic profile path resolution (all backend routes now read from active profile directory instead of hardcoded ~/.hermes/) - Add profile switcher dropdown in sidebar, reload page on switch - Sync PROVIDER_PRESETS with Hermes CLI (fix keys: kimi-coding→kimi-for-coding, kilocode→kilo, ai-gateway→vercel, opencode-zen→opencode; remove moonshot) - Sync PROVIDER_ENV_MAP with Hermes models.dev + overlays (correct env var names) - Add gateway restart after adding model provider - Don't write GLM_BASE_URL/KIMI_BASE_URL for zai/kimi (let Hermes auto-detect) - Write API keys to .env and credential_pool for all providers - Built-in providers skip custom_providers in config.yaml - Add debounce + per-field loading state for channel settings inputs - Run hermes setup --reset for profiles without config.yaml - Create empty .env for new profiles (not copied from default) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import { defineStore } from 'pinia'
|
||||
import { ref } from 'vue'
|
||||
import { checkHealth, fetchAvailableModels, updateDefaultModel, type AvailableModelGroup } from '@/api/hermes/system'
|
||||
import { checkHealth, fetchAvailableModels, updateDefaultModel, triggerUpdate, type AvailableModelGroup } from '@/api/hermes/system'
|
||||
|
||||
const WEB_UI_VERSION = __APP_VERSION__
|
||||
|
||||
export const useAppStore = defineStore('app', () => {
|
||||
const sidebarOpen = ref(false)
|
||||
|
||||
const connected = ref(false)
|
||||
const serverVersion = ref('')
|
||||
const serverVersion = ref(WEB_UI_VERSION)
|
||||
const latestVersion = ref('')
|
||||
const updateAvailable = ref(false)
|
||||
const updating = ref(false)
|
||||
const modelGroups = ref<AvailableModelGroup[]>([])
|
||||
const selectedModel = ref('')
|
||||
const healthPollTimer = ref<ReturnType<typeof setInterval>>()
|
||||
@@ -16,11 +21,27 @@ export const useAppStore = defineStore('app', () => {
|
||||
const sessionPersistence = ref(true)
|
||||
const maxTokens = ref(4096)
|
||||
|
||||
async function doUpdate(): Promise<boolean> {
|
||||
updating.value = true
|
||||
try {
|
||||
const res = await triggerUpdate()
|
||||
if (res.success) {
|
||||
updateAvailable.value = false
|
||||
await checkConnection()
|
||||
}
|
||||
return res.success
|
||||
} finally {
|
||||
updating.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function checkConnection() {
|
||||
try {
|
||||
const res = await checkHealth()
|
||||
connected.value = res.status === 'ok'
|
||||
if (res.version) serverVersion.value = res.version
|
||||
if (res.webui_version) serverVersion.value = res.webui_version
|
||||
if (res.webui_latest) latestVersion.value = res.webui_latest
|
||||
updateAvailable.value = !!res.webui_update_available
|
||||
} catch {
|
||||
connected.value = false
|
||||
}
|
||||
@@ -75,6 +96,10 @@ export const useAppStore = defineStore('app', () => {
|
||||
closeSidebar,
|
||||
connected,
|
||||
serverVersion,
|
||||
latestVersion,
|
||||
updateAvailable,
|
||||
updating,
|
||||
doUpdate,
|
||||
modelGroups,
|
||||
selectedModel,
|
||||
streamEnabled,
|
||||
|
||||
Reference in New Issue
Block a user