mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-04-30 03:10:16 +08:00
feat(update-center): 实现集中式软件更新中心功能
新增更新中心模块,支持管理 APM 和传统 deb 软件更新任务 - 添加更新任务队列管理、状态跟踪和日志记录功能 - 实现更新项忽略配置持久化存储 - 新增更新确认对话框和迁移提示 - 优化主窗口关闭时的任务保护机制 - 添加单元测试覆盖核心逻辑
This commit is contained in:
47
src/components/update-center/UpdateCenterList.vue
Normal file
47
src/components/update-center/UpdateCenterList.vue
Normal file
@@ -0,0 +1,47 @@
|
||||
<template>
|
||||
<div
|
||||
class="min-h-0 overflow-y-auto border-r border-slate-200/70 p-6 dark:border-slate-800/70"
|
||||
>
|
||||
<div
|
||||
v-if="items.length === 0"
|
||||
class="rounded-2xl border border-dashed border-slate-200/80 px-4 py-10 text-center text-slate-500 dark:border-slate-800/80 dark:text-slate-400"
|
||||
>
|
||||
暂无可展示的更新任务
|
||||
</div>
|
||||
<div v-else class="space-y-3">
|
||||
<UpdateCenterItem
|
||||
v-for="item in items"
|
||||
:key="item.taskKey"
|
||||
:item="item"
|
||||
:task="taskMap.get(item.taskKey)"
|
||||
:selected="selectedTaskKeys.has(item.taskKey)"
|
||||
@toggle-selection="$emit('toggle-selection', item.taskKey)"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed } from "vue";
|
||||
|
||||
import type {
|
||||
UpdateCenterItem as UpdateCenterItemModel,
|
||||
UpdateCenterTaskState,
|
||||
} from "@/global/typedefinition";
|
||||
|
||||
import UpdateCenterItem from "./UpdateCenterItem.vue";
|
||||
|
||||
const props = defineProps<{
|
||||
items: UpdateCenterItemModel[];
|
||||
tasks: UpdateCenterTaskState[];
|
||||
selectedTaskKeys: Set<string>;
|
||||
}>();
|
||||
|
||||
defineEmits<{
|
||||
(e: "toggle-selection", taskKey: string): void;
|
||||
}>();
|
||||
|
||||
const taskMap = computed(() => {
|
||||
return new Map(props.tasks.map((task) => [task.taskKey, task]));
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user