Merge branch 'fix-error' of https://gitea.cirry.cn/cirry/electron-opencode into fix-error

This commit is contained in:
houakang
2026-04-12 12:59:09 +08:00
4 changed files with 155 additions and 17 deletions

View File

@@ -3,8 +3,22 @@ import { ref, computed } from 'vue';
import { sseManager } from '@/http/sse.js';
export const useAppStore = defineStore('app', () => {
// 服务运行状态常量
const SERVICE_STATUS = {
IDLE: 'idle', // 未启动
CONNECTING: 'connecting', // 连接中
RUNNING: 'running', // 服务运行中
FAILED: 'failed', // 连接失败
};
const title = ref('智聚超脑');
const collapsed = ref(false);
const serviceStatus = ref(SERVICE_STATUS.IDLE);
const startServiceFlag = ref(0); // 用于触发外部启动服务的标记
function triggerStartService() {
startServiceFlag.value++;
}
// SSE 相关状态
const sseConnected = ref(false);
@@ -134,5 +148,10 @@ export const useAppStore = defineStore('app', () => {
isAssistantMessage,
addAssistantMessageId,
clearAssistantMessageIds,
// 服务运行状态
serviceStatus,
SERVICE_STATUS,
startServiceFlag,
triggerStartService,
};
});