update:添加apm与普通商店双支持

This commit is contained in:
2026-03-11 08:36:24 +08:00
parent 8f2c758bf5
commit edd9368c56
11 changed files with 12218 additions and 128 deletions

View File

@@ -1,5 +1,5 @@
import { ref } from "vue";
import type { App } from "./typedefinition";
import type { App, StoreMode } from "./typedefinition";
export const APM_STORE_BASE_URL: string =
import.meta.env.VITE_APM_STORE_BASE_URL || "";
@@ -10,3 +10,14 @@ export const APM_STORE_STATS_BASE_URL: string =
// 下面的变量用于存储当前应用的信息,其实用在多个组件中
export const currentApp = ref<App | null>(null);
export const currentAppIsInstalled = ref(false);
const initialMode = (localStorage.getItem("store_mode") as StoreMode) || "hybrid";
export const currentStoreMode = ref<StoreMode>(initialMode);
declare global {
interface Window {
apm_store: {
arch: string;
};
}
}

View File

@@ -23,6 +23,8 @@ export type DownloadItemStatus =
| "failed"
| "queued"; // 可根据实际状态扩展
export type StoreMode = "spark" | "apm" | "hybrid";
export interface DownloadItem {
id: number;
name: string;
@@ -42,6 +44,7 @@ export interface DownloadItem {
message: string; // 日志消息
}>;
source: string; // 例如 'APM Store'
origin: "spark" | "apm"; // 数据来源
retry: boolean; // 当前是否为重试下载
upgradeOnly?: boolean; // 是否为仅升级任务
error?: string;
@@ -99,6 +102,7 @@ export interface App {
img_urls: string[];
icons: string;
category: string; // Frontend added
origin: "spark" | "apm"; // 数据来源
installed?: boolean; // Frontend state
flags?: string; // Tags in apm packages manager, e.g. "automatic" for dependencies
arch?: string; // Architecture, e.g. "amd64", "arm64"