mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(settings): remove broken web update action
This commit is contained in:
1 parent
8a54568cd4
commit
bc3871c9b1
5 files changed
+8
-45
No files matched your search
@@ -42,8 +42,6 @@ async function toggleAnalytics(enabled: boolean) {
|
||||
}
|
||||
}
|
||||
|
||||
const isUpdating = ref(false)
|
||||
|
||||
async function checkUpdate() {
|
||||
isCheckingUpdate.value = true
|
||||
try {
|
||||
@@ -55,13 +53,7 @@ async function checkUpdate() {
|
||||
} else if (result.hasUpdate) {
|
||||
toast.success(t('settings.about.newVersionAvailable', { version: result.latestVersion }), {
|
||||
duration: 15_000,
|
||||
actions: [
|
||||
{
|
||||
label: t('settings.about.updateNow'),
|
||||
icon: 'i-heroicons-arrow-down-tray',
|
||||
onClick: () => performUpdate(),
|
||||
},
|
||||
],
|
||||
description: IS_ELECTRON ? undefined : t('settings.about.webUpdateHint'),
|
||||
})
|
||||
} else {
|
||||
toast.success(t('settings.about.upToDate'))
|
||||
@@ -79,23 +71,6 @@ async function checkUpdate() {
|
||||
}
|
||||
}
|
||||
|
||||
async function performUpdate() {
|
||||
isUpdating.value = true
|
||||
toast.info(t('settings.about.updating'))
|
||||
try {
|
||||
const result = await usePlatformService().performUpdate()
|
||||
if (result.success) {
|
||||
toast.success(t('settings.about.updateSuccess'), { duration: 60_000 })
|
||||
} else {
|
||||
toast.fail(t('settings.about.updateFailed', { error: result.error || '' }))
|
||||
}
|
||||
} catch (error) {
|
||||
toast.fail(t('settings.about.updateFailed', { error: String(error) }))
|
||||
} finally {
|
||||
isUpdating.value = false
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
loadAppVersion()
|
||||
loadAnalyticsEnabled()
|
||||
@@ -124,25 +99,9 @@ onMounted(() => {
|
||||
<p class="mt-1 text-xs text-gray-400">{{ t('settings.about.version') }} {{ appVersion }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<UButton
|
||||
:disabled="isCheckingUpdate || isUpdating"
|
||||
color="primary"
|
||||
variant="soft"
|
||||
size="sm"
|
||||
@click="checkUpdate"
|
||||
>
|
||||
<UIcon
|
||||
name="i-heroicons-arrow-path"
|
||||
class="mr-1 h-4 w-4"
|
||||
:class="{ 'animate-spin': isCheckingUpdate || isUpdating }"
|
||||
/>
|
||||
{{
|
||||
isUpdating
|
||||
? t('settings.about.updating')
|
||||
: isCheckingUpdate
|
||||
? t('settings.about.checking')
|
||||
: t('settings.about.checkUpdate')
|
||||
}}
|
||||
<UButton :disabled="isCheckingUpdate" color="primary" variant="soft" size="sm" @click="checkUpdate">
|
||||
<UIcon name="i-heroicons-arrow-path" class="mr-1 h-4 w-4" :class="{ 'animate-spin': isCheckingUpdate }" />
|
||||
{{ isCheckingUpdate ? t('settings.about.checking') : t('settings.about.checkUpdate') }}
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -379,6 +379,7 @@
|
||||
"upToDate": "You are up to date",
|
||||
"newVersionAvailable": "New version {version} available",
|
||||
"updateNow": "Update Now",
|
||||
"webUpdateHint": "Run npm install -g chatlab-cli@latest in your terminal, then restart the service.",
|
||||
"updating": "Updating...",
|
||||
"updateSuccess": "Update successful, please restart the service to apply",
|
||||
"updateFailed": "Update failed: {error}",
|
||||
|
||||
@@ -379,6 +379,7 @@
|
||||
"upToDate": "最新バージョンです",
|
||||
"newVersionAvailable": "新しいバージョン {version} があります",
|
||||
"updateNow": "今すぐ更新",
|
||||
"webUpdateHint": "ターミナルで npm install -g chatlab-cli@latest を実行し、サービスを再起動してください。",
|
||||
"updating": "更新中...",
|
||||
"updateSuccess": "更新が完了しました。サービスを再起動してください",
|
||||
"updateFailed": "更新に失敗しました:{error}",
|
||||
|
||||
@@ -379,6 +379,7 @@
|
||||
"upToDate": "已是最新版本",
|
||||
"newVersionAvailable": "发现新版本 {version}",
|
||||
"updateNow": "立即更新",
|
||||
"webUpdateHint": "请在终端运行 npm install -g chatlab-cli@latest 后重启服务。",
|
||||
"updating": "更新中...",
|
||||
"updateSuccess": "更新成功,请重启服务以生效",
|
||||
"updateFailed": "更新失败:{error}",
|
||||
|
||||
@@ -379,6 +379,7 @@
|
||||
"upToDate": "已是最新版本",
|
||||
"newVersionAvailable": "發現新版本 {version}",
|
||||
"updateNow": "立即更新",
|
||||
"webUpdateHint": "請在終端機執行 npm install -g chatlab-cli@latest 後重啟服務。",
|
||||
"updating": "更新中...",
|
||||
"updateSuccess": "更新成功,請重啟服務以生效",
|
||||
"updateFailed": "更新失敗:{error}",
|
||||
|
||||
Reference in new issue
Block a user