|
|
@@ -54,6 +54,7 @@ export const useInstallStore = defineStore('install', () => {
|
|
|
nodejs: createDefaultStatus(),
|
|
|
vscode: createDefaultStatus(),
|
|
|
git: createDefaultStatus(),
|
|
|
+ claudeCode: createDefaultStatus(),
|
|
|
all: createDefaultStatus()
|
|
|
})
|
|
|
|
|
|
@@ -61,13 +62,8 @@ export const useInstallStore = defineStore('install', () => {
|
|
|
const installedInfo = ref<AllInstalledInfo>({
|
|
|
nodejs: { installed: false, version: null },
|
|
|
vscode: { installed: false, version: null },
|
|
|
- git: { installed: false, version: null }
|
|
|
- })
|
|
|
-
|
|
|
- // Claude Code 安装状态(单独管理,因为不是通过 checkInstalled('all') 检测)
|
|
|
- const claudeCodeInfo = ref<{ installed: boolean; version: string | null }>({
|
|
|
- installed: false,
|
|
|
- version: null
|
|
|
+ git: { installed: false, version: null },
|
|
|
+ claudeCode: { installed: false, version: null }
|
|
|
})
|
|
|
|
|
|
// 安装选项
|
|
|
@@ -140,25 +136,6 @@ export const useInstallStore = defineStore('install', () => {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- async function checkClaudeCode(): Promise<void> {
|
|
|
- try {
|
|
|
- const result = await window.electronAPI.checkClaudeCode()
|
|
|
- claudeCodeInfo.value = result
|
|
|
- } catch (error) {
|
|
|
- const errorMsg = error instanceof Error ? error.message : String(error)
|
|
|
- notifyError(`${t('common.error')}: ${errorMsg}`)
|
|
|
- claudeCodeInfo.value = { installed: false, version: null }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- function isClaudeCodeInstalled(): boolean {
|
|
|
- return claudeCodeInfo.value.installed
|
|
|
- }
|
|
|
-
|
|
|
- function getClaudeCodeVersion(): string | null {
|
|
|
- return claudeCodeInfo.value.version
|
|
|
- }
|
|
|
-
|
|
|
async function doInstall(software: SoftwareTypeWithAll, options: InstallOptions): Promise<void> {
|
|
|
setInstalling(software, true)
|
|
|
updateStatus(software, t('install.preparing'), 0)
|
|
|
@@ -233,7 +210,6 @@ export const useInstallStore = defineStore('install', () => {
|
|
|
return {
|
|
|
installStatus,
|
|
|
installedInfo,
|
|
|
- claudeCodeInfo,
|
|
|
installOptions,
|
|
|
installHistory,
|
|
|
installLogs,
|
|
|
@@ -244,7 +220,6 @@ export const useInstallStore = defineStore('install', () => {
|
|
|
setError,
|
|
|
resetStatus,
|
|
|
checkInstalledSoftware,
|
|
|
- checkClaudeCode,
|
|
|
doInstall,
|
|
|
cancelInstall,
|
|
|
uninstallSoftware,
|
|
|
@@ -253,8 +228,6 @@ export const useInstallStore = defineStore('install', () => {
|
|
|
clearLogs,
|
|
|
getStatus,
|
|
|
isInstalled,
|
|
|
- getInstalledVersion,
|
|
|
- isClaudeCodeInstalled,
|
|
|
- getClaudeCodeVersion
|
|
|
+ getInstalledVersion
|
|
|
}
|
|
|
})
|