diff --git a/electron/main/backend/submitter.ts b/electron/main/backend/submitter.ts
index 28c96e5f..c3720688 100644
--- a/electron/main/backend/submitter.ts
+++ b/electron/main/backend/submitter.ts
@@ -1,4 +1,4 @@
-import { type BrowserWindow, dialog, ipcMain, shell } from "electron";
+import { BrowserWindow, dialog, ipcMain, shell } from "electron";
import path from "node:path";
import fs from "node:fs";
import os from "node:os";
@@ -462,13 +462,12 @@ export function registerSubmitterHandlers(
return { success: true };
}
- const BrowserWindowClass = (await import("electron")).BrowserWindow;
-
- const newWin = new BrowserWindowClass({
+ const newWin = new BrowserWindow({
title: "星火应用商店 - 投稿应用",
width: 800,
height: 900,
frame: false,
+ show: false,
autoHideMenuBar: true,
icon: path.join(process.env.VITE_PUBLIC!, "favicon.ico"),
webPreferences: {
@@ -482,6 +481,11 @@ export function registerSubmitterHandlers(
newWin.loadFile(indexHtml, { hash: "submitter" });
}
+ newWin.once("ready-to-show", () => {
+ newWin.show();
+ newWin.focus();
+ });
+
newWin.on("closed", () => {
setSubmitterWin(null);
});
diff --git a/src/components/SubmitterWindow.vue b/src/components/SubmitterWindow.vue
index 32537105..288fc212 100644
--- a/src/components/SubmitterWindow.vue
+++ b/src/components/SubmitterWindow.vue
@@ -271,6 +271,19 @@
+
+
+
+
+
+
+
+
+
+
+
+
+ 选择数据源
+
+
+
+
+
+ 请选择搜索历史信息的数据源:
+
+
+
+
+
+ 镜像源
+
+
+ mirrors.sdu.edu.cn - 建议在中国内地使用以获得更好的网络体验
+
+
+
+
+ 主站
+
+
+ spk-json.spark-app.store - 全球可用
+
+
+
+
+
+
+
+
+
+
+
@@ -546,6 +630,7 @@ const formData = reactive({
description: "",
tags: "",
category: "",
+ remark: "",
});
const isSubmitting = ref(false);
@@ -557,6 +642,7 @@ const showArchDialog = ref(false);
const availableArchs = ref([]);
const currentDebArch = ref("");
const iconPreview = ref("");
+const showMirrorConfirmDialog = ref(false);
const isPackaging = ref(false);
const packageSuccess = ref(false);
@@ -843,12 +929,150 @@ const selectDebFile = async () => {
};
const useMirror = ref(false);
+let pendingSearchHistory = false;
const selectMirrorSource = () => {
- const useMirrorSource = window.confirm(
- "是否使用镜像源搜索历史信息?\n\n镜像源:mirrors.sdu.edu.cn\n主站:spk-json.spark-app.store\n\n建议在中国内地使用镜像源以获得更好的网络体验。",
- );
+ showMirrorConfirmDialog.value = true;
+};
+
+const confirmMirrorSource = async (useMirrorSource: boolean) => {
useMirror.value = useMirrorSource;
+ showMirrorConfirmDialog.value = false;
+
+ if (pendingSearchHistory && formData.pkgname) {
+ pendingSearchHistory = false;
+ await searchHistoryApp();
+ }
+};
+
+const searchHistoryApp = async () => {
+ console.log(
+ "[Submitter] ============== SEARCHING HISTORY INFO ==============",
+ );
+ console.log(
+ "[Submitter] pkgname is not empty, searching history with:",
+ formData.pkgname,
+ );
+ console.log("[Submitter] Using mirror:", useMirror.value);
+
+ console.log(
+ "[Submitter] Calling IPC: search-history-app with pkgname:",
+ formData.pkgname,
+ );
+ const historyResult = await window.ipcRenderer.invoke(
+ "search-history-app",
+ formData.pkgname,
+ useMirror.value,
+ );
+ console.log(
+ "[Submitter] Received history search response:",
+ JSON.stringify(historyResult, null, 2),
+ );
+
+ if (
+ historyResult?.success &&
+ historyResult.data &&
+ historyResult.data.length > 0
+ ) {
+ console.log(
+ "[Submitter] ============== HISTORY INFO FOUND ==============",
+ );
+ console.log(
+ "[Submitter] History info count:",
+ historyResult.data.length,
+ );
+ console.log(
+ "[Submitter] Available archs data:",
+ JSON.stringify(historyResult.data, null, 2),
+ );
+
+ console.log(
+ "[Submitter] ============== BEFORE SETTING STATE ==============",
+ );
+ console.log(
+ "[Submitter] availableArchs before:",
+ availableArchs.value,
+ );
+ console.log(
+ "[Submitter] showArchDialog before:",
+ showArchDialog.value,
+ );
+
+ availableArchs.value = historyResult.data;
+ console.log(
+ "[Submitter] availableArchs after:",
+ availableArchs.value,
+ );
+ console.log(
+ "[Submitter] availableArchs length:",
+ availableArchs.value.length,
+ );
+
+ showArchDialog.value = true;
+ console.log(
+ "[Submitter] showArchDialog after:",
+ showArchDialog.value,
+ );
+
+ console.log(
+ "[Submitter] ============== DIALOG SHOULD BE SHOWING ==============",
+ );
+ console.log("[Submitter] Dialog visibility:", showArchDialog.value);
+ console.log(
+ "[Submitter] Available architectures to display:",
+ availableArchs.value.map((a) => a.store),
+ );
+
+ nextTick(() => {
+ console.log(
+ "[Submitter] ============== AFTER NEXT TICK ==============",
+ );
+ console.log(
+ "[Submitter] showArchDialog in nextTick:",
+ showArchDialog.value,
+ );
+ console.log(
+ "[Submitter] availableArchs in nextTick:",
+ availableArchs.value,
+ );
+
+ const dialogElement = document.querySelector(
+ "[data-submitter-arch-dialog]",
+ );
+ console.log("[Submitter] Dialog element found:", !!dialogElement);
+ if (dialogElement) {
+ console.log("[Submitter] Dialog element:", dialogElement);
+ console.log(
+ "[Submitter] Dialog element style:",
+ window.getComputedStyle(dialogElement),
+ );
+ }
+ });
+ } else {
+ console.log(
+ "[Submitter] ============== NO HISTORY INFO FOUND ==============",
+ );
+ console.log(
+ "[Submitter] historyResult.success:",
+ historyResult?.success,
+ );
+ console.log("[Submitter] historyResult.data:", historyResult?.data);
+ console.log(
+ "[Submitter] historyResult.data.length:",
+ historyResult?.data?.length,
+ );
+
+ if (historyResult?.success === true && historyResult.data) {
+ console.log("[Submitter] Success is true but no data found");
+ console.log("[Submitter] Data is:", historyResult.data);
+ console.log("[Submitter] Data type:", typeof historyResult.data);
+ } else if (!historyResult?.success) {
+ console.log(
+ "[Submitter] Search failed with message:",
+ historyResult?.message,
+ );
+ }
+ }
};
const parseDebFileAndSearchHistory = async (debPath: string) => {
@@ -902,139 +1126,9 @@ const parseDebFileAndSearchHistory = async (debPath: string) => {
JSON.stringify(formData, null, 2),
);
- selectMirrorSource();
- console.log("[Submitter] Mirror source selected:", useMirror.value);
-
if (formData.pkgname) {
- console.log(
- "[Submitter] ============== SEARCHING HISTORY INFO ==============",
- );
- console.log(
- "[Submitter] pkgname is not empty, searching history with:",
- formData.pkgname,
- );
- console.log("[Submitter] Using mirror:", useMirror.value);
-
- console.log(
- "[Submitter] Calling IPC: search-history-app with pkgname:",
- formData.pkgname,
- );
- const historyResult = await window.ipcRenderer.invoke(
- "search-history-app",
- formData.pkgname,
- useMirror.value,
- );
- console.log(
- "[Submitter] Received history search response:",
- JSON.stringify(historyResult, null, 2),
- );
-
- if (
- historyResult?.success &&
- historyResult.data &&
- historyResult.data.length > 0
- ) {
- console.log(
- "[Submitter] ============== HISTORY INFO FOUND ==============",
- );
- console.log(
- "[Submitter] History info count:",
- historyResult.data.length,
- );
- console.log(
- "[Submitter] Available archs data:",
- JSON.stringify(historyResult.data, null, 2),
- );
-
- console.log(
- "[Submitter] ============== BEFORE SETTING STATE ==============",
- );
- console.log(
- "[Submitter] availableArchs before:",
- availableArchs.value,
- );
- console.log(
- "[Submitter] showArchDialog before:",
- showArchDialog.value,
- );
-
- availableArchs.value = historyResult.data;
- console.log(
- "[Submitter] availableArchs after:",
- availableArchs.value,
- );
- console.log(
- "[Submitter] availableArchs length:",
- availableArchs.value.length,
- );
-
- showArchDialog.value = true;
- console.log(
- "[Submitter] showArchDialog after:",
- showArchDialog.value,
- );
-
- console.log(
- "[Submitter] ============== DIALOG SHOULD BE SHOWING ==============",
- );
- console.log("[Submitter] Dialog visibility:", showArchDialog.value);
- console.log(
- "[Submitter] Available architectures to display:",
- availableArchs.value.map((a) => a.store),
- );
-
- nextTick(() => {
- console.log(
- "[Submitter] ============== AFTER NEXT TICK ==============",
- );
- console.log(
- "[Submitter] showArchDialog in nextTick:",
- showArchDialog.value,
- );
- console.log(
- "[Submitter] availableArchs in nextTick:",
- availableArchs.value,
- );
-
- const dialogElement = document.querySelector(
- "[data-submitter-arch-dialog]",
- );
- console.log("[Submitter] Dialog element found:", !!dialogElement);
- if (dialogElement) {
- console.log("[Submitter] Dialog element:", dialogElement);
- console.log(
- "[Submitter] Dialog element style:",
- window.getComputedStyle(dialogElement),
- );
- }
- });
- } else {
- console.log(
- "[Submitter] ============== NO HISTORY INFO FOUND ==============",
- );
- console.log(
- "[Submitter] historyResult.success:",
- historyResult?.success,
- );
- console.log("[Submitter] historyResult.data:", historyResult?.data);
- console.log(
- "[Submitter] historyResult.data.length:",
- historyResult?.data?.length,
- );
-
- if (historyResult?.success === true && historyResult.data) {
- console.log("[Submitter] Success is true but no data found");
- console.log("[Submitter] Data is:", historyResult.data);
- console.log("[Submitter] Data type:", typeof historyResult.data);
- } else if (!historyResult?.success) {
- console.log(
- "[Submitter] Search failed with message:",
- historyResult?.message,
- );
- }
- }
- } else {
- console.log("[Submitter] pkgname is empty, skipping history search");
+ pendingSearchHistory = true;
+ selectMirrorSource();
}
} else {
console.error("[Submitter] Failed to parse deb file");
@@ -1126,6 +1220,7 @@ const handleDrop = async (event: DragEvent) => {
};
const selectArch = (arch: HistoryArchInfo) => {
+ showArchDialog.value = false;
console.log("[Submitter] selectArch called with:", arch);
formData.name = arch.name || formData.name;
@@ -1260,6 +1355,7 @@ const resetForm = () => {
formData.description = "";
formData.tags = "";
formData.category = "";
+ formData.remark = "";
submitSuccess.value = false;
submitError.value = "";
debParseError.value = "";
@@ -1289,6 +1385,7 @@ const submitForm = async () => {
description: formData.description,
tags: formData.tags,
category: formData.category,
+ remark: formData.remark,
};
console.log("[Submitter] ============== SUBMIT FORM ==============");
@@ -1344,6 +1441,7 @@ const packageApp = async (storeArch: string) => {
description: formData.description,
tags: formData.tags,
category: formData.category,
+ remark: formData.remark,
storeArch,
};