Release Squid 0.1.10 with flat icons and tabbed settings

main
mula.liu 2026-11-20 03:53:28 +08:00
parent cea60cc6c1
commit 37658ed61d
72 changed files with 553 additions and 402 deletions

16
Cargo.lock generated
View File

@ -3594,7 +3594,7 @@ dependencies = [
[[package]]
name = "squid-cli"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"anyhow",
"chrono",
@ -3614,7 +3614,7 @@ dependencies = [
[[package]]
name = "squid-core"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"anyhow",
"chrono",
@ -3633,7 +3633,7 @@ dependencies = [
[[package]]
name = "squid-engine"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"anyhow",
"chrono",
@ -3653,7 +3653,7 @@ dependencies = [
[[package]]
name = "squid-guard"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"chrono",
"hex",
@ -3669,7 +3669,7 @@ dependencies = [
[[package]]
name = "squid-platform"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"dirs",
"file_icon_provider",
@ -3689,7 +3689,7 @@ dependencies = [
[[package]]
name = "squid-rules"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"globset",
"serde",
@ -3701,7 +3701,7 @@ dependencies = [
[[package]]
name = "squid-stats"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"chrono",
"libc",
@ -3714,7 +3714,7 @@ dependencies = [
[[package]]
name = "squid-tui"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"anyhow",
"chrono",

View File

@ -4,7 +4,7 @@ members = ["crates/*"]
exclude = ["src-tauri"]
[workspace.package]
version = "0.1.9"
version = "0.1.10"
edition = "2021"
rust-version = "1.95"
license = "GPL-3.0-only"

View File

@ -1,7 +1,7 @@
{
"name": "squid-desktop",
"private": true,
"version": "0.1.9",
"version": "0.1.10",
"type": "module",
"scripts": {
"dev": "vite --port 1420 --strictPort",

14
src-tauri/Cargo.lock generated
View File

@ -4760,7 +4760,7 @@ dependencies = [
[[package]]
name = "squid-core"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"anyhow",
"chrono",
@ -4779,7 +4779,7 @@ dependencies = [
[[package]]
name = "squid-desktop"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"base64 0.22.1",
"chrono",
@ -4806,7 +4806,7 @@ dependencies = [
[[package]]
name = "squid-engine"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"anyhow",
"chrono",
@ -4826,7 +4826,7 @@ dependencies = [
[[package]]
name = "squid-guard"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"chrono",
"hex",
@ -4842,7 +4842,7 @@ dependencies = [
[[package]]
name = "squid-platform"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"dirs 6.0.0",
"file_icon_provider",
@ -4862,7 +4862,7 @@ dependencies = [
[[package]]
name = "squid-rules"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"globset",
"serde",
@ -4874,7 +4874,7 @@ dependencies = [
[[package]]
name = "squid-stats"
version = "0.1.9"
version = "0.1.10"
dependencies = [
"chrono",
"libc",

View File

@ -1,6 +1,6 @@
[package]
name = "squid-desktop"
version = "0.1.9"
version = "0.1.10"
description = "Squid — a CleanMyMac-inspired cleaner, uninstaller and system monitor."
authors = ["squid contributors"]
edition = "2021"

View File

@ -1,35 +1,13 @@
<svg width="1024" height="1024" viewBox="0 0 1024 1024" fill="none" xmlns="http://www.w3.org/2000/svg">
<defs>
<linearGradient id="bg" x1="110" y1="80" x2="902" y2="944" gradientUnits="userSpaceOnUse">
<stop stop-color="#FFB25C"/>
<stop offset="0.52" stop-color="#FF6B35"/>
<stop offset="1" stop-color="#C66BFF"/>
</linearGradient>
<linearGradient id="body" x1="356" y1="200" x2="678" y2="704" gradientUnits="userSpaceOnUse">
<stop stop-color="white"/>
<stop offset="1" stop-color="#FFF6EE"/>
</linearGradient>
<filter id="shadow" x="248" y="248" width="528" height="540" filterUnits="userSpaceOnUse">
<feDropShadow dx="0" dy="22" stdDeviation="28" flood-color="#7A3018" flood-opacity="0.28"/>
</filter>
</defs>
<rect x="40" y="40" width="944" height="944" rx="228" fill="url(#bg)"/>
<path d="M141 327C236 125 462 50 668 107C872 163 977 359 947 570C915 792 725 941 494 936C266 932 78 771 64 555C59 474 85 394 141 327Z" fill="url(#body)" fill-opacity="0.15"/>
<g filter="url(#shadow)">
<path d="M512 206C608 206 682 286 682 386V499C682 599 608 679 512 679C416 679 342 599 342 499V386C342 286 416 206 512 206Z" fill="url(#body)"/>
<path d="M386 353C430 323 479 313 512 313C545 313 594 323 638 353" stroke="#D94F1F" stroke-width="28" stroke-linecap="round" opacity="0.9"/>
<circle cx="443" cy="445" r="28" fill="#7A3018"/>
<circle cx="581" cy="445" r="28" fill="#7A3018"/>
<circle cx="434" cy="436" r="8" fill="white"/>
<circle cx="572" cy="436" r="8" fill="white"/>
<path d="M456 532C479 553 545 553 568 532" stroke="#D94F1F" stroke-width="22" stroke-linecap="round"/>
<path d="M393 624C350 665 333 720 342 786" stroke="#FFF6EE" stroke-width="54" stroke-linecap="round"/>
<path d="M456 652C438 714 447 770 478 820" stroke="#FFF6EE" stroke-width="48" stroke-linecap="round"/>
<path d="M568 652C586 714 577 770 546 820" stroke="#FFF6EE" stroke-width="48" stroke-linecap="round"/>
<path d="M631 624C674 665 691 720 682 786" stroke="#FFF6EE" stroke-width="54" stroke-linecap="round"/>
<circle cx="342" cy="813" r="32" fill="#FFF6EE"/>
<circle cx="478" cy="841" r="28" fill="#FFF6EE"/>
<circle cx="546" cy="841" r="28" fill="#FFF6EE"/>
<circle cx="682" cy="813" r="32" fill="#FFF6EE"/>
<rect x="102" y="102" width="820" height="820" rx="182.6" fill="#FF6B35"/>
<g fill="#FFF4EA">
<path d="M512 280C610 280 690 344 690 430V512C690 596 610 648 512 648C414 648 334 596 334 512V430C334 344 414 280 512 280Z"/>
<path d="M382 610C340 660 326 720 340 772" stroke="#FFF4EA" stroke-width="54" stroke-linecap="round"/>
<path d="M464 640C444 700 448 748 468 782" stroke="#FFF4EA" stroke-width="46" stroke-linecap="round"/>
<path d="M560 640C580 700 576 748 556 782" stroke="#FFF4EA" stroke-width="46" stroke-linecap="round"/>
<path d="M642 610C684 660 698 720 684 772" stroke="#FFF4EA" stroke-width="54" stroke-linecap="round"/>
</g>
<circle cx="442" cy="446" r="30" fill="#FF6B35"/>
<circle cx="582" cy="446" r="30" fill="#FF6B35"/>
<path d="M462 520Q512 552 562 520" stroke="#FF6B35" stroke-width="22" stroke-linecap="round"/>
</svg>

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.9 KiB

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 KiB

After

Width:  |  Height:  |  Size: 615 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 551 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 858 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.5 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 919 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.3 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

View File

@ -0,0 +1,13 @@
<svg width="820" height="820" viewBox="102 102 820 820" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect x="102" y="102" width="820" height="820" rx="182.6" fill="#FF6B35"/>
<g fill="#FFF4EA">
<path d="M512 280C610 280 690 344 690 430V512C690 596 610 648 512 648C414 648 334 596 334 512V430C334 344 414 280 512 280Z"/>
<path d="M382 610C340 660 326 720 340 772" stroke="#FFF4EA" stroke-width="54" stroke-linecap="round"/>
<path d="M464 640C444 700 448 748 468 782" stroke="#FFF4EA" stroke-width="46" stroke-linecap="round"/>
<path d="M560 640C580 700 576 748 556 782" stroke="#FFF4EA" stroke-width="46" stroke-linecap="round"/>
<path d="M642 610C684 660 698 720 684 772" stroke="#FFF4EA" stroke-width="54" stroke-linecap="round"/>
</g>
<circle cx="442" cy="446" r="30" fill="#FF6B35"/>
<circle cx="582" cy="446" r="30" fill="#FF6B35"/>
<path d="M462 520Q512 552 562 520" stroke="#FF6B35" stroke-width="22" stroke-linecap="round"/>
</svg>

After

Width:  |  Height:  |  Size: 975 B

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 939 B

After

Width:  |  Height:  |  Size: 399 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 553 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.4 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 785 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 124 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -1,7 +1,7 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "Squid",
"version": "0.1.9",
"version": "0.1.10",
"identifier": "app.nex.squid",
"mainBinaryName": "squid-desktop",
"build": {

View File

@ -34,7 +34,7 @@ import type {
} from "./types";
import { useToast } from "./components/ui";
import { SetupPanel } from "./components/SetupPanel";
import appIconUrl from "../src-tauri/icons/128x128.png";
import brandMarkUrl from "../src-tauri/icons/brand-mark.svg";
import { ApplicationsPage } from "./pages/ApplicationsPage";
import { CleanupPage } from "./pages/CleanupPage";
import { HistoryPage } from "./pages/HistoryPage";
@ -145,7 +145,7 @@ function BrandMark({ small = false }: { small?: boolean }) {
return (
<img
className={`brand-mark ${small ? "is-small" : ""}`}
src={appIconUrl}
src={brandMarkUrl}
alt=""
aria-hidden="true"
/>

View File

@ -151,7 +151,7 @@ export function ApplicationsPage({
return (
<div className="page apps-page">
<PageHeader
title={t("Uninstall completely.", "卸载,干净彻底。")}
title={t("Uninstall completely", "卸载,干净彻底")}
description={t(
"Remove an app together with the caches, preferences and support files it leaves behind.",
"卸载应用,并一并处理它留下的缓存、偏好设置与支持文件。",

View File

@ -18,7 +18,7 @@ export function CleanupPage({
return (
<div className="page cleanup-page">
<PageHeader
title={t("Clutter, without the guesswork.", "清理垃圾,不靠猜。")}
title={t("Clutter, without the guesswork", "清理垃圾,不靠猜")}
description={t(
"Rebuildable caches, old logs and other safe-to-remove files — always reviewed before deletion.",
"可重建缓存、旧日志与其他可安全删除的文件,删除前始终由您确认。",

View File

@ -89,7 +89,7 @@ export function HistoryPage() {
return (
<div className="page history-page">
<PageHeader
title={t("Every change, on the record.", "每一次改动,都有记录。")}
title={t("Every change, on the record", "每一次改动,都有记录")}
description={t(
`Review past cleanups and put files back from the ${bin} when you change your mind.`,
`查看过去的清理记录,改变主意时还可以从${bin}还原文件。`,

View File

@ -184,7 +184,7 @@ export function OverviewPage({
<div className="page overview-page">
<PageHeader
eyebrow={`${greeting(lang)} · ${bootstrap.osName}`}
title={t("Your computer, at its best.", "让电脑始终保持在最佳状态。")}
title={t("Your computer, at its best", "让电脑始终保持在最佳状态")}
description={t(
"One safe scan tidies clutter, space and everyday performance.",
"一次安全扫描,整理垃圾、空间与日常性能。",
@ -215,10 +215,10 @@ export function OverviewPage({
<h2>
{cleanup.result
? t(
`${formatBytes(found)} found safely.`,
`安全发现 ${formatBytes(found)} 可清理空间。`,
`${formatBytes(found)} found safely`,
`安全发现 ${formatBytes(found)} 可清理空间`,
)
: t("A lighter, faster machine.", "更轻盈,更顺畅。")}
: t("A lighter, faster machine", "更轻盈,更顺畅")}
</h2>
<p>
{cleanup.result

View File

@ -87,7 +87,7 @@ export function PermissionsPage({ workspace }: { workspace: PermissionsWorkspace
<div className="page">
<PageHeader
eyebrow={t("Permissions", "权限管理")}
title={t("Startup, context menus and popups.", "开机启动、右键菜单与弹窗拦截。")}
title={t("Startup, context menus and popups", "开机启动、右键菜单与弹窗拦截")}
description={t(
"Everything the shell runs before you ask it to.",
"管理系统在你开口之前就自己运行的东西。",
@ -149,7 +149,7 @@ export function PermissionsPage({ workspace }: { workspace: PermissionsWorkspace
<div className="page permissions-page">
<PageHeader
eyebrow={t("Permissions", "权限管理")}
title={t("Startup, context menus and popups.", "开机启动、右键菜单与弹窗拦截。")}
title={t("Startup, context menus and popups", "开机启动、右键菜单与弹窗拦截")}
description={t(
"Everything the shell runs before you ask it to.",
"管理系统在你开口之前就自己运行的东西。",

View File

@ -41,7 +41,7 @@ export function PurgePage({
return (
<div className="page">
<PageHeader
title={t("Find the space normal cleaning misses.", "找到普通清理遗漏的空间。")}
title={t("Find the space normal cleaning misses", "找到普通清理遗漏的空间")}
description={t(
"Search projects for rebuildable build folders and dependency caches. Git history and source files are never selected.",
"在项目中查找可重建的构建目录与依赖缓存。Git 历史和源文件绝不会被选中。",

View File

@ -150,8 +150,8 @@ export function SecurityPage({
<PageHeader
title={
scan
? t("The last scan, and what to do about it.", "上次扫描的结果,以及下一步。")
: t("Nothing has been scanned yet.", "还没有扫描过这台电脑。")
? t("The last scan, and what to do about it", "上次扫描的结果,以及下一步")
: t("Nothing has been scanned yet", "还没有扫描过这台电脑")
}
description={t(
"Scans run when you ask. Real-time protection stays with the system.",

View File

@ -3,18 +3,21 @@ import {
FileCog,
FolderClock,
FolderOpen,
HardDrive,
Info,
Languages,
LockKeyhole,
Plus,
Power,
RefreshCw,
ShieldCheck,
SlidersHorizontal,
Sparkles,
Trash2,
X,
} from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import { open } from "@tauri-apps/plugin-dialog";
import brandMarkUrl from "../../src-tauri/icons/brand-mark.svg";
import { useI18n } from "../i18n";
import { api } from "../lib/api";
import { messageFrom, shortPath } from "../lib/format";
@ -38,6 +41,21 @@ import {
useToast,
} from "../components/ui";
type SettingsTab = "general" | "cleanup" | "security" | "updates" | "about";
const SETTINGS_TABS: {
id: SettingsTab;
labelEn: string;
labelZh: string;
icon: typeof SlidersHorizontal;
}[] = [
{ id: "general", labelEn: "General", labelZh: "常规", icon: SlidersHorizontal },
{ id: "cleanup", labelEn: "Cleanup", labelZh: "清理", icon: Trash2 },
{ id: "security", labelEn: "Security", labelZh: "安全", icon: ShieldCheck },
{ id: "updates", labelEn: "Updates", labelZh: "更新", icon: Sparkles },
{ id: "about", labelEn: "About", labelZh: "关于", icon: Info },
];
export function SettingsPage({
bootstrap,
settings,
@ -59,6 +77,7 @@ export function SettingsPage({
}) {
const { t, lang, bin } = useI18n();
const { push } = useToast();
const [tab, setTab] = useState<SettingsTab>("general");
const [whitelistInput, setWhitelistInput] = useState("");
const [saving, setSaving] = useState(false);
const [error, setError] = useState<string | null>(null);
@ -176,366 +195,422 @@ export function SettingsPage({
return (
<div className="page settings-page">
<PageHeader
title={t("Make Squid yours.", "按您的方式使用 Squid。")}
title={t("Make Squid yours", "按您的方式使用 Squid")}
description={t(
"Language, deletion behaviour, protected locations and updates all live here.",
"语言、删除方式、保护路径与更新设置都在这里。",
"Language, cleanup rules, protection and updates.",
"语言、清理规则、保护与更新。",
)}
/>
{error ? <InlineError message={error} onDismiss={() => setError(null)} /> : null}
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<Languages size={18} />
{t("Language & appearance", "语言与外观")}
</h2>
</div>
</div>
<div className="language-picker">
<button
className={lang === "zh" ? "is-active" : ""}
onClick={() => void onLanguageChange("zh")}
>
<strong>简体中文</strong>
<span>Simplified Chinese</span>
{lang === "zh" ? <Check size={16} /> : null}
</button>
<button
className={lang === "en" ? "is-active" : ""}
onClick={() => void onLanguageChange("en")}
>
<strong>English</strong>
<span>English (US)</span>
{lang === "en" ? <Check size={16} /> : null}
</button>
</div>
</section>
<div
className="chip-row page-tabs settings-tabs"
role="tablist"
aria-label={t("Settings sections", "设置分区")}
>
{SETTINGS_TABS.map((item) => {
const Icon = item.icon;
return (
<button
key={item.id}
role="tab"
aria-selected={tab === item.id}
className={`filter-chip ${tab === item.id ? "is-active" : ""}`}
onClick={() => setTab(item.id)}
>
<Icon size={14} />
{t(item.labelEn, item.labelZh)}
</button>
);
})}
</div>
{bootstrap.platform === "macos" ? (
<section className="settings-section">
{tab === "general" ? (
<div className="settings-grid">
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<Languages size={18} />
{t("Language & appearance", "语言与外观")}
</h2>
</div>
</div>
<div className="language-picker">
<button
className={lang === "zh" ? "is-active" : ""}
onClick={() => void onLanguageChange("zh")}
>
<strong>简体中文</strong>
<span>Simplified Chinese</span>
{lang === "zh" ? <Check size={16} /> : null}
</button>
<button
className={lang === "en" ? "is-active" : ""}
onClick={() => void onLanguageChange("en")}
>
<strong>English</strong>
<span>English (US)</span>
{lang === "en" ? <Check size={16} /> : null}
</button>
</div>
</section>
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<Power size={18} />
{t("Startup", "启动")}
</h2>
</div>
</div>
<div className="settings-row is-first">
<div>
<strong>{t("Launch Squid at login", "登录时启动 Squid")}</strong>
<span>
{t(
"Only Squid itself; other apps are managed under Startup items.",
"仅 Squid 自身,其他程序请到启动项页面管理。",
)}
</span>
</div>
<Toggle
checked={autostart ?? false}
onChange={(enabled) => void setLaunchAtLogin(enabled)}
disabled={autostart === null || savingAutostart}
label={t("Launch Squid at login", "登录时启动 Squid")}
/>
</div>
</section>
</div>
) : null}
{tab === "cleanup" ? (
<div className="settings-grid">
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<Trash2 size={18} />
{t("Deletion safety", "删除安全")}
</h2>
</div>
</div>
<div className="delete-mode-cards">
<button
className={settings.deleteMode === "trash" ? "is-active" : ""}
onClick={() => void setMode("trash")}
disabled={saving}
>
<span className="delete-mode-icon">
<FolderOpen size={20} />
</span>
<span>
<strong>{t(`Move to ${bin}`, `移入${bin}`)}</strong>
<small>
{t(
"Safer. Restore files later from History.",
"更安全,之后可从历史记录还原。",
)}
</small>
</span>
<span className="radio-dot" />
</button>
<button
className={settings.deleteMode === "permanent" ? "is-active" : ""}
onClick={() => void setMode("permanent")}
disabled={saving}
>
<span className="delete-mode-icon">
<Trash2 size={20} />
</span>
<span>
<strong>{t("Remove permanently", "永久删除")}</strong>
<small>
{t(
"No recovery for caches and rebuildable files.",
"缓存与可重建文件无法恢复。",
)}
</small>
</span>
<span className="radio-dot" />
</button>
</div>
<div className="settings-row">
<div>
<strong>{t("Report allocated size", "显示磁盘实际占用")}</strong>
<span>
{t(
"Prefer on-disk bytes for sparse and compressed files.",
"对稀疏和压缩文件优先显示磁盘实际占用。",
)}
</span>
</div>
<button
className={`toggle ${settings.showAllocated ? "is-on" : ""}`}
aria-label={t("Report allocated size", "显示磁盘实际占用")}
onClick={() => void save({ showAllocated: !settings.showAllocated })}
>
<span />
</button>
</div>
<div className="settings-row">
<div>
<strong>{t("History records to keep", "保留历史记录数量")}</strong>
</div>
<Select
value={settings.historyKeep}
label={t("History records to keep", "保留历史记录数量")}
options={[20, 60, 100, 200, 500].map((value) => ({
value,
label: String(value),
}))}
onChange={(next) => void save({ historyKeep: next })}
/>
</div>
</section>
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<ShieldCheck size={18} />
{t("Protected locations", "受保护的位置")}
</h2>
<p>
{t(
"Never deleted here, even when a cleanup rule matches. The malware scan still reports inside them.",
"这里的内容绝不会被删除。恶意软件扫描仍会检查其中的发现。",
)}
</p>
</div>
</div>
<div className="whitelist-add">
<input
value={whitelistInput}
onChange={(event) => setWhitelistInput(event.target.value)}
placeholder={t("Folder path to protect", "要保护的文件夹路径")}
onKeyDown={(event) => {
if (event.key === "Enter") void addWhitelist();
}}
/>
<Button
variant="secondary"
icon={<FolderOpen size={15} />}
onClick={() => void chooseWhitelist()}
>
{t("Choose", "选择")}
</Button>
<Button
variant="primary"
icon={<Plus size={15} />}
onClick={() => void addWhitelist()}
disabled={!whitelistInput.trim() || saving}
>
{t("Add", "添加")}
</Button>
</div>
<div className="whitelist-list">
{settings.whitelist.length === 0 ? (
<p className="settings-empty">
{t("No protected folders yet.", "尚未设置受保护的文件夹。")}
</p>
) : (
settings.whitelist.map((pattern) => (
<div className="whitelist-row" key={pattern}>
<span className="whitelist-icon">
<ShieldCheck size={15} />
</span>
<code title={pattern}>{shortPath(pattern, 88)}</code>
<button
className="row-reveal"
aria-label={t("Remove protection", "移除保护")}
onClick={() => void removeWhitelist(pattern)}
disabled={saving}
>
<X size={14} />
</button>
</div>
))
)}
</div>
</section>
</div>
) : null}
{tab === "security" ? (
<>
{bootstrap.platform === "macos" ? (
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<LockKeyhole size={18} />
{t("System permissions", "系统权限")}
</h2>
</div>
</div>
<div className="permission-check-row">
<span
className={`permission-check-icon is-${
permission?.fullDiskAccess === "granted" ? "granted" : "optional"
}`}
>
<LockKeyhole size={18} />
</span>
<div className="permission-check-copy">
<strong>
{t("Full Disk Access", "完全磁盘访问权限")}
<span
className={`permission-state is-${
checkingPermission
? "checking"
: permission?.fullDiskAccess === "granted"
? "granted"
: permission?.fullDiskAccess === "denied"
? "denied"
: "unknown"
}`}
>
{checkingPermission
? t("Checking…", "检查中…")
: permission?.fullDiskAccess === "granted"
? t("Granted", "已授权")
: permission?.fullDiskAccess === "denied"
? t("Needs attention", "需要授权")
: t("Not confirmed", "未确认")}
</span>
</strong>
<span>
{t(
"Enables scans of TCC-protected caches, mail data and app leftovers.",
"用于扫描受 TCC 保护的缓存、邮件数据与应用卸载残留。",
)}
</span>
</div>
<div className="permission-check-actions">
<Button
variant="ghost"
size="sm"
icon={
<RefreshCw
size={13}
className={checkingPermission ? "spin" : ""}
/>
}
onClick={() => void checkPermissions()}
disabled={checkingPermission}
>
{t("Recheck", "重新检查")}
</Button>
<Button
variant="secondary"
size="sm"
onClick={() => void api.openFullDiskAccessSettings()}
>
{t("Open Settings", "打开系统设置")}
</Button>
</div>
</div>
</section>
) : null}
{security.status ? (
<SecuritySettingsCard security={security} status={security.status} />
) : (
<section className="settings-section">
<p className="settings-empty">
{t("Security settings are loading…", "安全设置加载中…")}
</p>
</section>
)}
</>
) : null}
{tab === "updates" ? (
<UpdatePanel
flow={flow}
autoCheck={autoCheck}
onAutoCheckChange={onAutoCheckChange}
bootstrap={bootstrap}
/>
) : null}
{tab === "about" ? (
<section className="settings-section about-section">
<div className="settings-section-head">
<div>
<h2>
<LockKeyhole size={18} />
{t("System permissions", "系统权限")}
<Info size={18} />
{t("About Squid", "关于 Squid")}
</h2>
<p>
{t(
"Configuration and history stay local to this computer.",
"配置与历史记录仅保存在这台电脑上。",
)}
</p>
</div>
</div>
<div className="permission-check-row">
<span
className={`permission-check-icon is-${
permission?.fullDiskAccess === "granted" ? "granted" : "optional"
}`}
>
<LockKeyhole size={18} />
</span>
<div className="permission-check-copy">
<strong>
{t("Full Disk Access", "完全磁盘访问权限")}
<span
className={`permission-state is-${
checkingPermission
? "checking"
: permission?.fullDiskAccess === "granted"
? "granted"
: permission?.fullDiskAccess === "denied"
? "denied"
: "unknown"
}`}
>
{checkingPermission
? t("Checking…", "检查中…")
: permission?.fullDiskAccess === "granted"
? t("Granted", "已授权")
: permission?.fullDiskAccess === "denied"
? t("Needs attention", "需要授权")
: t("Not confirmed", "未确认")}
</span>
</strong>
<span>
{t(
"Enables scans of TCC-protected caches, mail data and app leftovers.",
"用于扫描受 TCC 保护的缓存、邮件数据与应用卸载残留。",
)}
</span>
<div className="about-brand">
<img className="about-mark" src={brandMarkUrl} alt="" aria-hidden="true" />
<div className="about-brand-copy">
<strong>Squid</strong>
<span>{t(`Version ${bootstrap.version}`, `版本 ${bootstrap.version}`)}</span>
</div>
<div className="permission-check-actions">
<span
className="about-platform"
title={`${bootstrap.osVersion || bootstrap.osName} · ${bootstrap.arch} · ${bootstrap.hardware}`}
>
{bootstrap.osVersion || bootstrap.osName} · {bootstrap.arch}
</span>
</div>
<div className="path-settings-list">
<div className="path-setting-row">
<span className="metric-icon tone-primary">
<FileCog size={17} />
</span>
<div>
<strong>{t("Configuration", "配置文件")}</strong>
<code title={bootstrap.configPath}>{bootstrap.configPath}</code>
</div>
<Button
variant="ghost"
size="sm"
icon={<RefreshCw size={13} className={checkingPermission ? "spin" : ""} />}
onClick={() => void checkPermissions()}
disabled={checkingPermission}
onClick={() =>
void api
.revealPath(bootstrap.configPath)
.catch((reason) => push(messageFrom(reason), "danger"))
}
>
{t("Recheck", "重新检查")}
{t("Show", "显示")}
</Button>
</div>
<div className="path-setting-row">
<span className="metric-icon tone-neutral">
<FolderClock size={17} />
</span>
<div>
<strong>{t("History", "历史记录")}</strong>
<code title={bootstrap.historyPath}>{bootstrap.historyPath}</code>
</div>
<Button
variant="secondary"
variant="ghost"
size="sm"
onClick={() => void api.openFullDiskAccessSettings()}
onClick={() =>
void api
.revealPath(bootstrap.historyPath)
.catch((reason) => push(messageFrom(reason), "danger"))
}
>
{t("Open Settings", "打开系统设置")}
{t("Show", "显示")}
</Button>
</div>
</div>
</section>
) : null}
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<Power size={18} />
{t("Startup", "启动")}
</h2>
</div>
</div>
<div className="settings-row is-first">
<div>
<strong>{t("Launch Squid at login", "登录时启动 Squid")}</strong>
<span>
{t(
"Only Squid itself; other apps are managed under Startup items.",
"仅 Squid 自身,其他程序请到启动项页面管理。",
)}
</span>
</div>
<Toggle
checked={autostart ?? false}
onChange={(enabled) => void setLaunchAtLogin(enabled)}
disabled={autostart === null || savingAutostart}
label={t("Launch Squid at login", "登录时启动 Squid")}
/>
</div>
</section>
{security.status ? (
<SecuritySettingsCard security={security} status={security.status} />
) : null}
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<Trash2 size={18} />
{t("Deletion safety", "删除安全")}
</h2>
</div>
</div>
<div className="delete-mode-cards">
<button
className={settings.deleteMode === "trash" ? "is-active" : ""}
onClick={() => void setMode("trash")}
disabled={saving}
>
<span className="delete-mode-icon">
<FolderOpen size={20} />
</span>
<span>
<strong>{t(`Move to ${bin}`, `移入${bin}`)}</strong>
<small>
{t(
"Safer. Restore files later from History.",
"更安全,之后可从历史记录还原。",
)}
</small>
</span>
<span className="radio-dot" />
</button>
<button
className={settings.deleteMode === "permanent" ? "is-active" : ""}
onClick={() => void setMode("permanent")}
disabled={saving}
>
<span className="delete-mode-icon">
<Trash2 size={20} />
</span>
<span>
<strong>{t("Remove permanently", "永久删除")}</strong>
<small>
{t(
"No recovery for caches and rebuildable files.",
"缓存与可重建文件无法恢复。",
)}
</small>
</span>
<span className="radio-dot" />
</button>
</div>
<div className="settings-row">
<div>
<strong>{t("Report allocated size", "显示磁盘实际占用")}</strong>
<span>
{t(
"Prefer on-disk bytes for sparse and compressed files.",
"对稀疏和压缩文件优先显示磁盘实际占用。",
)}
</span>
</div>
<button
className={`toggle ${settings.showAllocated ? "is-on" : ""}`}
aria-label={t("Report allocated size", "显示磁盘实际占用")}
onClick={() => void save({ showAllocated: !settings.showAllocated })}
>
<span />
</button>
</div>
<div className="settings-row">
<div>
<strong>{t("History records to keep", "保留历史记录数量")}</strong>
</div>
<Select
value={settings.historyKeep}
label={t("History records to keep", "保留历史记录数量")}
options={[20, 60, 100, 200, 500].map((value) => ({ value, label: String(value) }))}
onChange={(next) => void save({ historyKeep: next })}
/>
</div>
</section>
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<ShieldCheck size={18} />
{t("Protected locations", "受保护的位置")}
</h2>
<p>
{t(
"Never deleted here, even when a cleanup rule matches. The malware scan still reports inside them.",
"这里的内容绝不会被删除。恶意软件扫描仍会检查其中的发现。",
)}
</p>
</div>
</div>
<div className="whitelist-add">
<input
value={whitelistInput}
onChange={(event) => setWhitelistInput(event.target.value)}
placeholder={t("Folder path to protect", "要保护的文件夹路径")}
onKeyDown={(event) => {
if (event.key === "Enter") void addWhitelist();
}}
/>
<Button variant="secondary" icon={<FolderOpen size={15} />} onClick={() => void chooseWhitelist()}>
{t("Choose", "选择")}
</Button>
<Button
variant="primary"
icon={<Plus size={15} />}
onClick={() => void addWhitelist()}
disabled={!whitelistInput.trim() || saving}
>
{t("Add", "添加")}
</Button>
</div>
<div className="whitelist-list">
{settings.whitelist.length === 0 ? (
<p className="settings-empty">
{t("No protected folders yet.", "尚未设置受保护的文件夹。")}
</p>
) : (
settings.whitelist.map((pattern) => (
<div className="whitelist-row" key={pattern}>
<span className="whitelist-icon">
<ShieldCheck size={15} />
</span>
<code title={pattern}>{shortPath(pattern, 88)}</code>
<button
className="row-reveal"
aria-label={t("Remove protection", "移除保护")}
onClick={() => void removeWhitelist(pattern)}
disabled={saving}
>
<X size={14} />
</button>
</div>
))
)}
</div>
</section>
<UpdatePanel
flow={flow}
autoCheck={autoCheck}
onAutoCheckChange={onAutoCheckChange}
bootstrap={bootstrap}
/>
<section className="settings-section">
<div className="settings-section-head">
<div>
<h2>
<FileCog size={18} />
{t("Files & information", "文件与信息")}
</h2>
<p>
{t(
"Configuration and history stay local to this computer.",
"配置与历史记录仅保存在这台电脑上。",
)}
</p>
</div>
</div>
<div className="path-settings-list">
<div className="path-setting-row">
<span className="metric-icon tone-primary">
<FileCog size={17} />
</span>
<div>
<strong>{t("Configuration", "配置文件")}</strong>
<code title={bootstrap.configPath}>{bootstrap.configPath}</code>
</div>
<Button
variant="ghost"
size="sm"
onClick={() =>
void api
.revealPath(bootstrap.configPath)
.catch((reason) => push(messageFrom(reason), "danger"))
}
>
{t("Show", "显示")}
</Button>
</div>
<div className="path-setting-row">
<span className="metric-icon tone-neutral">
<FolderClock size={17} />
</span>
<div>
<strong>{t("History", "历史记录")}</strong>
<code title={bootstrap.historyPath}>{bootstrap.historyPath}</code>
</div>
<Button
variant="ghost"
size="sm"
onClick={() =>
void api
.revealPath(bootstrap.historyPath)
.catch((reason) => push(messageFrom(reason), "danger"))
}
>
{t("Show", "显示")}
</Button>
</div>
<div className="path-setting-row">
<span className="metric-icon tone-neutral">
<HardDrive size={17} />
</span>
<div>
<strong>{t("Platform", "平台")}</strong>
<code>
{bootstrap.osVersion || bootstrap.osName} · {bootstrap.arch} ·{" "}
{bootstrap.hardware}
</code>
</div>
<span className="settings-version">v{bootstrap.version}</span>
</div>
</div>
</section>
</div>
);
}

View File

@ -228,7 +228,7 @@ export function StartupPage({
return (
<div className="page is-stacked">
<PageHeader
title={t("What your machine starts by itself.", "你的电脑自己会启动什么。")}
title={t("What your machine starts by itself", "你的电脑自己会启动什么")}
description={t(
"Grouped by the app that installed each entry. A risk label means worth a look.",
"按安装该条目的应用分组。风险标记只代表值得检查。",

View File

@ -98,7 +98,7 @@ export function StoragePage({ bootstrap }: { bootstrap: Bootstrap }) {
return (
<div className="page storage-page">
<PageHeader
title={t("See space clearly.", "看清每一寸空间。")}
title={t("See space clearly", "看清每一寸空间")}
description={t(
"Drill into folders, find the heavyweight files, and open anything in Finder.",
"逐层查看文件夹,找到占用最大的文件,并直接在访达中打开。",

View File

@ -130,7 +130,7 @@ export function SystemPage({
return (
<div className="page system-page">
<PageHeader
title={t("The pulse of your machine.", "掌握设备的每一次呼吸。")}
title={t("The pulse of your machine", "掌握设备的每一次呼吸")}
description={t(
"Live processor, memory, disk and network activity, sampled locally every couple of seconds.",
"实时查看处理器、内存、磁盘与网络活动,数据每两秒在本地刷新。",

View File

@ -3725,6 +3725,39 @@ select:focus-visible,
max-width: 1020px;
}
.settings-tabs {
margin-bottom: 18px;
}
.settings-tabs .filter-chip {
display: inline-flex;
align-items: center;
gap: 6px;
}
.settings-tabs .filter-chip svg {
color: var(--nex-muted-soft);
}
.settings-tabs .filter-chip.is-active svg {
color: var(--nex-primary);
}
.settings-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(330px, 1fr));
align-items: start;
gap: 13px;
}
.settings-grid > .settings-section {
margin-bottom: 0;
}
.settings-grid .delete-mode-cards {
grid-template-columns: 1fr;
}
.settings-section {
margin-bottom: 13px;
padding: 18px;
@ -4143,6 +4176,58 @@ select:focus-visible,
font-weight: var(--nex-weight-semibold);
}
.about-brand {
display: flex;
align-items: center;
gap: 12px;
margin-bottom: 13px;
padding-bottom: 13px;
border-bottom: 1px solid var(--nex-line);
}
.about-mark {
display: block;
flex: 0 0 auto;
width: 52px;
height: 52px;
border-radius: 15px;
box-shadow: 0 8px 20px rgba(122, 48, 24, 0.16);
}
.about-brand-copy {
display: flex;
min-width: 0;
flex: 1;
flex-direction: column;
gap: 1px;
}
.about-brand-copy strong {
color: var(--nex-ink-strong);
font-size: var(--nex-text-lg);
font-weight: var(--nex-weight-display);
letter-spacing: -0.03em;
}
.about-brand-copy span {
color: var(--nex-muted);
font-size: var(--nex-text-3xs);
}
.about-platform {
flex: 0 0 auto;
max-width: 45%;
overflow: hidden;
padding: 4px 8px;
border-radius: 7px;
color: var(--nex-muted);
background: var(--nex-cream);
font-size: var(--nex-text-3xs);
font-weight: var(--nex-weight-semibold);
text-overflow: ellipsis;
white-space: nowrap;
}
/* Update panel */