From 9fa3c63d7dd786e60738c098c589affe8e4021ab Mon Sep 17 00:00:00 2001 From: chenxuan Date: Tue, 15 Sep 2026 00:31:34 +0800 Subject: [PATCH] 0 --- _locales/en/messages.json | 16 +++++ _locales/zh_CN/messages.json | 16 +++++ popup.css | 79 ++++++++++++++++++++++++- popup.html | 23 ++++++-- popup.js | 109 ++++++++++++++++++++++++++++++++--- 5 files changed, 231 insertions(+), 12 deletions(-) diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 1fe06d5..3bf916e 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -271,6 +271,18 @@ "message": "Import", "description": "Import button" }, + "searchBtnTitle": { + "message": "Search", + "description": "Search button title" + }, + "searchPlaceholder": { + "message": "Search domain / username / alias", + "description": "Search box placeholder" + }, + "noSearchResult": { + "message": "No matching results", + "description": "No search result hint" + }, "fillCurrentBtn": { "message": "Fill Current Page", "description": "Fill current page button" @@ -351,6 +363,10 @@ "message": "OK", "description": "Confirm button" }, + "okBtn": { + "message": "OK", + "description": "OK button (submit in dialog)" + }, "envWarnEmpty": { "message": "Environment name cannot be empty", "description": "Env name empty warning" diff --git a/_locales/zh_CN/messages.json b/_locales/zh_CN/messages.json index 8cd6070..2c30191 100644 --- a/_locales/zh_CN/messages.json +++ b/_locales/zh_CN/messages.json @@ -271,6 +271,18 @@ "message": "导入", "description": "导入按钮" }, + "searchBtnTitle": { + "message": "搜索", + "description": "搜索按钮 title" + }, + "searchPlaceholder": { + "message": "搜索域名 / 用户名 / 别名", + "description": "搜索框 placeholder" + }, + "noSearchResult": { + "message": "无匹配结果", + "description": "搜索无结果提示" + }, "fillCurrentBtn": { "message": "在当前页面填充", "description": "在当前页面填充按钮" @@ -351,6 +363,10 @@ "message": "确认", "description": "确认按钮" }, + "okBtn": { + "message": "确定", + "description": "确定按钮(弹窗内提交)" + }, "envWarnEmpty": { "message": "环境名称不能为空", "description": "环境名称为空警告" diff --git a/popup.css b/popup.css index 12da906..0213db5 100644 --- a/popup.css +++ b/popup.css @@ -18,10 +18,18 @@ body { padding: 16px; display: flex; flex-direction: column; - min-height: 100vh; + height: 100vh; + overflow-y: auto; box-sizing: border-box; } +header, +.add-section, +.current-section, +.footer { + flex-shrink: 0; +} + header h1 { font-size: 18px; text-align: center; @@ -166,6 +174,20 @@ h2 { margin-bottom: 0; } +/* 添加配置表单收起态:有配置时仅显示入口按钮 */ +#addEntryBtn { + display: none; +} +.add-section.collapsed #addEntryBtn { + display: block; +} +.add-section.collapsed .add-section-header, +.add-section.collapsed > .form-group, +.add-section.collapsed > .advanced-options, +.add-section.collapsed > #addBtn { + display: none; +} + #cancelEditBtn { padding: 4px 12px; } @@ -176,12 +198,67 @@ h2 { display: flex; flex-direction: column; min-height: 0; + position: relative; } .list-header { flex-shrink: 0; } +/* 图标按钮 */ +.btn-icon { + padding: 5px; + display: inline-flex; + align-items: center; + justify-content: center; + line-height: 0; +} + +/* 悬浮搜索框 */ +.search-box { + position: absolute; + top: 38px; + right: 0; + z-index: 50; + align-items: center; + gap: 4px; + background: #16213e; + border: 1px solid #0f3460; + border-radius: 6px; + padding: 6px 8px; + box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); + width: 220px; + box-sizing: border-box; +} + +.search-box:not([hidden]) { + display: flex; +} + +.search-box input { + flex: 1; + min-width: 0; + background: transparent; + border: none; + color: #e0e0e0; + font-size: 13px; + outline: none; +} + +.search-clear { + background: none; + border: none; + color: #888; + cursor: pointer; + font-size: 16px; + padding: 0 4px; + line-height: 1; +} + +.search-clear:hover { + color: #e94560; +} + .form-group { margin-bottom: 12px; } diff --git a/popup.html b/popup.html index 7aa83c0..2f291fa 100644 --- a/popup.html +++ b/popup.html @@ -43,6 +43,7 @@
+

添加域名配置

@@ -125,11 +126,22 @@

已配置域名

- - + + +
+
@@ -226,10 +238,13 @@