chore: add loading animation

This commit is contained in:
engigu
2026-03-30 17:19:25 +08:00
parent 5df2d6868d
commit 27e144410d
4 changed files with 27 additions and 6 deletions
+9 -2
View File
@@ -18,8 +18,15 @@ onMounted(async () => {
}
})
const isReconnecting = ref(false)
function reconnect() {
isReconnecting.value = true
terminalRef.value?.reconnect()
// Add a slight delay to the animation so it's visible even for fast reconnections
setTimeout(() => {
isReconnecting.value = false
}, 1000)
}
</script>
@@ -52,8 +59,8 @@ function reconnect() {
</Popover>
</div>
<Button variant="ghost" size="icon" class="h-6 w-6 text-gray-400 hover:text-white" @click="reconnect"
title="重新连接">
<RefreshCw class="h-3 w-3" />
:disabled="isReconnecting" title="重新连接">
<RefreshCw class="h-3 w-3" :class="{ 'animate-spin': isReconnecting }" />
</Button>
</div>
<div class="flex-1 border border-[#3c3c3c] border-t-0 rounded-b-md overflow-hidden bg-[#1e1e1e]">