新增投稿器

Signed-off-by: gfdgd_xi <3025613752@qq.com>
This commit is contained in:
2026-06-16 11:53:46 +08:00
parent 3847463b6e
commit 3aa96f27c7
8 changed files with 1884 additions and 19 deletions
+26
View File
@@ -1,5 +1,7 @@
<template>
<SubmitterWindow v-if="isSubmitterView" />
<div
v-else
class="flex min-h-screen flex-col bg-slate-50 text-slate-900 transition-colors duration-300 dark:bg-slate-950 dark:text-slate-100"
>
<WindowTitleBar />
@@ -33,6 +35,7 @@
@close="isSidebarOpen = false"
@list="handleList"
@update="handleUpdate"
@submit="handleSubmit"
@request-login="showLoginModal = true"
@open-user-management="openUserManagement"
@open-favorites="openFavoriteManagement"
@@ -304,6 +307,7 @@ import FavoriteFolderManager from "./components/FavoriteFolderManager.vue";
import UserManagementModal from "./components/UserManagementModal.vue";
import ReviewUserProfileModal from "./components/ReviewUserProfileModal.vue";
import WindowTitleBar from "./components/WindowTitleBar.vue";
import SubmitterWindow from "./components/SubmitterWindow.vue";
import {
APM_STORE_BASE_URL,
FLARUM_BASE_URL,
@@ -434,6 +438,8 @@ const isDarkTheme = computed(() => {
return themeMode.value === "dark";
});
const isSubmitterView = ref(false);
const categories: Ref<Record<string, CategoryInfo>> = ref({});
const apps: Ref<App[]> = ref([]);
const tabCategories: Ref<Record<string, Record<string, CategoryInfo>>> = ref(
@@ -1151,6 +1157,19 @@ const handleList = () => {
openInstalledModal();
};
const handleSubmit = async () => {
try {
const result = await window.ipcRenderer.invoke("launch-submitter");
if (!result?.success) {
logger.error(
"Failed to launch submitter: " + (result?.message || "unknown error"),
);
}
} catch (error) {
logger.error(`Failed to launch submitter: ${error}`);
}
};
const openUpdateModal = async () => {
try {
if (!effectiveStoreFilter.value) {
@@ -2551,6 +2570,13 @@ onMounted(async () => {
initTheme();
updateCenterStore.bind();
const handleHashChange = () => {
isSubmitterView.value = window.location.hash === "#submitter";
};
handleHashChange();
window.addEventListener("hashchange", handleHashChange);
try {
systemInfo.value = await window.ipcRenderer.invoke("get-system-info");
} catch (error: unknown) {
+12 -2
View File
@@ -123,6 +123,14 @@
<span class="sidebar-tab-icon"><i class="fas fa-sync-alt"></i></span>
<span class="sidebar-tab-label">软件更新</span>
</button>
<button
type="button"
class="sidebar-tab"
@click="emitSidebarAction('submit')"
>
<span class="sidebar-tab-icon"><i class="fas fa-upload"></i></span>
<span class="sidebar-tab-label">投稿应用</span>
</button>
</div>
</div>
</template>
@@ -152,6 +160,7 @@ const emit = defineEmits<{
(e: "close"): void;
(e: "list"): void;
(e: "update"): void;
(e: "submit"): void;
(e: "request-login"): void;
(e: "open-user-management"): void;
(e: "open-favorites"): void;
@@ -227,10 +236,11 @@ const selectTab = (tab: string) => {
emit("select-tab", tab);
};
const emitSidebarAction = (action: "list" | "update") => {
const emitSidebarAction = (action: "list" | "update" | "submit") => {
showAccountMenu.value = false;
if (action === "list") emit("list");
else emit("update");
else if (action === "update") emit("update");
else emit("submit");
};
</script>
+3 -1
View File
@@ -115,7 +115,9 @@
<div v-if="lists.length > 0" class="space-y-6 mt-6">
<section v-for="section in lists" :key="section.title">
<div class="flex items-center justify-between">
<h3 class="text-lg font-semibold text-slate-900 dark:text-slate-200">
<h3
class="text-lg font-semibold text-slate-900 dark:text-slate-200"
>
{{ section.title }}
</h3>
</div>
File diff suppressed because it is too large Load Diff