手機再補一批小的:設定 › 一般「電腦的外觀」(電腦的主題、聊天的顏色)和自己打時區;Bot 設定技能「全選/全不選」、模型可讀長度 400K;稽核「只看沒人看著時做的」。
- 一般:主題、聊天的顏色兩列放回來(標題「電腦的外觀」,處理函式原本就在,功能地圖的驗證步驟也一直在等它們——程式和規格對不上,這次對上);時區清單最後「其他時區…」可以打任何 IANA 名字。 - Bot 設定:技能標題旁「全選/全不選」(照大腦現在的清單整份送);模型可讀長度多 400K(跟電腦一樣)。 - 對話詳細資訊 › 稽核:「只看沒人看著時做的」(例行任務和別的 Bot 叫的),沒有時寫「最近 30 天沒有沒人看著時做的事。」。 - 功能地圖 settings.md(九列、電腦的外觀、其他時區)、profile.md、activity.md;FEATURES.md。 已驗證: cargo test 880 個全過;scratch 手機頁面:一般「電腦的外觀」主題選「深色」→ state theme Dark;時區「其他時區…」打 Europe/Berlin → state timezone Europe/Berlin;稽核勾「只看沒人看著時做的」→「最近 30 天沒有沒人看著時做的事。」,取消後回到全部。 未驗證: 技能「全選/全不選」(scratch 沒有技能,這一格不會出現)。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Uirha2uBHmbnuWBhNzjbJm
This commit is contained in:
parent
c8c84f971a
commit
806ac8a9f1
|
|
@ -2322,7 +2322,7 @@ computer_use_screenshot、click、mouse_move、mouse_button(按住/放開)
|
||||||
- 手機與帳號:直接連線的手機清單,可以登出別支手機;
|
- 手機與帳號:直接連線的手機清單,可以登出別支手機;
|
||||||
- 更新:版本和有沒有新版。
|
- 更新:版本和有沒有新版。
|
||||||
- 個人資料與用量:見「個人資料與用量」。
|
- 個人資料與用量:見「個人資料與用量」。
|
||||||
- 手機補上的(以前只有電腦有):搜尋聊天裡的訊息和檔名;Bot 設定的「執行步驟用的模型」「思考模式」;釘選的 Bot 在 ⋯ ›「更多…」往前、往後移,分區的 ⋯「往上移/往下移」;「匯出 Bot 檔案(.anybot)」「匯出文字記錄(.md)」「匯入 Bot 檔案」(iPhone 跳分享選單,可以存到「檔案」或 AirDrop);每個 Bot 各自的草稿(切換 Bot、關掉頁面都留著,存在這支手機);程式碼塊右上的「複製」;頁面 ⋯ 的「存成檔案(.md)」。
|
- 手機補上的(以前只有電腦有):搜尋聊天裡的訊息和檔名;Bot 設定的「執行步驟用的模型」「思考模式」;釘選的 Bot 在 ⋯ ›「更多…」往前、往後移,分區的 ⋯「往上移/往下移」;「匯出 Bot 檔案(.anybot)」「匯出文字記錄(.md)」「匯入 Bot 檔案」(iPhone 跳分享選單,可以存到「檔案」或 AirDrop);每個 Bot 各自的草稿(切換 Bot、關掉頁面都留著,存在這支手機);程式碼塊右上的「複製」;頁面 ⋯ 的「存成檔案(.md)」。之後又補:設定 › 一般「電腦的外觀」(電腦的主題、聊天的顏色)和「其他時區…」自己打;Bot 設定技能「全選/全不選」、模型可讀長度 400K;稽核的「只看沒人看著時做的」;首頁上面一排「日程」「工作流」「檔案」(見各節)。
|
||||||
- 看電腦畫面:
|
- 看電腦畫面:
|
||||||
- 「Bot 的電腦」每秒更新一次畫面;在休眠時按「叫醒」。
|
- 「Bot 的電腦」每秒更新一次畫面;在休眠時按「叫醒」。
|
||||||
- 「這台 Mac」要先在設定裡打開才會出現。
|
- 「這台 Mac」要先在設定裡打開才會出現。
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
- `activity-who` 誰發起:「你」、「例行任務」(例行任務和 ⏰ 提醒叫醒的那一輪)、「別的 Bot」(「[來自 Bot]」開頭的那一輪)。
|
- `activity-who` 誰發起:「你」、「例行任務」(例行任務和 ⏰ 提醒叫醒的那一輪)、「別的 Bot」(「[來自 Bot]」開頭的那一輪)。
|
||||||
- `activity-evidence` 做了什麼:看了(打開的網址、web_fetch、讀的檔案、看的資料夾(空的寫「工作資料夾」)、搜尋、找文件或記憶、讀的頁面)、寫了(改的檔案、寫的頁面、下載的檔案、存成的 PDF)、執行了(指令、網頁腳本,太長的截短),各自不重複、最多 12 項;工具各幾次;被拒絕或失敗的步數;從開始到最後一步結束花多久。
|
- `activity-evidence` 做了什麼:看了(打開的網址、web_fetch、讀的檔案、看的資料夾(空的寫「工作資料夾」)、搜尋、找文件或記憶、讀的頁面)、寫了(改的檔案、寫的頁面、下載的檔案、存成的 PDF)、執行了(指令、網頁腳本,太長的截短),各自不重複、最多 12 項;工具各幾次;被拒絕或失敗的步數;從開始到最後一步結束花多久。
|
||||||
- `activity-panel` 電腦版:右側面板「動態」最上面「操作紀錄」,最近 8 輪,每輪一張:時間 · 誰 · 結果(完成/停止/失敗/進行中),開頭那句話,「N 步 · 看了 a · 寫了 b · 執行 c · 失敗 d · 花多久」(有失敗的那行字是紅的);點一下展開看了、寫了、執行了的清單和每個工具的次數。「只看沒人看著時做的」只留例行任務和別的 Bot 叫的。面板開著時每 5 秒重讀;螢幕電腦向大腦要(`api/sync/audit/<Bot>`)。
|
- `activity-panel` 電腦版:右側面板「動態」最上面「操作紀錄」,最近 8 輪,每輪一張:時間 · 誰 · 結果(完成/停止/失敗/進行中),開頭那句話,「N 步 · 看了 a · 寫了 b · 執行 c · 失敗 d · 花多久」(有失敗的那行字是紅的);點一下展開看了、寫了、執行了的清單和每個工具的次數。「只看沒人看著時做的」只留例行任務和別的 Bot 叫的。面板開著時每 5 秒重讀;螢幕電腦向大腦要(`api/sync/audit/<Bot>`)。
|
||||||
- `activity-phone` 手機「稽核」:每一輪最上面一列「你發起 · 2 分 13 秒 · 失敗 1 步」,下面「看了:…、寫了:…、執行了:…」(各前 4 項,多的寫「等 N 項」),再來是原本每一步的清單。
|
- `activity-phone` 手機「稽核」:每一輪最上面一列「你發起 · 2 分 13 秒 · 失敗 1 步」,下面「看了:…、寫了:…、執行了:…」(各前 4 項,多的寫「等 N 項」),再來是原本每一步的清單。最上面一格「只看沒人看著時做的」(跟電腦一樣,只留例行任務和別的 Bot 叫的;沒有時寫「最近 30 天沒有沒人看著時做的事。」)。
|
||||||
|
|
||||||
## 使用者怎麼到
|
## 使用者怎麼到
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
|
|
||||||
- Bot 選單(右鍵側邊欄的 Bot,或聊天右上角「更多」)›「編輯 Bot…」;或在右側面板點 Bot 的大頭像。視窗第一張卡是「Bot 資料」(頭像、名稱、描述),和下面的卡片同一種排版。
|
- Bot 選單(右鍵側邊欄的 Bot,或聊天右上角「更多」)›「編輯 Bot…」;或在右側面板點 Bot 的大頭像。視窗第一張卡是「Bot 資料」(頭像、名稱、描述),和下面的卡片同一種排版。
|
||||||
- 在聊天裡請 Bot 改自己(「把你的檔案與指令能力關掉」)。
|
- 在聊天裡請 Bot 改自己(「把你的檔案與指令能力關掉」)。
|
||||||
- 手機:聊天標題 › 對話詳細資訊 › 右上角「Bot 設定」,沒有自訂色盤([phone](phone.md));「AI 與電腦」有「執行步驟用的模型」(自動/不分開/同一家的其他模型)和「思考模式」(自動、快速、平衡、深入),跟電腦一樣。
|
- 手機:聊天標題 › 對話詳細資訊 › 右上角「Bot 設定」,沒有自訂色盤([phone](phone.md));「AI 與電腦」有「執行步驟用的模型」(自動/不分開/同一家的其他模型)和「思考模式」(自動、快速、平衡、深入),跟電腦一樣;技能標題旁「全選/全不選」;模型可讀長度有 400K。
|
||||||
|
|
||||||
## 怎麼操作(verify-anybot)
|
## 怎麼操作(verify-anybot)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -52,7 +52,7 @@
|
||||||
- **搜尋設定**(covers `settings-search`):前提:要開視窗。指令:`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot set-search ANYBOT_SHOT_TAB=general ANYBOT_SHOT_SIZE=1100x760 ANYBOT_SHOT_FRAMES=60 'ANYBOT_SHOT_CLICK=245,159@20' 'ANYBOT_SHOT_TYPE=自動@30'`;再跑兩次,加 `'ANYBOT_SHOT_KEYS=Enter@40'`、`ANYBOT_SHOT_FRAMES=66`:打 `時區@30`,和從更新頁(`ANYBOT_SHOT_TAB=updates`)打 `對比@30`。看到:「自動更新/電腦 › Bot 的電腦」「自動審核/權限」「自動更新/更新」;時區那次換到一般、捲到「Bot」下的「時區」,那列有強調色外框;對比那次「更多外觀設定」變「收起」、「對比」有外框。
|
- **搜尋設定**(covers `settings-search`):前提:要開視窗。指令:`$CTL stop && ABV_ALLOW_WINDOW=1 $CTL desktop-shot set-search ANYBOT_SHOT_TAB=general ANYBOT_SHOT_SIZE=1100x760 ANYBOT_SHOT_FRAMES=60 'ANYBOT_SHOT_CLICK=245,159@20' 'ANYBOT_SHOT_TYPE=自動@30'`;再跑兩次,加 `'ANYBOT_SHOT_KEYS=Enter@40'`、`ANYBOT_SHOT_FRAMES=66`:打 `時區@30`,和從更新頁(`ANYBOT_SHOT_TAB=updates`)打 `對比@30`。看到:「自動更新/電腦 › Bot 的電腦」「自動審核/權限」「自動更新/更新」;時區那次換到一般、捲到「Bot」下的「時區」,那列有強調色外框;對比那次「更多外觀設定」變「收起」、「對比」有外框。
|
||||||
- **Bot 改三樣**(covers `settings-by-bot`、`settings-general`):請 Bot 換深色、只用黑色、時區紐約,再傳一句。指令:`$CTL phone send '改 [[call update_settings {"theme":"dark","accent":"black","timezone":"America/New_York"}]]' && $CTL phone wait-text '時區 → America/New_York' --in '#msgs' && $CTL phone send 幾點 && $CTL phone wait-text 'FAKE-MODEL 回答:幾點' --in '#msgs' && $CTL model 'select(.kind == "turn") | .user' && TZ=America/New_York date +%H:%M`。看到:不用卡片,「已更新:主題 → dark、聊天的顏色 → black、時區 → America/New_York」;Bot 收到的〔送出時間〕是紐約時間。
|
- **Bot 改三樣**(covers `settings-by-bot`、`settings-general`):請 Bot 換深色、只用黑色、時區紐約,再傳一句。指令:`$CTL phone send '改 [[call update_settings {"theme":"dark","accent":"black","timezone":"America/New_York"}]]' && $CTL phone wait-text '時區 → America/New_York' --in '#msgs' && $CTL phone send 幾點 && $CTL phone wait-text 'FAKE-MODEL 回答:幾點' --in '#msgs' && $CTL model 'select(.kind == "turn") | .user' && TZ=America/New_York date +%H:%M`。看到:不用卡片,「已更新:主題 → dark、聊天的顏色 → black、時區 → America/New_York」;Bot 收到的〔送出時間〕是紐約時間。
|
||||||
- **錯的時區**(covers `settings-by-bot`):指令:`$CTL phone send '錯 [[call update_settings {"timezone":"Mars/Base"}]]' && $CTL phone wait-text '不是有效的時區名稱' --in '#msgs' && $CTL state .timezone`。看到:「「Mars/Base」不是有效的時區名稱(例如 Asia/Taipei)」;還是 America/New_York。
|
- **錯的時區**(covers `settings-by-bot`):指令:`$CTL phone send '錯 [[call update_settings {"timezone":"Mars/Base"}]]' && $CTL phone wait-text '不是有效的時區名稱' --in '#msgs' && $CTL state .timezone`。看到:「「Mars/Base」不是有效的時區名稱(例如 Asia/Taipei)」;還是 America/New_York。
|
||||||
- **手機的設定**(covers `settings-general`、`settings-account`、`settings-models`、`settings-integrations`、`settings-computers`、`settings-perms`、`settings-vault`、`settings-updates`):重新整理,帳戶選單 › 設定 › 一般。指令:`$CTL phone open --listed && $CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 設定 && $CTL phone wait '[data-go="updates"]' && $CTL phone shot settings-tabs && $CTL phone click '[data-go="general"]' && $CTL phone wait-text America/New_York --in '#list' && $CTL phone wait-text 只用黑色 --in '#list' && $CTL phone shot settings-general`。看到:八列(沒有語音);一般裡主題「深色」、聊天的顏色「只用黑色」、時區、通知、這支手機的外觀。
|
- **手機的設定**(covers `settings-general`、`settings-account`、`settings-models`、`settings-integrations`、`settings-computers`、`settings-perms`、`settings-vault`、`settings-updates`):重新整理,帳戶選單 › 設定 › 一般。指令:`$CTL phone open --listed && $CTL phone click '#b-me' && $CTL phone click '#sheet-in .opt' --text 設定 && $CTL phone wait '[data-go="updates"]' && $CTL phone shot settings-tabs && $CTL phone click '[data-go="general"]' && $CTL phone wait-text America/New_York --in '#list' && $CTL phone wait-text 只用黑色 --in '#list' && $CTL phone shot settings-general`。看到:九列(多了個人資料與用量;沒有語音);一般裡「電腦的外觀」主題「深色」、聊天的顏色「只用黑色」,時區(最後一項「其他時區…」自己打)、通知、這支手機的外觀。
|
||||||
- **桌面每個分頁、Bot 設定**(covers `settings-voice`、`settings-bot`、`settings-account`、`settings-computers`):每個分頁和 Bot 設定。指令:要開視窗——`$CTL stop && (for t in general remote providers channels computers review vault voice updates; do ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-$t ANYBOT_SHOT_TAB=$t || exit 1; done) && ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-bot ANYBOT_SHOT_VIEW=editor`。看到:各分頁的區塊照上面順序;Bot 設定最下面「儲存」。問候照時區(紐約晚上「晚上好」)也只在桌面。
|
- **桌面每個分頁、Bot 設定**(covers `settings-voice`、`settings-bot`、`settings-account`、`settings-computers`):每個分頁和 Bot 設定。指令:要開視窗——`$CTL stop && (for t in general remote providers channels computers review vault voice updates; do ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-$t ANYBOT_SHOT_TAB=$t || exit 1; done) && ABV_ALLOW_WINDOW=1 $CTL desktop-shot settings-bot ANYBOT_SHOT_VIEW=editor`。看到:各分頁的區塊照上面順序;Bot 設定最下面「儲存」。問候照時區(紐約晚上「晚上好」)也只在桌面。
|
||||||
- 自動測試:`cargo test app::settings_find::`(設定頁畫的每個區塊和列都要在搜尋的清單裡)、`cargo test stats::`、`cargo test featuremap::`(每個分頁和區塊標題、Bot 能改的設定都要在這份)、`cargo test appctl::`、`cargo test policy::`、`cargo test the_greeting_follows_the_timezone_setting`、`cargo test layout_audit::`(每個分頁、Bot 設定、例行任務、右側面板,用三種字型、最窄和一般的視窗、示範和很長的資料畫:字被切、疊在一起,或對話框被撐得比標題列寬就失敗)。
|
- 自動測試:`cargo test app::settings_find::`(設定頁畫的每個區塊和列都要在搜尋的清單裡)、`cargo test stats::`、`cargo test featuremap::`(每個分頁和區塊標題、Bot 能改的設定都要在這份)、`cargo test appctl::`、`cargo test policy::`、`cargo test the_greeting_follows_the_timezone_setting`、`cargo test layout_audit::`(每個分頁、Bot 設定、例行任務、右側面板,用三種字型、最窄和一般的視窗、示範和很長的資料畫:字被切、疊在一起,或對話框被撐得比標題列寬就失敗)。
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2919,11 +2919,15 @@ function tabBody(b, d) {
|
||||||
const a = S.audit[b.id];
|
const a = S.audit[b.id];
|
||||||
if (a === undefined) { loadAudit(b.id); return `<div class="note" style="padding:14px 16px">載入中…</div>`; }
|
if (a === undefined) { loadAudit(b.id); return `<div class="note" style="padding:14px 16px">載入中…</div>`; }
|
||||||
if (!a.turns.length) return `<div class="empty">最近 30 天沒有工作紀錄。</div>`;
|
if (!a.turns.length) return `<div class="empty">最近 30 天沒有工作紀錄。</div>`;
|
||||||
|
// 只看沒人看著時做的 (as on the computer): the turns a routine or another bot started.
|
||||||
|
const alone = !!S.auditAlone, turns = alone ? a.turns.filter((t) => t.who && t.who !== "person") : a.turns;
|
||||||
const OUT = {completed: "已結束", aborted: "被你停止", failed: "失敗"};
|
const OUT = {completed: "已結束", aborted: "被你停止", failed: "失敗"};
|
||||||
const ST = {done: "完成", running: "進行中…", waiting: "等核准", denied: "沒有完成(拒絕或停止)", failed: "失敗"};
|
const ST = {done: "完成", running: "進行中…", waiting: "等核准", denied: "沒有完成(拒絕或停止)", failed: "失敗"};
|
||||||
const TI = {computer: "zap", menu_click: "zap", fill_form: "zap", wait_for: "clock", run_cmd: "zap", web_fetch: "globe", browser: "globe"};
|
const TI = {computer: "zap", menu_click: "zap", fill_form: "zap", wait_for: "clock", run_cmd: "zap", web_fetch: "globe", browser: "globe"};
|
||||||
let h = "";
|
let h = "";
|
||||||
for (const t of [...a.turns].reverse()) {
|
h += `<div class="form" style="padding-bottom:0"><label style="display:flex;align-items:center;gap:8px;font-size:var(--fs-small);color:var(--text2)"><input type="checkbox" data-alone ${alone ? "checked" : ""}> 只看沒人看著時做的(例行任務和別的 Bot 叫它做的)</label></div>`;
|
||||||
|
if (!turns.length) h += `<div class="empty">最近 30 天沒有沒人看著時做的事。</div>`;
|
||||||
|
for (const t of [...turns].reverse()) {
|
||||||
const steps = t.steps.map((x) => {
|
const steps = t.steps.map((x) => {
|
||||||
if (x.type === "model") return item({icon: "sparkles", k: x.step === "assistant" ? "問模型" : x.step === "compaction" ? "整理長對話" : x.step, v: x.attempts > 1 ? `試了 ${x.attempts} 次(有重試)` : ""});
|
if (x.type === "model") return item({icon: "sparkles", k: x.step === "assistant" ? "問模型" : x.step === "compaction" ? "整理長對話" : x.step, v: x.attempts > 1 ? `試了 ${x.attempts} 次(有重試)` : ""});
|
||||||
if (x.type === "tool") return item({icon: TI[x.name] || "zap", k: x.name, v: (x.args || "").slice(0, 200), r: ST[x.status] || x.status});
|
if (x.type === "tool") return item({icon: TI[x.name] || "zap", k: x.name, v: (x.args || "").slice(0, 200), r: ST[x.status] || x.status});
|
||||||
|
|
@ -2991,6 +2995,7 @@ function wireDetails(b, d) {
|
||||||
else if (k === "mac") go("screen");
|
else if (k === "mac") go("screen");
|
||||||
});
|
});
|
||||||
on("[data-forget]", async (x) => { if (await app("forget", {what: x.dataset.forget}, b.id)) renderDetails(b.id, S.tab); });
|
on("[data-forget]", async (x) => { if (await app("forget", {what: x.dataset.forget}, b.id)) renderDetails(b.id, S.tab); });
|
||||||
|
el.querySelectorAll("[data-alone]").forEach((x) => x.onchange = () => { S.auditAlone = x.checked; renderDetails(b.id, S.tab); });
|
||||||
on("[data-sg]", (x) => { const s = SUGGEST[+x.dataset.sg]; back(); setTimeout(() => { input.value = s[3]; input.focus(); input.dispatchEvent(new Event("input")); }, 60); });
|
on("[data-sg]", (x) => { const s = SUGGEST[+x.dataset.sg]; back(); setTimeout(() => { input.value = s[3]; input.focus(); input.dispatchEvent(new Event("input")); }, 60); });
|
||||||
on("[data-rt]", (x) => routineSheet(b, (d.routines || []).find((r) => r.id === +x.dataset.rt)));
|
on("[data-rt]", (x) => routineSheet(b, (d.routines || []).find((r) => r.id === +x.dataset.rt)));
|
||||||
on("[data-mem]", (x) => oneAtATime(async () => {
|
on("[data-mem]", (x) => oneAtATime(async () => {
|
||||||
|
|
@ -3215,7 +3220,7 @@ async function renderBotset(id) {
|
||||||
let d = S.detail[id] || await loadDetail(id) || {};
|
let d = S.detail[id] || await loadDetail(id) || {};
|
||||||
if (cur().v !== "botset") return;
|
if (cur().v !== "botset") return;
|
||||||
const st = S.settings || {};
|
const st = S.settings || {};
|
||||||
const CTX = [[32000, "32K"], [64000, "64K"], [128000, "128K"], [200000, "200K"], [1000000, "1M"]];
|
const CTX = [[32000, "32K"], [64000, "64K"], [128000, "128K"], [200000, "200K"], [400000, "400K"], [1000000, "1M"]];
|
||||||
// Shown from a copy kept from before: read anew first, then it can be changed.
|
// Shown from a copy kept from before: read anew first, then it can be changed.
|
||||||
const held = !isNew(id);
|
const held = !isNew(id);
|
||||||
let h = `<div class="hero">${face(b, "lg")}<div class="n">${esc(b.name)}</div>${held ? `<div class="d">顯示的是上次的設定,讀到最新的才能改</div>` : ""}</div>`;
|
let h = `<div class="hero">${face(b, "lg")}<div class="n">${esc(b.name)}</div>${held ? `<div class="d">顯示的是上次的設定,讀到最新的才能改</div>` : ""}</div>`;
|
||||||
|
|
@ -3224,7 +3229,7 @@ async function renderBotset(id) {
|
||||||
h += group("個人檔案", item({k: "擅長", v: d.strengths || "還沒有寫(同事會看到,知道什麼事找它)", tap: 1, data: 'data-e="strengths"'}) + item({k: "不找它做的事", v: d.not_for || "還沒有寫", tap: 1, data: 'data-e="not_for"'}));
|
h += group("個人檔案", item({k: "擅長", v: d.strengths || "還沒有寫(同事會看到,知道什麼事找它)", tap: 1, data: 'data-e="strengths"'}) + item({k: "不找它做的事", v: d.not_for || "還沒有寫", tap: 1, data: 'data-e="not_for"'}));
|
||||||
const ticks = (title, key, list, note) => (list || []).length ? group(title, list.map((x) => item({k: x.name, v: x.note || "", sw: !!x.on, swdata: `data-tick="${key}" data-key="${esc(x.key)}"`, disabled: !!x.fixed})).join("") + (note ? `<div class="note" style="padding:8px 16px">${note}</div>` : "")) : "";
|
const ticks = (title, key, list, note) => (list || []).length ? group(title, list.map((x) => item({k: x.name, v: x.note || "", sw: !!x.on, swdata: `data-tick="${key}" data-key="${esc(x.key)}"`, disabled: !!x.fixed})).join("") + (note ? `<div class="note" style="padding:8px 16px">${note}</div>` : "")) : "";
|
||||||
h += ticks("能力", "abilities", d.abilities, "沒勾的工具不會給它,也不佔它每一輪的字數。");
|
h += ticks("能力", "abilities", d.abilities, "沒勾的工具不會給它,也不佔它每一輪的字數。");
|
||||||
h += ticks("會的技能", "skills", d.skills, "");
|
h += ticks("會的技能", "skills", d.skills, "") .replace(/^(<div class="gt">會的技能)/, `$1<button data-allsk="1" style="margin-left:auto">${(d.skills || []).every((x) => x.on) ? "全不選" : "全選"}</button>`);
|
||||||
h += ticks("可以用的電腦", "may_use", (d.may_use || []).length > 1 ? d.may_use : [], "它自己的電腦一定可以用。");
|
h += ticks("可以用的電腦", "may_use", (d.may_use || []).length > 1 ? d.may_use : [], "它自己的電腦一定可以用。");
|
||||||
}
|
}
|
||||||
h += `<div class="gt">頭像</div><div class="group"><div class="shapes">${(st.shapes || []).map((s) => `<button data-shape="${s}" class="${s === d.shape ? "on" : ""}">${avatarSvg(s, b.color)}</button>`).join("")}</div><div class="colors">${(st.colors || []).map((c) => `<button data-color="${c.key}" title="${esc(c.name)}" class="${c.key === d.color ? "on" : ""}" style="background:${c.hex}"></button>`).join("")}</div></div>`;
|
h += `<div class="gt">頭像</div><div class="group"><div class="shapes">${(st.shapes || []).map((s) => `<button data-shape="${s}" class="${s === d.shape ? "on" : ""}">${avatarSvg(s, b.color)}</button>`).join("")}</div><div class="colors">${(st.colors || []).map((c) => `<button data-color="${c.key}" title="${esc(c.name)}" class="${c.key === d.color ? "on" : ""}" style="background:${c.hex}"></button>`).join("")}</div></div>`;
|
||||||
|
|
@ -3245,6 +3250,13 @@ async function renderBotset(id) {
|
||||||
el.querySelectorAll("[data-shape]").forEach((x) => x.onclick = async () => { if (await act("bot", {bot: id, key: "shape", value: x.dataset.shape}, false)) refresh(); });
|
el.querySelectorAll("[data-shape]").forEach((x) => x.onclick = async () => { if (await act("bot", {bot: id, key: "shape", value: x.dataset.shape}, false)) refresh(); });
|
||||||
el.querySelectorAll("[data-color]").forEach((x) => x.onclick = async () => { if (await act("bot", {bot: id, key: "color", value: x.dataset.color}, false)) refresh(); });
|
el.querySelectorAll("[data-color]").forEach((x) => x.onclick = async () => { if (await act("bot", {bot: id, key: "color", value: x.dataset.color}, false)) refresh(); });
|
||||||
el.querySelectorAll("[data-rule]").forEach((x) => x.onclick = async () => { if (await act("bot", {bot: id, key: "allow_remove", value: x.dataset.rule}, "已移除")) refresh(); });
|
el.querySelectorAll("[data-rule]").forEach((x) => x.onclick = async () => { if (await act("bot", {bot: id, key: "allow_remove", value: x.dataset.rule}, "已移除")) refresh(); });
|
||||||
|
// 技能:全選/全不選 at once (the brain's list as it is now, all on or all off).
|
||||||
|
el.querySelectorAll("[data-allsk]").forEach((x) => x.onclick = () => oneAtATime(async () => {
|
||||||
|
const now = await freshDetail(id);
|
||||||
|
if (!now) { toast("連上後才能改"); return; }
|
||||||
|
const all = (now.skills || []).every((y) => y.on);
|
||||||
|
if (await act("bot", {bot: id, key: "skills", value: all ? [] : (now.skills || []).map((y) => y.key)}, all ? "技能都不帶了" : "技能都帶上了")) { delete S.detail[id]; refresh(); }
|
||||||
|
}));
|
||||||
el.querySelectorAll("[data-tick]").forEach((x) => x.onchange = () => oneAtATime(async () => {
|
el.querySelectorAll("[data-tick]").forEach((x) => x.onchange = () => oneAtATime(async () => {
|
||||||
// (The whole ticked list goes: the app keeps "all of them" as no list at all.)
|
// (The whole ticked list goes: the app keeps "all of them" as no list at all.)
|
||||||
// (Built on the brain's list as it is now, with only this tick changed: never a list read
|
// (Built on the brain's list as it is now, with only this tick changed: never a list read
|
||||||
|
|
@ -3648,7 +3660,9 @@ function drawSettings(kind, quiet) {
|
||||||
}
|
}
|
||||||
if (kind === "general") {
|
if (kind === "general") {
|
||||||
st.accent = ({Quiet: "quiet", BotColor: "bot_color", Black: "black"})[st.accent] || st.accent;
|
st.accent = ({Quiet: "quiet", BotColor: "bot_color", Black: "black"})[st.accent] || st.accent;
|
||||||
// (The computer's own 主題 and 聊天的顏色 are set on the computer; this phone has its own 外觀 below.)
|
// The computer's 主題 and 聊天的顏色 (the phone follows them unless its own 外觀 says otherwise).
|
||||||
|
const ACC = {quiet: "安靜(淡灰泡泡)", bot_color: "跟著 Bot", black: "只用黑色"};
|
||||||
|
if (isOwner()) h += group("電腦的外觀", item({icon: "moon", k: "主題", r: ({system: "跟隨系統", light: "淺色", dark: "深色"})[st.theme] || "跟隨系統", tap: 1, data: 'data-s="theme"'}) + item({icon: "message", k: "聊天的顏色", r: ACC[st.accent || "quiet"] || "", tap: 1, data: 'data-s="accent"'}));
|
||||||
h += group("", item({icon: "globe", k: "時區", r: st.timezone || "", tap: 1, data: 'data-s="tz"'}) + item({icon: "bell", k: "通知總開關", v: "Bot 做完或等你時通知,電腦和手機都算;關掉就都不通知", sw: !!st.notify, swdata: 'data-sset="notify"', disabled: !isOwner()}));
|
h += group("", item({icon: "globe", k: "時區", r: st.timezone || "", tap: 1, data: 'data-s="tz"'}) + item({icon: "bell", k: "通知總開關", v: "Bot 做完或等你時通知,電腦和手機都算;關掉就都不通知", sw: !!st.notify, swdata: 'data-sset="notify"', disabled: !isOwner()}));
|
||||||
h += group("這支手機", item({icon: "smartphone", k: "外觀", r: (THEMES.find((t) => t[0] === phoneTheme()) || THEMES[0])[1], tap: 1, data: 'data-s="phonetheme"'}));
|
h += group("這支手機", item({icon: "smartphone", k: "外觀", r: (THEMES.find((t) => t[0] === phoneTheme()) || THEMES[0])[1], tap: 1, data: 'data-s="phonetheme"'}));
|
||||||
}
|
}
|
||||||
|
|
@ -3888,7 +3902,9 @@ function wireSettings(kind, st) {
|
||||||
else if (k === "accent") sheet("聊天的顏色", [["quiet", "安靜(淡灰泡泡)"], ["bot_color", "跟著 Bot"], ["black", "只用黑色"]].map(([v, n]) => ({label: n, check: (st.accent || "quiet") === v, on: async () => { if (await app("update_settings", {accent: v})) again(); }})));
|
else if (k === "accent") sheet("聊天的顏色", [["quiet", "安靜(淡灰泡泡)"], ["bot_color", "跟著 Bot"], ["black", "只用黑色"]].map(([v, n]) => ({label: n, check: (st.accent || "quiet") === v, on: async () => { if (await app("update_settings", {accent: v})) again(); }})));
|
||||||
else if (k === "tz") {
|
else if (k === "tz") {
|
||||||
const zones = [...new Set([TZ, "Asia/Taipei", "Asia/Tokyo", "Asia/Shanghai", "Asia/Hong_Kong", "Asia/Singapore", "Europe/London", "America/New_York", "America/Los_Angeles", "UTC"].filter(Boolean))];
|
const zones = [...new Set([TZ, "Asia/Taipei", "Asia/Tokyo", "Asia/Shanghai", "Asia/Hong_Kong", "Asia/Singapore", "Europe/London", "America/New_York", "America/Los_Angeles", "UTC"].filter(Boolean))];
|
||||||
sheet("時區", zones.map((z) => ({label: z + (z === TZ ? "(這支手機)" : ""), check: st.timezone === z, on: async () => { if (await app("update_settings", {timezone: z})) again(); }})));
|
sheet("時區", zones.map((z) => ({label: z + (z === TZ ? "(這支手機)" : ""), check: st.timezone === z, on: async () => { if (await app("update_settings", {timezone: z})) again(); }}))
|
||||||
|
// (Any IANA name, as on the computer: Europe/Berlin, Australia/Sydney…)
|
||||||
|
.concat([{icon: "pen", label: "其他時區…", on: async () => { const z = await ask("時區(例如 Europe/Berlin)", st.timezone || ""); if (z && z !== st.timezone && await app("update_settings", {timezone: z.trim()})) again(); }}]));
|
||||||
}
|
}
|
||||||
else if (k === "phonetheme") sheet("這支手機的外觀", THEMES.map(([v, n]) => ({label: n, check: phoneTheme() === v, on: () => { try { localStorage.setItem("anybot.theme", v); } catch (_) {} applyTheme(); drawSettings(kind, true); }})));
|
else if (k === "phonetheme") sheet("這支手機的外觀", THEMES.map(([v, n]) => ({label: n, check: phoneTheme() === v, on: () => { try { localStorage.setItem("anybot.theme", v); } catch (_) {} applyTheme(); drawSettings(kind, true); }})));
|
||||||
else if (k === "push") notifySheet();
|
else if (k === "push") notifySheet();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue