新增配置页一键清除并保留 DeepSeek 密钥
This commit is contained in:
+74
-24
@@ -14,6 +14,8 @@
|
||||
--tint: #e5f0e8;
|
||||
--line: #cbd7ce;
|
||||
--alert: #863c15;
|
||||
--danger: #9a342b;
|
||||
--danger-tint: #f7e9e6;
|
||||
font: 16px/1.55 system-ui, "Microsoft YaHei", "PingFang SC", sans-serif;
|
||||
color: var(--ink);
|
||||
background: #e8ede6;
|
||||
@@ -177,6 +179,9 @@
|
||||
background: var(--green);
|
||||
}
|
||||
|
||||
.action.danger { color: var(--danger); background: var(--danger-tint); }
|
||||
.action.primary.danger { color: #fff; background: var(--danger); }
|
||||
|
||||
.action[aria-disabled="true"] {
|
||||
color: #fff;
|
||||
background: #668b7a;
|
||||
@@ -425,6 +430,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<button type="button" class="action primary" id="save-preview">保存配置</button>
|
||||
<div class="card" style="margin-top: 12px">
|
||||
<h3>本机数据</h3>
|
||||
<button type="button" class="action danger" id="reset-preview">一键清除所有已保存数据</button>
|
||||
</div>
|
||||
<p id="library-status" role="status" hidden></p>
|
||||
</div>
|
||||
<nav class="app-nav" aria-label="配置页导航">
|
||||
@@ -442,7 +451,8 @@
|
||||
<div class="phone-content">
|
||||
<div class="card">
|
||||
<h3>运行日志</h3>
|
||||
<ul class="entries">
|
||||
<p id="empty-log" hidden>启动任务后会在这里显示运行步骤。</p>
|
||||
<ul class="entries" id="log-entries">
|
||||
<li><time datetime="2026-11-26T12:56:05+08:00">11-26 12:56:05</time> 运行 任务完成 · 处理 1 条 · 确认发送 1 条</li>
|
||||
<li><time datetime="2026-11-26T12:56:05+08:00">11-26 12:56:05</time> 运行 第 1 条视频已确认 1/1 条回复</li>
|
||||
<li class="warning"><time datetime="2026-11-25T15:22:14+08:00">11-25 15:22:14</time> 异常 抖音评论未回读到完整内容或未看到唯一发送按钮</li>
|
||||
@@ -483,6 +493,14 @@
|
||||
<button type="button" class="action primary" id="delete-confirm">删除</button>
|
||||
</div>
|
||||
</dialog>
|
||||
<dialog id="reset-dialog" aria-labelledby="reset-title" aria-describedby="reset-message">
|
||||
<h2 id="reset-title">清除所有已保存数据?</h2>
|
||||
<p id="reset-message">将清除拾见本机保存的配置、内容库、绑定图片、任务检查点和运行日志。DeepSeek 密钥会保留。清除后恢复默认设置,此操作无法撤销。</p>
|
||||
<div class="library-actions">
|
||||
<button type="button" class="action" id="reset-cancel" autofocus>取消</button>
|
||||
<button type="button" class="action primary danger" id="reset-confirm">清除数据</button>
|
||||
</div>
|
||||
</dialog>
|
||||
<script>
|
||||
const byId = id => document.getElementById(id);
|
||||
const scope = byId("search-scope");
|
||||
@@ -495,6 +513,7 @@
|
||||
const phrasePicker = byId("reply-phrase");
|
||||
const editDialog = byId("library-editor");
|
||||
const deleteDialog = byId("library-delete");
|
||||
const resetDialog = byId("reset-dialog");
|
||||
const singleLine = byId("library-value");
|
||||
const multiLine = byId("library-phrase-text");
|
||||
const editError = byId("library-error");
|
||||
@@ -700,33 +719,64 @@
|
||||
for (const picker of [platformPicker, replyMode, bilibiliScope]) {
|
||||
picker.addEventListener("change", updateCommentSettings);
|
||||
}
|
||||
byId("save-preview").addEventListener("click", () => {
|
||||
function updateTaskPreview() {
|
||||
const platform = platformPicker.selectedOptions[0];
|
||||
const unit = platform.dataset.unit;
|
||||
const limit = byId("video-limit").valueAsNumber;
|
||||
const selectedType = pick(types, scope);
|
||||
const searchTypes = selectedType ? [selectedType] : types;
|
||||
const type = byId("task-content-type");
|
||||
const progress = byId("task-progress");
|
||||
const modeLabel = bilibiliScopeField.hidden ? replyMode.value : bilibiliScope.selectedOptions[0].text;
|
||||
const confirmedLabel = !bilibiliScopeField.hidden && bilibiliScope.value === "VIDEO_COMMENT" ? "已确认发布评论" : "已确认回复";
|
||||
byId("task-mode").textContent = `${platform.text} · ${modeLabel}`;
|
||||
byId("task-scope").textContent = `内容类型 ${searchTypes.length} 个 · 单次 ${limit} 个${unit}`;
|
||||
byId("task-summary").textContent = `已处理${unit} 0 / ${limit} · ${confirmedLabel} 0 条`;
|
||||
progress.max = limit;
|
||||
progress.value = 0;
|
||||
progress.setAttribute("aria-label", `已处理 0 个${unit},共 ${limit} 个`);
|
||||
type.hidden = searchTypes.length === 0;
|
||||
type.textContent = searchTypes.length ? `内容类型 · ${searchTypes[0].name}` : "";
|
||||
}
|
||||
function showConfigStatus(message, invalid) {
|
||||
const status = byId("library-status");
|
||||
const invalid = [byId("video-limit"), byId("replies-per-video")].find(input => !input.validity.valid);
|
||||
const error = invalid ? `${invalid.labels[0].textContent}须为 1–100 的整数。` : "";
|
||||
if (!error) {
|
||||
const platform = platformPicker.selectedOptions[0];
|
||||
const unit = platform.dataset.unit;
|
||||
const limit = byId("video-limit").valueAsNumber;
|
||||
const selectedType = pick(types, scope);
|
||||
const searchTypes = selectedType ? [selectedType] : types;
|
||||
const type = byId("task-content-type");
|
||||
const progress = byId("task-progress");
|
||||
const modeLabel = bilibiliScopeField.hidden ? replyMode.value : bilibiliScope.selectedOptions[0].text;
|
||||
const confirmedLabel = !bilibiliScopeField.hidden && bilibiliScope.value === "VIDEO_COMMENT" ? "已确认发布评论" : "已确认回复";
|
||||
byId("task-mode").textContent = `${platform.text} · ${modeLabel}`;
|
||||
byId("task-scope").textContent = `内容类型 ${searchTypes.length} 个 · 单次 ${limit} 个${unit}`;
|
||||
byId("task-summary").textContent = `已处理${unit} 0 / ${limit} · ${confirmedLabel} 0 条`;
|
||||
progress.max = limit;
|
||||
progress.setAttribute("aria-label", `已处理 0 个${unit},共 ${limit} 个`);
|
||||
type.hidden = searchTypes.length === 0;
|
||||
type.textContent = searchTypes.length ? `内容类型 · ${searchTypes[0].name}` : "";
|
||||
}
|
||||
status.textContent = error || "预览配置已更新。";
|
||||
status.classList.toggle("error", Boolean(error));
|
||||
status.textContent = message;
|
||||
status.classList.toggle("error", Boolean(invalid));
|
||||
status.hidden = false;
|
||||
invalid?.focus({ preventScroll: true });
|
||||
status.scrollIntoView({ block: "nearest", inline: "nearest" });
|
||||
}
|
||||
byId("save-preview").addEventListener("click", () => {
|
||||
const invalid = [byId("video-limit"), byId("replies-per-video")].find(input => !input.validity.valid);
|
||||
if (!invalid) updateTaskPreview();
|
||||
showConfigStatus(invalid ? `${invalid.labels[0].textContent}须为 1–100 的整数。` : "预览配置已更新。", invalid);
|
||||
});
|
||||
byId("reset-preview").addEventListener("click", () => resetDialog.showModal());
|
||||
byId("reset-cancel").addEventListener("click", () => resetDialog.close());
|
||||
byId("reset-confirm").addEventListener("click", () => {
|
||||
for (const type of types) {
|
||||
for (const rule of type.rules) {
|
||||
for (const phrase of rule.phrases) phrase.photos.forEach(photo => URL.revokeObjectURL(photo.url));
|
||||
}
|
||||
}
|
||||
types.length = 0;
|
||||
nextId = 0;
|
||||
editing = deleting = photoTarget = undefined;
|
||||
singleLine.value = multiLine.value = fileInput.value = "";
|
||||
for (const picker of [platformPicker, replyMode, bilibiliScope, scope]) picker.selectedIndex = 0;
|
||||
for (const input of [byId("video-limit"), byId("replies-per-video")]) input.value = input.defaultValue;
|
||||
const pending = byId("pending-receipt-preview");
|
||||
pending.open = false;
|
||||
pending.hidden = true;
|
||||
byId("log-entries").replaceChildren();
|
||||
byId("log-entries").hidden = true;
|
||||
byId("empty-log").hidden = false;
|
||||
resetDialog.close();
|
||||
setStatus();
|
||||
updateCommentSettings();
|
||||
redrawLibrary();
|
||||
updateTaskPreview();
|
||||
showConfigStatus("已清除所有已保存数据。");
|
||||
});
|
||||
updateCommentSettings();
|
||||
redrawLibrary();
|
||||
|
||||
+9
-1
@@ -1,6 +1,14 @@
|
||||
# 拾见开发进度
|
||||
|
||||
最近更新于 2026-11-27 16:05(UTC+8)。以下按开发轮次倒序记录。
|
||||
最近更新于 2026-11-27 16:35(UTC+8)。以下按开发轮次倒序记录。
|
||||
|
||||
## 2026-11-27 · 拾见 0.1.44 配置页一键清除
|
||||
|
||||
- 在「配置 → 本机数据」新增「一键清除所有已保存数据」。确认后恢复默认任务配置,清除内容库、导入的图片副本、应用创建的相册暂存、任务检查点和运行日志。已保存的 DeepSeek 密钥加密内容与原始相册图片保留。
|
||||
- 清除需在任务和图片导入停止后进行。点击取消会保留当前数据,确认后在后台清理并刷新当前页面,失败时可以重试。
|
||||
- 静态预览在 Chrome 的 1440 和 390 像素宽度通过验证,覆盖确认文案、取消、清除、恢复默认及重新保存。
|
||||
- vivo Android 12 使用独立安装的测试包验收。取消后配置、话术和绑定图、任务记录和日志均保留。确认后配置恢复默认,内容库、检查点、两代日志、导入图片及相册暂存均已清除。同一个测试密钥仍可解密,独立相册原图可正常读取。测试包和相册测试素材已移除,原装机版的配置和检查点文件校验一致。
|
||||
- 调试 APK 已离线生成并通过 v2 签名校验。74 项 JVM 单元测试通过,Lint 为 0 个错误、3 个既有警告。
|
||||
|
||||
## 2026-11-27 · 拾见 0.1.43 快手图片与视频真机闭环
|
||||
|
||||
|
||||
Reference in New Issue
Block a user