Disable autofill on server confirmation inputs

This commit is contained in:
npc0-hue
2026-08-04 14:59:12 +08:00
parent 86a50ec8fa
commit 96a1939f32
2 changed files with 18 additions and 2 deletions
+8 -1
View File
@@ -145,6 +145,9 @@ describe("first-party console pages", () => {
expect(html).toContain("服务器管理");
expect(html).toContain("搜索服务器");
expect(html).toContain("autoComplete=\"off\"");
expect(html).toContain("data-1p-ignore=\"true\"");
expect(html).toContain("data-lpignore=\"true\"");
expect(html).toContain("在线");
expect(html).toContain("离线");
expect(html).not.toContain("run socket");
@@ -248,12 +251,16 @@ describe("first-party console pages", () => {
it("places server deletion in the list runtime actions with password confirmation", () => {
const deleteHandlerSource = serversPageSource.split("async function handleDeleteServer")[1]?.split("function openRunTargetSelection")[0] ?? "";
expect(serversPageSource).toContain("deleteServerInstance(deleteConfirmation.serverInstanceId, { password: deletePassword })");
expect(deleteHandlerSource).toContain("deleteServerInstance(deleteConfirmation.serverInstanceId, {");
expect(deleteHandlerSource).toContain("password: deletePassword");
expect(serversPageSource).toContain("serverDeleteConfirmation(card.instance)");
expect(serversPageSource).toContain("serverDeleteDisabledReason(session, card.instance)");
expect(serversPageSource).toContain("危险操作");
expect(serversPageSource).toContain("删除服务器");
expect(serversPageSource).toContain("请输入当前登录密码");
expect(serversPageSource).toContain("name=\"server-delete-password-confirmation\"");
expect(serversPageSource).toContain("autoComplete=\"new-password\"");
expect(serversPageSource).not.toContain("autoComplete=\"current-password\"");
expect(serversPageSource).toContain("canOpenActions");
expect(deleteHandlerSource).toContain("await refresh();");
expect(deleteHandlerSource).not.toContain("onNavigate");
+10 -1
View File
@@ -553,6 +553,10 @@ export function ServersPage({ session, operations, onNavigate }: PageComponentPr
<Search size={16} aria-hidden="true" />
<input
type="search"
name="server-list-search"
autoComplete="off"
data-1p-ignore="true"
data-lpignore="true"
value={keyword}
placeholder="搜索服务器名称、ID 或插件"
aria-label="搜索服务器"
@@ -631,7 +635,12 @@ export function ServersPage({ session, operations, onNavigate }: PageComponentPr
<input
type="password"
autoComplete="current-password"
name="server-delete-password-confirmation"
autoComplete="new-password"
data-1p-ignore="true"
data-lpignore="true"
data-bwignore="true"
data-protonpass-ignore="true"
value={deletePassword}
onChange={(event) => setDeletePassword(event.target.value)}
/>