}
onClick={() => void workspace.scan()}
disabled={workspace.scanning}
>
{t("Rescan", "重新扫描")}
}
/>
{tabs.map((tab) => (
workspace.setTab(tab.id)}
>
{tab.label}
{tab.count}
))}
{workspace.error ? (
) : null}
{workspace.tab === "startup" ? (
{(
[
["all", "All", "全部"],
["enabled", "Enabled", "已启用"],
["disabled", "Disabled", "已禁用"],
["leftover", "Leftover", "残留"],
] as const
).map(([id, en, zh]) => (
0 ? "has-leftover" : ""
}`}
onClick={() => setStartupFilter(id)}
>
{t(en, zh)}
{counts[id]}
))}
{t("Show system items", "显示系统项")}
setQuery(event.target.value)}
placeholder={t("Filter by name or path…", "按名称或路径筛选…")}
/>
{orderedGroups.map(([software, items]) => {
const onCount = items.filter((item) => item.enabled && !isLeftover(item)).length;
const allOn = onCount === items.length;
const open = isGroupOpen(software);
const groupIds = items.map((item) => item.id);
const leftovers = items.filter(isLeftover);
return (
0 && leftovers.length === items.length ? "is-leftover" : ""
}`}
>
toggleGroupOpen(software)}>
{software}
{leftovers.length > 0 ? (
{t(`${leftovers.length} leftover`, `${leftovers.length} 个残留`)}
) : null}
{allOn
? t("All on", "全部开启")
: onCount === 0
? t("All off", "已全部关闭")
: t(
`${onCount}/${items.length} on`,
`部分开启 ${onCount}/${items.length}`,
)}
event.stopPropagation()}
>
{
event.stopPropagation();
toggleGroupOpen(software);
}}
>
{items.length > 1
? t(`${items.length} items`, `共${items.length}项`)
: t("1 item", "共1项")}
void workspace.toggleStartupGroup(groupIds, next)}
label={`${software} master ${allOn ? "disable" : "enable"}`}
/>
{open ? (
{items.map((item) => {
const [statusText, statusTone] = statusChip(item, t);
const reveal = rowRevealPath(item);
return (
{item.name}{" "}
{statusText}
{item.sourceLabel} · {scopeLabel(item.scope, t)}
{item.command ? ` · ${shortPath(item.command, 72)}` : ""}
{item.command || t("(no command line)", "(无命令行记录)")}
{isLeftover(item) ? (
}
disabled={workspace.busyId !== null}
onClick={() => setRemovingIds([item.id])}
>
{t("Delete entry", "删除启动项")}
) : null}
{reveal ? (
void api.revealPath(reveal).catch(() => {})}
>
) : null}
void workspace.toggleStartup(item.id, next)}
label={`${item.name} ${item.enabled ? "disable" : "enable"}`}
/>
);
})}
{leftovers.length > 0 && leftovers.length < items.length ? (
{t(
`${leftovers.length} leftover entries in this group — their programs are gone.`,
`该组有 ${leftovers.length} 个残留项:程序已不存在,只剩启动配置。`,
)}
setRemovingIds(leftovers.map((item) => item.id))}
>
{t(
`Delete ${leftovers.length} leftover(s)`,
`删除 ${leftovers.length} 个残留项`,
)}
) : null}
) : null}
);
})}
{startup.length === 0 ? (
{counts.all === 0
? t("No matches.", "没有匹配的项目。")
: t("Nothing here under this filter.", "当前筛选下没有项目。")}
) : null}
) : null}
}
title={t("Delete startup entries?", "删除启动项?")}
message={t(
`Squid removes only the autostart registration (${removingIds?.length ?? 0} item(s)); no program files are touched.`,
`Squid 只删除启动配置(共 ${removingIds?.length ?? 0} 项),不会动任何程序文件。`,
)}
note={t(
"Registry values are deleted; Startup-folder shortcuts are removed; tasks are unscheduled; leftover services are set to disabled.",
"注册表值将被删除;启动文件夹的快捷方式会被移除;计划任务会被注销;残留服务会改为禁用。",
)}
confirmLabel={t("Delete", "删除")}
cancelLabel={t("Cancel", "取消")}
busy={workspace.busyId !== null}
onClose={() => setRemovingIds(null)}
onConfirm={async () => {
if (!removingIds) return;
await workspace.removeStartup(removingIds);
setRemovingIds(null);
}}
/>
{workspace.tab === "extensions" ? (
{extGroups.map(([software, items]) => {
const onCount = items.filter((entry) => entry.registered).length;
const allOn = onCount === items.length;
const open = isExtGroupOpen(software);
return (
toggleExtGroupOpen(software)}>
{software}
{allOn
? t("All on", "全部开启")
: onCount === 0
? t("All off", "已全部关闭")
: t(
`${onCount}/${items.length} on`,
`部分开启 ${onCount}/${items.length}`,
)}
event.stopPropagation()}
>
{
event.stopPropagation();
toggleExtGroupOpen(software);
}}
>
{items.length > 1
? t(
`${items.length} places`,
`共${items.length}个菜单位置`,
)
: t("1 place", "1个菜单位置")}
{
for (const entry of items) {
if (entry.registered !== next) {
await workspace.toggleExtension(entry.id, next);
}
}
}}
label={`${software} master ${allOn ? "disable" : "enable"}`}
/>
{open ? (
{items.map((entry) => (
{entry.friendlyName ?? entry.name}
{entry.publisher
? `${t("Creator", "创建者")} ${entry.publisher} · `
: ""}
{scopeLabel(entry.scope, t)}
{entry.module ? ` · ${shortPath(entry.module, 56)}` : ""}
{!entry.registered ? ` · ${t("removed", "已移除")}` : ""}
void workspace.toggleExtension(entry.id, next)}
label={`${entry.name} ${entry.registered ? "remove" : "restore"}`}
/>
))}
) : null}
);
})}
{extCategories.length === 0 ? (
{t("No matches.", "没有匹配的项目。")}
) : null}
) : null}
{workspace.tab === "advanced" ? (
{t(
"Advanced rows can break boot or logon if changed carelessly — Squid only displays them here, every change records its original value, and nothing is auto-disabled.",
"进阶区的项目改错了可能影响系统行为——默认只展示不勾选,每一项带数字签名与位置说明;改动会原样记录,可逐项恢复。",
)}
{workspace.advancedScanning && !workspace.advanced ? (
{t(
"Reading Winlogon / IFEO / BHO and verifying signatures…",
"正在读取 Winlogon / IFEO / BHO 并核验数字签名…",
)}
) : null}
{workspace.advanced && workspace.advanced.entries.length === 0 ? (
{t(
"No third-party Winlogon hooks, AppInit DLLs, IFEO debuggers or BHOs found — the machine is clean.",
"没有发现第三方 Winlogon 挂钩、AppInit DLL、IFEO 调试器或 BHO——系统很干净。",
)}
) : null}
{workspace.advanced
? (["winlogon", "appinit", "ifeo", "bho"] as const).map((kind) => {
const rows = workspace.advanced!.entries.filter((entry) => entry.kind === kind);
if (rows.length === 0) return null;
const titles: Record = {
winlogon: ["Winlogon hooks", "Winlogon 与登录链"],
appinit: ["AppInit DLL injection", "AppInit_DLLs 全局注入"],
ifeo: ["IFEO debuggers (can hijack any program)", "IFEO 调试器(可劫持任意程序启动)"],
bho: ["Browser helper objects", "浏览器加载项 BHO"],
};
return (
{rows.map((entry) => (
{entry.signature === "microsoft"
? t("Microsoft signed", "微软签名")
: entry.signature === "vendor"
? t("Signed by", "已知厂商")
: entry.signature === "unsigned"
? t("Not signed", "无数字签名")
: entry.signature === "invalid"
? t("Signature invalid", "签名无效")
: t("Signature n/a", "无签名信息")}
{entry.name}
{shortPath(entry.command, 90)}
{entry.location}
{entry.warning ? (
{entry.warning}
) : null}
void workspace.toggleAdvanced(entry.id, next)}
label={entry.name}
/>
))}
);
})
: null}
{workspace.advanced && workspace.advanced.extras.length > 0 ? (
{workspace.advanced.extras.map((entry) => (
{scopeLabel(entry.scope, t)}
{entry.displayName || entry.name}
{shortPath(entry.command, 90)}
{entry.sourceLabel}
void workspace.toggleStartup(entry.id, next)}
label={entry.name}
/>
))}
) : null}
) : null}
{workspace.tab === "popup" ? (
<>
void workspace.setWatcher(next)}
label={t("Popup blocker switch", "弹窗拦截总开关")}
/>
}
/>
{workspace.recentClosed.length > 0 ? (
{workspace.recentClosed[0].process} · {workspace.recentClosed[0].title}
) : null}
{view.rules.map((rule, index) => (
{rule.title}
{shortPath(rule.exe, 64)} ·{" "}
{t(`closed ${rule.closed}×`, `已关闭 ${rule.closed} 次`)}
void workspace.toggleRule(index, next)}
label={`${rule.title} ${rule.enabled ? "disable" : "enable"}`}
/>
void workspace.removeRule(index)}
>
))}
{view.rules.length === 0 ? (
{t(
"No rules yet — pick a window below.",
"还没有规则,先从下面的当前窗口里“拦截”一个。",
)}
) : null}
}
onClick={() => void workspace.refreshWindows()}
>
{t("Refresh", "刷新")}
}
/>
{workspace.windows.map((window) => (
{window.title}
{window.process}
void workspace.addRule(window.hwnd, "contains")}
>
{t("Block", "拦截")}
void workspace.closeWindow(window.hwnd)}
>
))}
>
) : null}
);
}