diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 0cc106d54..13aafd597 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -72,6 +72,18 @@ jobs: tag: Prerelease deleteOnlyFromDrafts: false + - name: Set Env + run: | + echo "BUILDTIME=$(TZ=Asia/Shanghai date)" >> $GITHUB_ENV + shell: bash + + - name: Tag Repo + uses: richardsimko/update-tag@v1 + with: + tag_name: Prerelease + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload Prerelease uses: softprops/action-gh-release@v1 with: diff --git a/src/api/configs.ts b/src/api/configs.ts index 26d6779f7..f3f918a25 100644 --- a/src/api/configs.ts +++ b/src/api/configs.ts @@ -8,6 +8,7 @@ const flushFakeIPPoolEndpoint = '/cache/fakeip/flush'; const flushTrafficStatisticEndpoint = '/resetStatistic'; const restartCoreEndpoint = '/restart'; const upgradeCoreEndpoint = '/upgrade'; +const upgradeUIEndpoint = '/upgrade/ui'; export async function fetchConfigs(apiConfig: ClashAPIConfig) { const { url, init } = getURLAndInit(apiConfig); @@ -54,7 +55,7 @@ export async function restartCore(apiConfig: ClashAPIConfig) { export async function upgradeUI(apiConfig: ClashAPIConfig) { const { url, init } = getURLAndInit(apiConfig); - return await fetch(url + upgradeCoreEndpoint, { ...init, method: 'POST' }); + return await fetch(url + upgradeUIEndpoint, { ...init, method: 'POST' }); } export async function upgradeCore(apiConfig: ClashAPIConfig) { diff --git a/src/store/configs.ts b/src/store/configs.ts index 44b091684..4371c7617 100644 --- a/src/store/configs.ts +++ b/src/store/configs.ts @@ -174,12 +174,7 @@ export function upgradeUI(apiConfig: ClashAPIConfig) { if (res.ok === false) { // eslint-disable-next-line no-console console.log('Error upgrade UI', res.statusText); - if (res.status === 500) { - const json = await res.json(); - if ("update error: already using latest version" === json.message) { - notifyError('面板界面已经是最新版本'); - } - } + notifyError('面板界面更新失败'); } else { notifySuccess('面板界面已升级'); }