feat: add panel self-upgrade workflow (#492)

This commit is contained in:
sagit
2026-05-06 17:58:01 +08:00
committed by GitHub
parent 6c93d829c6
commit 5ebd4c2a91
11 changed files with 1410 additions and 10 deletions
+21
View File
@@ -42,6 +42,9 @@ import type {
MonitorAccessApiData,
TunnelQualityApiItem,
StorageSummaryApiData,
SystemUpgradeCheckApiData,
SystemUpgradeRunApiData,
SystemUpgradeVersionApiData,
} from "./types";
import axios from "axios";
@@ -258,6 +261,24 @@ export const updateConfig = (name: string, value: string) =>
export const getStorageSummary = () =>
Network.get<StorageSummaryApiData>("/system/storage");
export const getSystemUpgradeVersion = () =>
Network.post<SystemUpgradeVersionApiData>("/system/version");
export const checkSystemUpgrade = (channel: ReleaseChannel = "stable") =>
Network.post<SystemUpgradeCheckApiData>("/system/check-updates", {
channel,
});
export const runSystemUpgrade = (
version?: string,
channel: ReleaseChannel = "stable",
) =>
Network.post<SystemUpgradeRunApiData>(
"/system/upgrade",
{ version: version || "", channel },
{ timeout: 60 * 1000 },
);
export const activateLicense = (licenseKey: string) =>
Network.post("/license/activate", { license_key: licenseKey });