diff --git a/src/components/chat/ChatPanel.vue b/src/components/chat/ChatPanel.vue index d485714..fd97470 100644 --- a/src/components/chat/ChatPanel.vue +++ b/src/components/chat/ChatPanel.vue @@ -16,6 +16,31 @@ const renameSessionId = ref(null) const renameInputRef = ref | null>(null) const collapsedGroups = ref>(new Set()) +const sourceLabel: Record = { + telegram: 'Telegram', + api_server: 'API Server', + cli: 'CLI', + discord: 'Discord', + slack: 'Slack', + matrix: 'Matrix', + whatsapp: 'WhatsApp', + signal: 'Signal', + email: 'Email', + sms: 'SMS', + dingtalk: 'DingTalk', + feishu: 'Feishu', + wecom: 'WeCom', + weixin: 'WeChat', + bluebubbles: 'iMessage', + mattermost: 'Mattermost', + cron: 'Cron', +} + +function getSourceLabel(source?: string): string { + if (!source) return '' + return sourceLabel[source] || source +} + // Source sort order: api_server first, cron last, others alphabetical function sourceSortKey(source: string): number { if (source === 'api_server') return -1 @@ -84,32 +109,6 @@ const activeSessionSource = computed(() => chatStore.activeSession?.source || '', ) - -const sourceLabel: Record = { - telegram: 'Telegram', - api_server: 'API Server', - cli: 'CLI', - discord: 'Discord', - slack: 'Slack', - matrix: 'Matrix', - whatsapp: 'WhatsApp', - signal: 'Signal', - email: 'Email', - sms: 'SMS', - dingtalk: 'DingTalk', - feishu: 'Feishu', - wecom: 'WeCom', - weixin: 'WeChat', - bluebubbles: 'iMessage', - mattermost: 'Mattermost', - cron: 'Cron', -} - -function getSourceLabel(source?: string): string { - if (!source) return '' - return sourceLabel[source] || source -} - function handleNewChat() { chatStore.newChat() }