File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 5252 </div >
5353
5454 <!-- 状态栏 -->
55- <StatusBar :env-info =" envInfo" :is-loading =" isLoadingEnvInfo" :execution-time =" lastExecutionTime" :code-length =" (code || '').length" />
55+ <StatusBar :env-info =" envInfo" :is-loading =" isLoadingEnvInfo" :execution-time =" lastExecutionTime" :code-length =" (code || '').length" @check-environment = " refreshEnvInfo " />
5656
5757 <!-- 关于组件 -->
5858 <About v-if =" showAbout" @close =" closeAbout" />
@@ -115,6 +115,7 @@ const {
115115 getCurrentConsoleType,
116116 handleLanguageChange,
117117 refreshLanguageList,
118+ refreshEnvInfo,
118119 initialize
119120} = useLanguageManager (code , clearOutput , toast )
120121
Original file line number Diff line number Diff line change 77 :class =" [getIconClass(), { 'animate-spin': isLoading }]"
88 class =" w-4 h-4" />
99 <span >{{ getStatusText() }}</span >
10+ <button @click =" handleCheckEnvironment"
11+ :disabled =" isLoading"
12+ class =" ml-2 p-1 rounded cursor-pointer hover:bg-white/20 disabled:opacity-50 disabled:cursor-not-allowed transition-colors"
13+ title =" 重新检查环境" >
14+ <RefreshCw :class =" { 'animate-spin': isLoading }" class =" w-3.5 h-3.5" />
15+ </button >
1016 </div >
1117
1218 <div v-if =" executionTime > 0" class =" flex items-center space-x-2" >
2531</template >
2632
2733<script setup lang="ts">
28- import { Clock , Hash } from ' lucide-vue-next'
34+ import { Clock , Hash , RefreshCw } from ' lucide-vue-next'
2935import { toRefs } from ' vue'
3036import { useStatusBar } from ' ../composables/useStatusBar'
3137
@@ -41,6 +47,10 @@ const props = defineProps<{
4147 codeLength: number
4248}>()
4349
50+ const emit = defineEmits <{
51+ checkEnvironment: []
52+ }>()
53+
4454const { envInfo, isLoading } = toRefs (props )
4555
4656const {
@@ -49,4 +59,8 @@ const {
4959 getIconClass,
5060 getStatusText
5161} = useStatusBar (envInfo , isLoading )
62+
63+ const handleCheckEnvironment = () => {
64+ emit (' checkEnvironment' )
65+ }
5266 </script >
Original file line number Diff line number Diff line change @@ -203,6 +203,7 @@ export function useLanguageManager(
203203 getLanguageDisplayName,
204204 handleLanguageChange,
205205 refreshLanguageList,
206+ refreshEnvInfo,
206207 initialize,
207208 getCurrentPluginConfig,
208209 getCurrentConsoleType
You can’t perform that action at this time.
0 commit comments