Skip to content

Commit c9fc72f

Browse files
committed
fix: add connecting status message and enhance browser connection handling
1 parent e7991d6 commit c9fc72f

File tree

4 files changed

+24
-21
lines changed

4 files changed

+24
-21
lines changed

ui/app/pages/StatusPage.vue

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,7 @@
1515
style="position: fixed; right: 20px; bottom: 20px; z-index: 999"
1616
>
1717
<div class="floating-actions">
18-
<button
19-
class="floating-btn lang-switcher"
20-
:title="t('switchLanguage')"
21-
:disabled="isBusy"
22-
@click="toggleLanguage"
23-
>
18+
<button class="floating-btn lang-switcher" :title="t('switchLanguage')" @click="toggleLanguage">
2419
<svg
2520
xmlns="http://www.w3.org/2000/svg"
2621
width="24"
@@ -40,12 +35,7 @@
4035
<path d="M14 18h6" />
4136
</svg>
4237
</button>
43-
<button
44-
class="floating-btn logout-button"
45-
:title="t('logout')"
46-
:disabled="isBusy"
47-
@click="handleLogout"
48-
>
38+
<button class="floating-btn logout-button" :title="t('logout')" @click="handleLogout">
4939
<svg
5040
xmlns="http://www.w3.org/2000/svg"
5141
width="24"
@@ -66,12 +56,7 @@
6656
</el-affix>
6757

6858
<div class="status-container">
69-
<button
70-
class="desktop-btn lang-switcher"
71-
:title="t('switchLanguage')"
72-
:disabled="isBusy"
73-
@click="toggleLanguage"
74-
>
59+
<button class="desktop-btn lang-switcher" :title="t('switchLanguage')" @click="toggleLanguage">
7560
<svg
7661
xmlns="http://www.w3.org/2000/svg"
7762
width="24"
@@ -91,7 +76,7 @@
9176
<path d="M14 18h6" />
9277
</svg>
9378
</button>
94-
<button class="desktop-btn logout-button" :title="t('logout')" :disabled="isBusy" @click="handleLogout">
79+
<button class="desktop-btn logout-button" :title="t('logout')" @click="handleLogout">
9580
<svg
9681
xmlns="http://www.w3.org/2000/svg"
9782
width="24"
@@ -304,9 +289,19 @@ const apiKeySourceText = computed(() => {
304289
return translated === key ? state.apiKeySource : translated || state.apiKeySource;
305290
});
306291
307-
const browserConnectedClass = computed(() => (state.browserConnected ? "status-ok" : "status-error"));
292+
const browserConnectedClass = computed(() => {
293+
if (state.isSystemBusy) {
294+
return "status-warning";
295+
}
296+
return state.browserConnected ? "status-ok" : "status-error";
297+
});
308298
309-
const browserConnectedText = computed(() => (state.browserConnected ? t("running") : t("disconnected")));
299+
const browserConnectedText = computed(() => {
300+
if (state.isSystemBusy) {
301+
return t("connecting");
302+
}
303+
return state.browserConnected ? t("running") : t("disconnected");
304+
});
310305
311306
const currentAccountName = computed(() => {
312307
if (state.currentAuthIndex < 0) {
@@ -735,6 +730,11 @@ pre {
735730
font-weight: bold;
736731
}
737732
733+
.status-warning {
734+
color: @warning-color;
735+
font-weight: bold;
736+
}
737+
738738
.status-error {
739739
color: @error-color;
740740
font-weight: bold;

ui/app/styles/variables.less

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414

1515
// Status colors
1616
@success-color: #2ecc71;
17+
@warning-color: #f39c12;
1718
@error-color: #e74c3c;
1819

1920
// Neutral colors

ui/locales/en.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"cancel": "Cancel",
5555
"confirmDelete": "Are you sure you want to delete account",
5656
"confirmSwitch": "Are you sure you want to switch to account",
57+
"connecting": "Connecting",
5758
"consecutiveFailures": "Consecutive Failures",
5859
"currentAccount": "Current Active Account",
5960
"custom": "Custom",

ui/locales/zh.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
"cancel": "取消",
5555
"confirmDelete": "确定要删除账号",
5656
"confirmSwitch": "确定要切换到账号",
57+
"connecting": "连接中",
5758
"consecutiveFailures": "连续失败次数",
5859
"currentAccount": "当前活跃账号",
5960
"custom": "自定义",

0 commit comments

Comments
 (0)