|
|
@@ -1,5 +1,5 @@
|
|
|
<script setup lang="ts">
|
|
|
-import { computed } from 'vue'
|
|
|
+import { computed, ref, onMounted } from 'vue'
|
|
|
import { useI18n } from 'vue-i18n'
|
|
|
import { useVersionsStore } from '@/stores/versions'
|
|
|
import { useInstallStore } from '@/stores/install'
|
|
|
@@ -23,9 +23,26 @@ const needInstallVscode = computed(() => !installStore.isInstalled('vscode'))
|
|
|
const needInstallGit = computed(() => !installStore.isInstalled('git'))
|
|
|
const needInstallClaudeCode = computed(() => !installStore.isInstalled('claudeCode'))
|
|
|
|
|
|
+// Claude Code VS Code 扩展状态
|
|
|
+const claudeCodeExtInstalled = ref(false)
|
|
|
+const needInstallClaudeCodeExt = computed(() => !claudeCodeExtInstalled.value)
|
|
|
+
|
|
|
+async function checkClaudeCodeExtInstalled() {
|
|
|
+ try {
|
|
|
+ const result = await window.electronAPI.checkVscodeExtension('anthropic.claude-code')
|
|
|
+ claudeCodeExtInstalled.value = result.installed
|
|
|
+ } catch {
|
|
|
+ claudeCodeExtInstalled.value = false
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ checkClaudeCodeExtInstalled()
|
|
|
+})
|
|
|
+
|
|
|
// 是否有需要安装的软件
|
|
|
const hasAnythingToInstall = computed(() =>
|
|
|
- needInstallNodejs.value || needInstallPnpm.value || needInstallVscode.value || needInstallGit.value || needInstallClaudeCode.value
|
|
|
+ needInstallNodejs.value || needInstallPnpm.value || needInstallVscode.value || needInstallGit.value || needInstallClaudeCode.value || needInstallClaudeCodeExt.value
|
|
|
)
|
|
|
|
|
|
const isDisabled = computed(() =>
|
|
|
@@ -61,14 +78,15 @@ async function handleInstall() {
|
|
|
installNodejs: needInstallNodejs.value,
|
|
|
nodejsVersion: versionsStore.selectedVersions.nodejs,
|
|
|
nodejsPath: installStore.installOptions.all.nodejsPath,
|
|
|
- installPnpm: needInstallNodejs.value && installStore.installOptions.all.installPnpm,
|
|
|
+ installPnpm: needInstallPnpm.value && installStore.installOptions.all.installPnpm,
|
|
|
installVscode: needInstallVscode.value,
|
|
|
vscodeVersion: versionsStore.selectedVersions.vscode,
|
|
|
vscodePath: installStore.installOptions.all.vscodePath,
|
|
|
installGit: needInstallGit.value,
|
|
|
gitVersion: versionsStore.selectedVersions.git,
|
|
|
gitPath: installStore.installOptions.all.gitPath,
|
|
|
- installClaudeCode: needInstallClaudeCode.value
|
|
|
+ installClaudeCode: needInstallClaudeCode.value,
|
|
|
+ installClaudeCodeExt: needInstallClaudeCodeExt.value && installStore.installOptions.all.installClaudeCodeExt
|
|
|
}
|
|
|
|
|
|
await installStore.doInstall('all', options)
|
|
|
@@ -125,7 +143,11 @@ async function handleCancel() {
|
|
|
<!-- pnpm -->
|
|
|
<div class="option-group">
|
|
|
<div class="option-row">
|
|
|
- <el-checkbox v-model="installStore.installOptions.all.installPnpm" :disabled="installStore.isInstalled('pnpm')">
|
|
|
+ <el-checkbox
|
|
|
+ :model-value="!installStore.isInstalled('pnpm') && installStore.installOptions.all.installPnpm"
|
|
|
+ :disabled="installStore.isInstalled('pnpm')"
|
|
|
+ @update:model-value="installStore.installOptions.all.installPnpm = $event"
|
|
|
+ >
|
|
|
<span class="software-label">
|
|
|
<SoftwareIcon software="nodejs" :size="18" />
|
|
|
<span>pnpm</span>
|
|
|
@@ -140,6 +162,24 @@ async function handleCancel() {
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- Claude Code -->
|
|
|
+ <div class="option-group">
|
|
|
+ <div class="option-row">
|
|
|
+ <el-checkbox :model-value="needInstallClaudeCode" disabled>
|
|
|
+ <span class="software-label">
|
|
|
+ <SoftwareIcon software="claudeCode" :size="18" />
|
|
|
+ <span>Claude Code</span>
|
|
|
+ </span>
|
|
|
+ <el-tag v-if="installStore.isInstalled('claudeCode')" type="success" size="small" style="margin-left: 8px">
|
|
|
+ {{ t('common.installed') }} v{{ installStore.getInstalledVersion('claudeCode') }}
|
|
|
+ </el-tag>
|
|
|
+ </el-checkbox>
|
|
|
+ <span v-if="needInstallClaudeCode" class="option-hint">
|
|
|
+ {{ t('claudeCode.requiresNodejsGit') }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- VS Code -->
|
|
|
<div class="option-group">
|
|
|
<div class="option-row">
|
|
|
@@ -149,7 +189,7 @@ async function handleCancel() {
|
|
|
<span>VS Code</span>
|
|
|
</span>
|
|
|
<el-tag v-if="installStore.isInstalled('vscode')" type="success" size="small" style="margin-left: 8px">
|
|
|
- {{ t('common.installed') }}
|
|
|
+ {{ t('common.installed') }} v{{ installStore.getInstalledVersion('vscode') }}
|
|
|
</el-tag>
|
|
|
</el-checkbox>
|
|
|
<div v-if="needInstallVscode" class="option-details">
|
|
|
@@ -175,6 +215,28 @@ async function handleCancel() {
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
+ <!-- Claude Code for VS Code 扩展 -->
|
|
|
+ <div class="option-group">
|
|
|
+ <div class="option-row">
|
|
|
+ <el-checkbox
|
|
|
+ :model-value="!claudeCodeExtInstalled && installStore.installOptions.all.installClaudeCodeExt"
|
|
|
+ :disabled="claudeCodeExtInstalled"
|
|
|
+ @update:model-value="installStore.installOptions.all.installClaudeCodeExt = $event"
|
|
|
+ >
|
|
|
+ <span class="software-label">
|
|
|
+ <SoftwareIcon software="vscode" :size="18" />
|
|
|
+ <span>{{ t('software.vscode.claudeCodeExt') }}</span>
|
|
|
+ </span>
|
|
|
+ <el-tag v-if="claudeCodeExtInstalled" type="success" size="small" style="margin-left: 8px">
|
|
|
+ {{ t('common.installed') }}
|
|
|
+ </el-tag>
|
|
|
+ </el-checkbox>
|
|
|
+ <span v-if="needInstallClaudeCodeExt && !installStore.isInstalled('vscode')" class="option-hint">
|
|
|
+ {{ t('software.vscode.installVscodeFirst') }}
|
|
|
+ </span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
<!-- Git -->
|
|
|
<div class="option-group">
|
|
|
<div class="option-row">
|
|
|
@@ -184,7 +246,7 @@ async function handleCancel() {
|
|
|
<span>Git</span>
|
|
|
</span>
|
|
|
<el-tag v-if="installStore.isInstalled('git')" type="success" size="small" style="margin-left: 8px">
|
|
|
- {{ t('common.installed') }}
|
|
|
+ {{ t('common.installed') }} v{{ installStore.getInstalledVersion('git') }}
|
|
|
</el-tag>
|
|
|
</el-checkbox>
|
|
|
<div v-if="needInstallGit" class="option-details">
|
|
|
@@ -209,24 +271,6 @@ async function handleCancel() {
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
|
-
|
|
|
- <!-- Claude Code -->
|
|
|
- <div class="option-group">
|
|
|
- <div class="option-row">
|
|
|
- <el-checkbox :model-value="needInstallClaudeCode" disabled>
|
|
|
- <span class="software-label">
|
|
|
- <SoftwareIcon software="claudeCode" :size="18" />
|
|
|
- <span>Claude Code</span>
|
|
|
- </span>
|
|
|
- <el-tag v-if="installStore.isInstalled('claudeCode')" type="success" size="small" style="margin-left: 8px">
|
|
|
- {{ t('common.installed') }}
|
|
|
- </el-tag>
|
|
|
- </el-checkbox>
|
|
|
- <span v-if="needInstallClaudeCode" class="option-hint">
|
|
|
- {{ t('claudeCode.requiresNodejsGit') }}
|
|
|
- </span>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
</div>
|
|
|
|
|
|
<div class="button-group">
|