-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.html
More file actions
64 lines (61 loc) · 3.13 KB
/
Copy pathoptions.html
File metadata and controls
64 lines (61 loc) · 3.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<!doctype html>
<meta charset="utf-8" />
<title>immerse</title>
<style>
body { font: 14px/1.6 -apple-system, system-ui, sans-serif; padding: 24px; max-width: 460px }
input { width: 100%; padding: 8px; font: inherit; box-sizing: border-box }
button { margin-top: 10px; padding: 6px 16px; font: inherit }
p { color: #666 }
h3 { margin-top: 32px }
#msg { margin-left: 10px; color: #0a0 }
#count { color: #666 }
table { border-collapse: collapse; width: 100%; font-size: 13px }
th, td { text-align: right; padding: 5px 8px; border-bottom: 1px solid #eee }
th:first-child, td:first-child { text-align: left }
th { color: #888; font-weight: 500 }
tr.sum td { font-weight: 600; border-bottom: 0 }
#resetUsage { font-size: 12px; padding: 5px 12px }
</style>
<h2>immerse</h2>
<form id="f">
<label for="key">Anthropic API key</label>
<input id="key" type="password" placeholder="sk-ant-..." autocomplete="off" />
<button>Save</button><span id="msg"></span>
</form>
<p>Stored in <code>chrome.storage.local</code> in the clear — anything that can read this Chrome
profile can read the key.</p>
<h3>LLM 用量</h3>
<p>模型 <code id="model">—</code>,自 <span id="since">—</span> 起累計。</p>
<table>
<thead><tr><th>用途</th><th>次數</th><th>輸入</th><th>輸出</th><th>估計花費</th></tr></thead>
<tbody id="usage"></tbody>
</table>
<p id="nomodel" hidden>這個模型沒有價格資料,只顯示 token 數。改模型時要一併更新
<code>options.js</code> 的 <code>PRICES</code>。</p>
<button id="resetUsage">歸零</button>
<h3>雲端同步(GitHub)</h3>
<form id="gh">
<label for="ghRepo">Private repo(owner/名稱)</label>
<input id="ghRepo" placeholder="SIMPLYBOYS/immerse-data" autocomplete="off" />
<label for="ghToken" style="display:block;margin-top:8px">Fine-grained token(只需該 repo 的
Contents 讀寫權限)</label>
<input id="ghToken" type="password" placeholder="github_pat_..." autocomplete="off" />
<button>Save</button><span id="ghMsg"></span>
</form>
<p id="syncStatus">未連結。</p>
<button id="syncConnect">連結並開始同步</button>
<button id="syncNow" hidden>立即上傳</button>
<button id="syncRestore" hidden>從雲端還原</button>
<button id="syncOff" hidden>停用同步</button>
<p>學習資料(詞彙、標記、每日紀錄)鏡像到你自己 private repo 裡的 <code>immerse-deck.json</code>,
資料改動後約 30 秒自動上傳,每次上傳是一個 commit(天然有版本史)。<strong>API key 與
token 永遠不會進入上傳內容</strong>。設定步驟見 repo 的 <code>docs/github-sync.md</code>;
Google Drive 後端保留於程式中,要切回改 <code>bg.js</code> 的 <code>BACKEND</code>。</p>
<h3>Export</h3>
<p id="count">…</p>
<button id="export">Export CSV</button>
<p>Six columns: word, what it meant in context (Chinese, then English), the general senses with example sentences, the
sentence it came from, and a link back to that moment in the video. In Anki:
<em>File → Import</em>, separator <strong>comma</strong>, map column 1 to Front and the rest to
whichever fields your note type has.</p>
<script src="options.js"></script>