mirror of
https://gitee.com/spark-store-project/spark-store
synced 2026-09-20 21:50:11 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cfe8c87fea | ||
|
|
4c44ecf9b1 | ||
|
|
ae19c309df | ||
|
|
405a402432 | ||
|
|
2db91252ad | ||
|
|
86895269c3 |
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
spark-store (5.3.0.2) UNRELEASED; urgency=medium
|
||||
spark-store (5.3.1) UNRELEASED; urgency=medium
|
||||
|
||||
* Initial release.
|
||||
|
||||
|
||||
+4
-12
@@ -506,21 +506,13 @@ async function createWindow() {
|
||||
logger.info("Renderer process is ready.");
|
||||
});
|
||||
|
||||
// 仅允许可信域名的 https 链接通过浏览器打开,避免钓鱼/恶意站。
|
||||
// 协议前缀 + 域名后缀白名单双重校验;非法/无效 URL 一律拒绝。
|
||||
const ALLOWED_EXTERNAL_HOSTS = [
|
||||
"spark-app.store",
|
||||
"gitee.com",
|
||||
"bbs.spark-app.store",
|
||||
"spark-app.cn",
|
||||
];
|
||||
// 外部链接统一交给系统默认浏览器打开。
|
||||
// 仅限制协议为 http/https,避免 file:/javascript: 等危险协议被打开;
|
||||
// 不再限制域名,保证应用官网与首页推荐的任意链接均可正常访问。
|
||||
mainWindow.webContents.setWindowOpenHandler(({ url }) => {
|
||||
try {
|
||||
const parsed = new URL(url);
|
||||
if (
|
||||
parsed.protocol === "https:" &&
|
||||
ALLOWED_EXTERNAL_HOSTS.some((h) => parsed.hostname === h || parsed.hostname.endsWith(`.${h}`))
|
||||
) {
|
||||
if (parsed.protocol === "http:" || parsed.protocol === "https:") {
|
||||
shell.openExternal(url);
|
||||
}
|
||||
} catch {
|
||||
|
||||
+10
-30
@@ -1,34 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# 显示进度条并执行命令(支持 garma / zenity)
|
||||
# 显示进度条并执行命令(使用 zenity)
|
||||
run_with_progress() {
|
||||
local title="$1"
|
||||
local text="$2"
|
||||
local cmd="$3"
|
||||
|
||||
# 检测可用的对话框工具
|
||||
local tool=""
|
||||
if command -v garma &> /dev/null; then
|
||||
tool="garma"
|
||||
elif command -v zenity &> /dev/null; then
|
||||
tool="zenity"
|
||||
else
|
||||
echo "警告:未找到 garma 或 zenity,无法显示进度条。直接执行命令..." >&2
|
||||
if ! command -v zenity &> /dev/null; then
|
||||
echo "警告:未找到 zenity,无法显示进度条。直接执行命令..." >&2
|
||||
eval "$cmd"
|
||||
return $?
|
||||
fi
|
||||
|
||||
# 根据工具启动进度条
|
||||
# 启动 zenity 进度条
|
||||
local progress_pid
|
||||
if [[ "$tool" == "garma" ]]; then
|
||||
# garma 的进度条用法(假设 --progress --pulsate 可用)
|
||||
garma --progress --pulsate --title="$title" --text="$text" --no-cancel 2>/dev/null &
|
||||
progress_pid=$!
|
||||
else
|
||||
# zenity 进度条 pulsate 模式
|
||||
zenity --progress --pulsate --title="$title" --text="$text" --no-cancel 2>/dev/null &
|
||||
progress_pid=$!
|
||||
fi
|
||||
|
||||
# 执行实际命令
|
||||
eval "$cmd"
|
||||
@@ -120,17 +108,13 @@ case "$command_type" in
|
||||
title="确认卸载"
|
||||
text="正在准备卸载: $packages\n\n若这是您下达的卸载指令,请选择确认继续卸载"
|
||||
|
||||
# 优先尝试 garma,其次 zenity
|
||||
if command -v garma &> /dev/null; then
|
||||
garma --question --title="$title" --text="$text" \
|
||||
--ok-label="确认卸载" --cancel-label="取消" --width=400
|
||||
confirmed=$?
|
||||
elif command -v zenity &> /dev/null; then
|
||||
# 使用 zenity 确认
|
||||
if command -v zenity &> /dev/null; then
|
||||
zenity --question --title="$title" --text="$text" \
|
||||
--ok-label="确认卸载" --cancel-label="取消" --width=400
|
||||
confirmed=$?
|
||||
else
|
||||
echo "错误:未找到 garma 或 zenity,无法显示确认对话框。卸载操作已拒绝。"
|
||||
echo "错误:未找到 zenity,无法显示确认对话框。卸载操作已拒绝。"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -148,17 +132,13 @@ case "$command_type" in
|
||||
title="确认安装"
|
||||
text="正在准备安装: $packages\n\n若这是您下达的安装指令,请选择确认继续安装"
|
||||
|
||||
# 优先尝试 garma,其次 zenity
|
||||
if command -v garma &> /dev/null; then
|
||||
garma --question --title="$title" --text="$text" \
|
||||
--ok-label="确认安装" --cancel-label="取消" --width=400
|
||||
confirmed=$?
|
||||
elif command -v zenity &> /dev/null; then
|
||||
# 使用 zenity 确认
|
||||
if command -v zenity &> /dev/null; then
|
||||
zenity --question --title="$title" --text="$text" \
|
||||
--ok-label="确认安装" --cancel-label="取消" --width=400
|
||||
confirmed=$?
|
||||
else
|
||||
echo "错误:未找到 garma 或 zenity,无法显示确认对话框。安装操作已拒绝。"
|
||||
echo "错误:未找到 zenity,无法显示确认对话框。安装操作已拒绝。"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "spark-store",
|
||||
"version": "5.3.0",
|
||||
"version": "5.3.1",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "spark-store",
|
||||
"version": "5.3.0",
|
||||
"version": "5.3.1",
|
||||
"license": "GPL-3.0",
|
||||
"dependencies": {
|
||||
"@tailwindcss/vite": "^4.1.18",
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "spark-store",
|
||||
"version": "5.3.0",
|
||||
"version": "5.3.1",
|
||||
"main": "dist-electron/main/index.js",
|
||||
"description": "Client for Spark App Store",
|
||||
"author": "elysia-best <elysia-best@simplelinux.cn.eu.org>",
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
class="flex flex-1 flex-col items-center justify-center text-slate-500 dark:text-slate-400"
|
||||
>
|
||||
<i class="fas fa-spinner fa-spin text-2xl mb-3"></i>
|
||||
<span class="text-sm">正在加载首页内容…</span>
|
||||
<span class="text-base">正在加载首页内容…</span>
|
||||
</div>
|
||||
<div
|
||||
v-else-if="error"
|
||||
@@ -37,14 +37,14 @@
|
||||
alt="星火应用商店"
|
||||
class="h-32 w-32 mb-6 opacity-90"
|
||||
/>
|
||||
<h1 class="text-sm font-bold text-slate-800 dark:text-slate-200 mb-2">
|
||||
<h1 class="text-2xl font-bold text-slate-800 dark:text-slate-200 mb-2">
|
||||
{{
|
||||
storeFilter === "apm"
|
||||
? "欢迎来到星火应用商店 (Amber PM)"
|
||||
: "欢迎来到星火应用商店"
|
||||
}}
|
||||
</h1>
|
||||
<p class="text-sm text-slate-500 dark:text-slate-400">
|
||||
<p class="text-base text-slate-500 dark:text-slate-400">
|
||||
{{
|
||||
storeFilter === "apm"
|
||||
? "探索丰富的应用,发现更多精彩内容"
|
||||
@@ -57,12 +57,12 @@
|
||||
<!-- ============ 区域1 · 精选(两行网格 4×2,静态不滚动) ============ -->
|
||||
<section class="shrink-0">
|
||||
<div class="mb-4">
|
||||
<h1 class="text-sm font-bold text-slate-800 dark:text-slate-200">
|
||||
<h1 class="text-2xl font-bold text-slate-800 dark:text-slate-200">
|
||||
{{
|
||||
storeFilter === "apm" ? "星火应用商店 (Amber PM)" : "星火应用商店"
|
||||
}}
|
||||
</h1>
|
||||
<p class="text-sm text-slate-500 dark:text-slate-400 mt-0.5">
|
||||
<p class="text-base text-slate-500 dark:text-slate-400 mt-0.5">
|
||||
探索丰富的应用,发现更多精彩内容
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -19,9 +19,12 @@
|
||||
alt="星火应用商店"
|
||||
/>
|
||||
<span class="truncate text-base font-semibold">星火应用商店</span>
|
||||
<span
|
||||
class="rounded-full border border-orange-400 bg-orange-50 px-2 py-0.5 text-[10px] font-semibold text-orange-600 dark:border-amber-400/70 dark:bg-amber-400/10 dark:text-amber-300 dark:shadow-[0_0_8px_rgba(251,191,36,0.4)]"
|
||||
>社区版</span
|
||||
<button
|
||||
type="button"
|
||||
class="cursor-pointer rounded-full border border-orange-400 bg-orange-50 px-2 py-0.5 text-[10px] font-semibold text-orange-600 transition hover:bg-orange-100 dark:border-amber-400/70 dark:bg-amber-400/10 dark:text-amber-300 dark:shadow-[0_0_8px_rgba(251,191,36,0.4)] dark:hover:bg-amber-400/20"
|
||||
title="了解星火专业版"
|
||||
@click="openCommercial"
|
||||
>社区版</button
|
||||
>
|
||||
</div>
|
||||
|
||||
@@ -75,7 +78,7 @@
|
||||
<div class="mx-1 h-6 w-px bg-slate-300/70 dark:bg-slate-700/70"></div>
|
||||
<button
|
||||
type="button"
|
||||
class="fas fa-window-minimize rounded-md px-3 py-1.5 text-base transition hover:bg-slate-200/80 dark:hover:bg-slate-800"
|
||||
class="fas fa-window-minimize rounded-md px-3 py-1.5 text-base transition text-slate-500 hover:bg-slate-200/80 dark:hover:bg-slate-800"
|
||||
aria-label="最小化"
|
||||
title="最小化"
|
||||
@click="minimize"
|
||||
@@ -83,7 +86,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="fas rounded-md px-3 py-1.5 text-base transition hover:bg-slate-200/80 dark:hover:bg-slate-800"
|
||||
class="fas rounded-md px-3 py-1.5 text-base transition text-slate-500 hover:bg-slate-200/80 dark:hover:bg-slate-800"
|
||||
:class="isMaximized ? 'fa-window-restore' : 'fa-window-maximize'"
|
||||
aria-label="最大化或还原"
|
||||
title="最大化或还原"
|
||||
@@ -92,7 +95,7 @@
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
class="fas fa-times rounded-md px-3 py-1.5 text-base transition hover:bg-red-500 hover:text-white"
|
||||
class="fas fa-times rounded-md px-3 py-1.5 text-base transition text-slate-500 hover:bg-red-500 hover:text-white"
|
||||
aria-label="关闭"
|
||||
title="关闭"
|
||||
@click="close"
|
||||
@@ -149,6 +152,10 @@ const clearSearch = () => {
|
||||
emit("update:searchQuery", "");
|
||||
};
|
||||
|
||||
const openCommercial = () => {
|
||||
window.open("https://www.spark-app.store/commercial/", "_blank");
|
||||
};
|
||||
|
||||
const minimize = () => {
|
||||
window.windowControls.minimize();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user