fix: isolate server search from password autofill

This commit is contained in:
npc0-hue
2026-09-07 12:01:45 +08:00
parent 49090fc3aa
commit 5be7ec112e
2 changed files with 10 additions and 7 deletions
+4 -3
View File
@@ -152,9 +152,11 @@ describe("first-party console pages", () => {
expect(html).toContain("服务器管理");
expect(html).toContain("搜索服务器");
expect(html).toContain("autoComplete=\"off\"");
expect(html).toContain("autoComplete=\"new-password\"");
expect(html).toContain("data-1p-ignore=\"true\"");
expect(html).toContain("data-lpignore=\"true\"");
expect(html).toContain("data-bwignore=\"true\"");
expect(html).toContain("data-protonpass-ignore=\"true\"");
expect(html).toContain("在线");
expect(html).toContain("离线");
expect(html).not.toContain("run socket");
@@ -292,8 +294,7 @@ describe("first-party console pages", () => {
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("autoComplete=\"current-password\"");
expect(serversPageSource).toContain("canOpenActions");
expect(deleteHandlerSource).toContain("await refresh();");
expect(deleteHandlerSource).not.toContain("onNavigate");
+6 -4
View File
@@ -497,14 +497,16 @@ export function ServersPage({ session, operations, onNavigate }: PageComponentPr
</form>
</ManagementDialog>
<div className="server-toolbar" role="search">
<div className="server-toolbar" role="search" data-form-type="other">
<Search size={16} aria-hidden="true" />
<input
type="search"
name="server-list-search"
autoComplete="off"
name="server-list-filter"
autoComplete="new-password"
data-1p-ignore="true"
data-lpignore="true"
data-bwignore="true"
data-protonpass-ignore="true"
value={keyword}
placeholder="搜索服务器名称、ID 或插件"
aria-label="搜索服务器"
@@ -586,7 +588,7 @@ export function ServersPage({ session, operations, onNavigate }: PageComponentPr
<input
type="password"
name="server-delete-password-confirmation"
autoComplete="new-password"
autoComplete="current-password"
data-1p-ignore="true"
data-lpignore="true"
data-bwignore="true"