- Add vue-i18n with auto-detect browser language and manual toggle (EN/中文) - Move platform channels to separate page with credential management - Support Telegram, Discord, Slack, WhatsApp, Matrix, Feishu, Weixin, WeCom - Add WeChat QR code login (opens in browser, polls status, auto-saves) - Write platform credentials to ~/.hermes/.env matching hermes gateway setup - Auto restart gateway after platform config changes - Add settings store with per-section save for all config categories - Persist session group collapse state across navigation - Fix pre-existing TypeScript build errors Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
54 lines
2.3 KiB
Vue
54 lines
2.3 KiB
Vue
<script setup lang="ts">
|
|
import { NSwitch, useMessage } from 'naive-ui'
|
|
import { useI18n } from 'vue-i18n'
|
|
import { useSettingsStore } from '@/stores/settings'
|
|
import SettingRow from './SettingRow.vue'
|
|
|
|
const settingsStore = useSettingsStore()
|
|
const message = useMessage()
|
|
const { t } = useI18n()
|
|
|
|
async function save(values: Record<string, any>) {
|
|
try {
|
|
await settingsStore.saveSection('display', values)
|
|
message.success(t('settings.saved'))
|
|
} catch (err: any) {
|
|
message.error(t('settings.saveFailed'))
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<section class="settings-section">
|
|
<SettingRow :label="t('settings.display.streaming')" :hint="t('settings.display.streamingHint')">
|
|
<NSwitch :value="settingsStore.display.streaming" @update:value="v => save({ streaming: v })" />
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.display.compact')" :hint="t('settings.display.compactHint')">
|
|
<NSwitch :value="settingsStore.display.compact" @update:value="v => save({ compact: v })" />
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.display.showReasoning')" :hint="t('settings.display.showReasoningHint')">
|
|
<NSwitch :value="settingsStore.display.show_reasoning" @update:value="v => save({ show_reasoning: v })" />
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.display.showCost')" :hint="t('settings.display.showCostHint')">
|
|
<NSwitch :value="settingsStore.display.show_cost" @update:value="v => save({ show_cost: v })" />
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.display.inlineDiffs')" :hint="t('settings.display.inlineDiffsHint')">
|
|
<NSwitch :value="settingsStore.display.inline_diffs" @update:value="v => save({ inline_diffs: v })" />
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.display.bellOnComplete')" :hint="t('settings.display.bellOnCompleteHint')">
|
|
<NSwitch :value="settingsStore.display.bell_on_complete" @update:value="v => save({ bell_on_complete: v })" />
|
|
</SettingRow>
|
|
<SettingRow :label="t('settings.display.busyInputMode')" :hint="t('settings.display.busyInputModeHint')">
|
|
<NSwitch :value="settingsStore.display.busy_input_mode === 'interrupt'" @update:value="v => save({ busy_input_mode: v ? 'interrupt' : 'off' })" />
|
|
</SettingRow>
|
|
</section>
|
|
</template>
|
|
|
|
<style scoped lang="scss">
|
|
@use '@/styles/variables' as *;
|
|
|
|
.settings-section {
|
|
margin-top: 16px;
|
|
}
|
|
</style>
|