driftnet 1.2.1 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +4 -3
- package/NOTICE +13 -0
- package/README.md +89 -80
- package/README.zh-TW.md +89 -79
- package/dist/driftnet.mjs +3172 -498
- package/package.json +4 -4
- package/public/index.html +254 -276
- package/public/locales/es.js +240 -0
- package/public/locales/ja.js +240 -0
- package/public/locales/ko.js +240 -0
- package/public/locales/zh-CN.js +235 -0
- package/public/locales/zh-TW.js +237 -0
- package/public/manifest.webmanifest +10 -1
- package/skills/driftnet/SKILL.md +2 -0
package/public/index.html
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover">
|
|
6
|
+
<meta name="generator" content="driftnet (https://github.com/KevinChu1110/driftnet)">
|
|
7
|
+
<meta name="author" content="Kevin Chu (KevinChu1110)">
|
|
6
8
|
<meta name="theme-color" content="#ffffff" media="(prefers-color-scheme: light)">
|
|
7
9
|
<meta name="theme-color" content="#1b1b1a" media="(prefers-color-scheme: dark)">
|
|
8
10
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
@@ -70,7 +72,7 @@
|
|
|
70
72
|
/* Browsing with a read-only share key: nothing that edits is offered. */
|
|
71
73
|
body.readonly .tools, body.readonly .link-btn[data-act="note"], body.readonly nav .more, body.readonly nav [data-new],
|
|
72
74
|
body.readonly .trash-bar, body.readonly .map-bar [data-map="new"], body.readonly #new-note, body.readonly .hint.swipe-hint { display: none !important; }
|
|
73
|
-
.lang { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer; min-height: 40px; }
|
|
75
|
+
.lang { border: 1px solid var(--line); background: var(--bg); color: var(--text); font-family: inherit; border-radius: 10px; padding: 8px 12px; font-size: 13px; cursor: pointer; min-height: 40px; }
|
|
74
76
|
.hbtn { display: inline-grid; place-items: center; padding: 8px 10px; min-width: 40px; }
|
|
75
77
|
body.readonly #add-btn { display: none; }
|
|
76
78
|
.add-q { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0 2px; font-size: 13px; color: var(--muted); }
|
|
@@ -336,6 +338,26 @@
|
|
|
336
338
|
.empty.first .tpl { display: grid; gap: 6px; justify-items: center; margin-top: 8px; }
|
|
337
339
|
.empty.first .tpl-row { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
|
|
338
340
|
.empty.first .btn { display: inline-flex; align-items: center; gap: 6px; }
|
|
341
|
+
#st-body.is-welcome .envname { display: none; }
|
|
342
|
+
.ai-detect { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 14px; background: var(--bg); display: grid; gap: 8px; }
|
|
343
|
+
.ai-detect-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
|
|
344
|
+
.ai-detect-head b { color: var(--text); font-weight: 600; }
|
|
345
|
+
.ai-detect-chips { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
346
|
+
.ai-detect .btn.compact { min-height: 32px; padding: 4px 10px; font-size: 12.5px; }
|
|
347
|
+
.ai-detect-hint { margin: 0; font-size: 12.5px; color: var(--muted); }
|
|
348
|
+
.ai-test-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 10px 0 4px; }
|
|
349
|
+
.ai-test-row .hint { margin: 0; }
|
|
350
|
+
#ai-test-out[data-state="ok"] { color: var(--ok); font-weight: 600; }
|
|
351
|
+
#ai-test-out[data-state="err"] { color: var(--danger); }
|
|
352
|
+
.onboard { width: min(680px, 100%); display: grid; gap: 14px; text-align: left; }
|
|
353
|
+
.onboard-head { text-align: center; }
|
|
354
|
+
.onboard-head h2 { margin: 0 0 4px; font-size: 18px; color: var(--text); }
|
|
355
|
+
.onboard-head p { margin: 0; font-size: 14px; color: var(--muted); }
|
|
356
|
+
.onboard-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 10px; }
|
|
357
|
+
.onboard-card { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 8px; align-content: start; }
|
|
358
|
+
.onboard-card h3 { margin: 0; font-size: 15px; color: var(--text); display: flex; align-items: center; gap: 6px; }
|
|
359
|
+
.onboard-card p { margin: 0; font-size: 13px; color: var(--muted); line-height: 1.5; }
|
|
360
|
+
.onboard-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 2px; }
|
|
339
361
|
@media (pointer: coarse) {
|
|
340
362
|
.mnode .opt { padding: 10px; margin: -6px -12px -6px 0; }
|
|
341
363
|
.meta .link-btn { min-height: 44px; }
|
|
@@ -433,6 +455,10 @@
|
|
|
433
455
|
.badge.health.stale, .badge.health.moved { background: var(--accent-soft); color: var(--muted); }
|
|
434
456
|
.stars { color: var(--star); }
|
|
435
457
|
.rating { font-size: 12px; color: var(--muted); white-space: nowrap; }
|
|
458
|
+
.rating-btn { all: unset; font-size: 12px; color: var(--accent); text-decoration: underline; cursor: pointer; white-space: nowrap; }
|
|
459
|
+
.rating-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
|
|
460
|
+
.ai-banner { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-bottom: 12px; background: var(--bg); font-size: 13px; }
|
|
461
|
+
.ai-banner span { flex: 1; min-width: 200px; }
|
|
436
462
|
.rating.must { color: var(--star); font-weight: 600; }
|
|
437
463
|
.rating .ico { width: 13px; height: 13px; fill: currentColor; vertical-align: -2px; margin-right: 2px; }
|
|
438
464
|
.worth-must-see { color: var(--star); }
|
|
@@ -505,14 +531,16 @@
|
|
|
505
531
|
main { padding: 12px 12px calc(40px + env(safe-area-inset-bottom)); gap: 10px; }
|
|
506
532
|
.card { padding: 13px 14px; }
|
|
507
533
|
.top { padding-right: 0; }
|
|
508
|
-
|
|
534
|
+
/* The tool row shares the meta line instead of adding a mostly empty row under every card. */
|
|
535
|
+
.tools { position: absolute; top: auto; right: 6px; bottom: 4px; margin: 0; }
|
|
536
|
+
.card .meta { padding-right: 184px; min-height: 44px; align-content: center; }
|
|
509
537
|
.card ul { padding-left: 18px; }
|
|
510
538
|
}
|
|
511
539
|
/* Card list: a thumbnail, the name, the one-liner and what you would see. Everything else lives in the modal. */
|
|
512
540
|
.card { cursor: pointer; }
|
|
513
541
|
.crow { display: flex; gap: 14px; align-items: flex-start; }
|
|
514
542
|
.cbody { flex: 1; min-width: 0; }
|
|
515
|
-
.thumb { position: relative; flex: 0 0 132px;
|
|
543
|
+
.thumb { position: relative; flex: 0 0 132px; aspect-ratio: 3 / 2; align-self: flex-start; border-radius: 10px; overflow: hidden; background: var(--bg); border: 1px solid var(--line); }
|
|
516
544
|
.thumb .more-pics { position: absolute; right: 6px; bottom: 6px; padding: 1px 7px; border-radius: 999px; background: rgb(0 0 0 / .62); color: #fff; font-size: 12px; font-weight: 600; }
|
|
517
545
|
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
518
546
|
.thumb .play, .g-slide .play { position: absolute; inset: 0; margin: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
|
|
@@ -565,7 +593,7 @@
|
|
|
565
593
|
.g-th.on { border-color: var(--accent); opacity: 1; }
|
|
566
594
|
.g-th img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
|
567
595
|
@media (max-width: 720px) {
|
|
568
|
-
.thumb { flex-basis: 96px;
|
|
596
|
+
.thumb { flex-basis: 96px; }
|
|
569
597
|
.crow { gap: 10px; }
|
|
570
598
|
dialog.mdl { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; border: 0; border-radius: 0; transition: transform .2s ease; }
|
|
571
599
|
.md-handle { display: block; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--line); }
|
|
@@ -576,6 +604,14 @@
|
|
|
576
604
|
}
|
|
577
605
|
@media (prefers-reduced-motion: reduce) { dialog.mdl { transition: none; } }
|
|
578
606
|
@media (prefers-reduced-motion: reduce) { .card, .swipe, .toast, nav, .scrim, nav .twist, .mnode, .mnode .tw, .tool { transition: none !important; } }
|
|
607
|
+
/* Touch: every tap target is at least 44px (WCAG 2.5.5). Last in the sheet so it wins over the base sizes above. */
|
|
608
|
+
@media (pointer: coarse) {
|
|
609
|
+
.btn, .keyrow .btn, .chip, .tabs button, select, .lang, .set-row input:not([type="checkbox"]), .hbtn, .crumb, .tool, .rating-btn, .hint.corrected button { min-height: 44px; }
|
|
610
|
+
.tool, .hbtn { min-width: 44px; }
|
|
611
|
+
.tool { width: 44px; height: 44px; }
|
|
612
|
+
.rating-btn { display: inline-flex; align-items: center; }
|
|
613
|
+
input[type="checkbox"] { width: 22px; height: 22px; }
|
|
614
|
+
}
|
|
579
615
|
</style>
|
|
580
616
|
</head>
|
|
581
617
|
<body>
|
|
@@ -629,7 +665,7 @@
|
|
|
629
665
|
<button id="add-btn" class="lang hbtn" type="button" aria-haspopup="dialog"></button>
|
|
630
666
|
<button id="palette-btn" class="lang" type="button" aria-haspopup="dialog"></button>
|
|
631
667
|
<button id="settings-btn" class="lang hbtn" type="button" aria-haspopup="dialog"></button>
|
|
632
|
-
<
|
|
668
|
+
<select id="lang" class="lang" aria-label="Language"><option value="en">EN</option><option value="zh-TW">繁中</option><option value="zh-CN">简中</option><option value="ja">日本語</option><option value="ko">한국어</option><option value="es">ES</option></select>
|
|
633
669
|
</header>
|
|
634
670
|
<button id="crumb" class="crumb" type="button" aria-controls="nav"></button>
|
|
635
671
|
<div class="scrim" id="scrim"></div>
|
|
@@ -758,13 +794,22 @@
|
|
|
758
794
|
<div class="toast" id="toast" role="status"><span id="toast-text"></span><button id="toast-undo" type="button"></button></div>
|
|
759
795
|
<script>
|
|
760
796
|
const cardsN = (n) => `${n} ${n === 1 ? "card" : "cards"}`;
|
|
797
|
+
const mergeLocale = (base, over) => {
|
|
798
|
+
const out = { ...base };
|
|
799
|
+
for (const [k, v] of Object.entries(over)) {
|
|
800
|
+
out[k] = v && typeof v === "object" && !Array.isArray(v) && base[k] && typeof base[k] === "object" && !Array.isArray(base[k])
|
|
801
|
+
? mergeLocale(base[k], v) : v;
|
|
802
|
+
}
|
|
803
|
+
return out;
|
|
804
|
+
};
|
|
761
805
|
const STRINGS = {
|
|
762
806
|
en: {
|
|
807
|
+
skip: "Skip to the cards", lgLabel: "Password", lgForgot: "Forgot it?",
|
|
763
808
|
search: "Search tools, tags, links…", all: "All", favorites: "Favorites", trash: "Trash", any: "Any",
|
|
764
809
|
kind: "Kind", switchTo: "中文", nav: "Views and categories",
|
|
765
810
|
stats: (n, s) => `${n} ${n === 1 ? "item" : "items"} · shared ${s}×`, shared: (n) => `shared ${n}×`,
|
|
766
811
|
empty: "Nothing here yet.", emptyStart: "Nothing here yet. Paste a link below to start — or save one with the Chrome extension, or run npx driftnet add <link>.",
|
|
767
|
-
noMatch: (q, v) => `No cards match “${q}” in ${v}.`, searchAll: "Search everything", searchIn: (v) => `Search ${v}…`,
|
|
812
|
+
noMatch: (q, v) => `No cards match “${q}” in ${v}.`, searchAll: "Search everything", clearSearch: "Clear search", searchIn: (v) => `Search ${v}…`,
|
|
768
813
|
showingFor: (c) => `Showing results for “${c}”`, searchInstead: (q) => `search for “${q}” instead`,
|
|
769
814
|
addTitle: "Add a link", addHelp: "A link to a tool, post or video (example.com works too)", addThis: (u) => `Add this link: ${u}`, kAdd: "Add a link",
|
|
770
815
|
addedAlready: "Already saved — here it is", addNothing: "No link found in that.", noSuggestion: "No suggestion for this card — press m to pick a folder", emptyFav: "No favorites yet — swipe a card right, or tap the star.",
|
|
@@ -773,7 +818,7 @@
|
|
|
773
818
|
kind1: { repo: "Repo", product: "Product", video: "Video", article: "Article", post: "Post", other: "Other" },
|
|
774
819
|
worth: { skip: "skip", low: "low", normal: "worth a look", "must-see": "must-see" },
|
|
775
820
|
flags: { injection: "prompt injection", "hidden-chars": "hidden characters", "low-reputation": "low-reputation source", "video-read": "read from video", "video-captions": "video captions", "video-ocr": "video on-screen text", "video-speech": "video speech", "video-watch": "watched by the model", "video-vision": "frames seen by the model" },
|
|
776
|
-
pending: "waiting for a summary", noModel: "no summary — no model set up", enrichedBy: (a) => `summary by ${a}`,
|
|
821
|
+
pending: "waiting for a summary", noModel: "no summary — no model set up", noModelTip: "Open Settings to enable a model for summaries", aiBannerText: "Summaries are off: no AI model is set up yet. Open Settings → AI to enable a model detected on this computer.", aiBannerOpen: "Set up AI", aiBannerDismiss: "Dismiss", enrichedBy: (a) => `summary by ${a}`,
|
|
777
822
|
favorite: "Add to favorites", unfavorite: "Remove from favorites", remove: "Move to trash", restore: "Restore",
|
|
778
823
|
swipeFav: "Favorite", swipeUnfav: "Unfavorite", swipeTrash: "Remove", swipeRestore: "Restore",
|
|
779
824
|
removed: (n) => `“${n}” moved to the trash`, restored: (n) => `“${n}” restored`, faved: (n) => `“${n}” added to favorites`,
|
|
@@ -810,6 +855,10 @@
|
|
|
810
855
|
emptyTrashBtn: "Empty trash", emptyTrashSure: (n) => `Click again to delete ${n} for good`, trashEmptied: (n) => `${n} ${n === 1 ? "card" : "cards"} deleted for good`, settings: "Settings", pickedUp: (n) => `Picked up “${n}” — tap the folder it goes into`, alreadyThere: "It's already in that folder",
|
|
811
856
|
readOnlyNudge: "You can only look here — tap Unlock at the top to change things", filterFolders: "Type to find a folder…", undoHint: "z undoes",
|
|
812
857
|
tplTitle: "Pick a starter set of folders (it replaces the current default folders):", tplAi: "AI & coding", tplResearch: "Research", tplEveryday: "Everyday", tplSkip: "Keep the default", tplFailed: "Can't change the folders now: you already have cards or changed them.",
|
|
858
|
+
obTitle: "Your catalogue is ready", obSub: "Save a link to let AI summarise and file it, bring in your bookmarks, or connect Chrome and AI agents.",
|
|
859
|
+
obAddTitle: "Add your first link", obAddDesc: "Paste any tool, repo, post, or video URL.", obAddBtn: "Add a link", obSampleBtn: "Try a sample link",
|
|
860
|
+
obImpTitle: "Import bookmarks", obImpDesc: "Bring in browser HTML, Pocket, Raindrop CSV, or any link list.", obImpBtn: "Import bookmarks",
|
|
861
|
+
obConnTitle: "Connect Chrome or AI", obConnDesc: "Save from the Chrome extension or connect Claude, ChatGPT & MCP agents.", obConnBtn: "Connect",
|
|
813
862
|
addLink: "Add", addPlaceholder: "Paste a link to a tool, post or video…", added: "Saved — sorting it now",
|
|
814
863
|
shortcuts: "Keys: j / k next / previous · f favorite · m move · n note · # trash · / search · g m mind map",
|
|
815
864
|
keysTitle: "Keyboard shortcuts", keysMove: "Move, favorite, trash", keysSelect: "Select several cards", keysGo: "Go to", keysQuick: "File into your most-used folders",
|
|
@@ -841,6 +890,10 @@
|
|
|
841
890
|
compact: "Compact cards (one line each)", tags: "Show tags", said: "Show what people said in chat",
|
|
842
891
|
theme: "Theme", themes: { auto: "Follow the system", light: "Light", dark: "Dark" },
|
|
843
892
|
model: "Model & classifier", language: "Language & chat replies", rules: "Your rules",
|
|
893
|
+
aiDetectTitle: "Detected on this computer", aiDetectScanning: "Scanning local AI tools…",
|
|
894
|
+
aiDetectNone: "No local AI tools detected (Claude Code, Gemini CLI, Ollama).", aiDetectRescan: "Re-scan local AI",
|
|
895
|
+
aiDetectApplied: "Applied — click Test connection or Save.",
|
|
896
|
+
aiTest: "Test connection", aiTesting: "Testing…", aiTestOk: (provider, ms) => `✓ Connected (${provider}, ${ms} ms)`,
|
|
844
897
|
plugins: "Plugins", pluginsNone: (dir) => `No plugins. Put .js files in ${dir} — see examples/plugins in the repo.`,
|
|
845
898
|
status: (e) => `Now: sorting by ${({ jev: "Jev", llm: "the model", heuristic: "built-in rules" })[e.judge] ?? e.judge}, summaries: ${e.summarizer === "off" ? "off" : e.summarizer}`, keep: "set — leave empty to keep", unset: "not set",
|
|
846
899
|
locked: "set by the environment driftnet runs in", forbidden: "Server settings can only be changed on the computer running driftnet (or set DRIFTNET_TOKEN). Display settings still work.",
|
|
@@ -880,7 +933,7 @@
|
|
|
880
933
|
passwordWarn: "Anyone with this password can add, move and delete in your catalogue. Don't reuse a password from elsewhere, and don't paste it into public chats.",
|
|
881
934
|
accessMode: "Who can read", accessChoices: { "": "Anyone who can reach this page", public: "Anyone who can reach this page", private: "Only with the password or the share key" },
|
|
882
935
|
shareKey: "Read-only share key", shareKeyHelp: "For AIs that can only open links (ChatGPT, Grok, Claude.ai): they can read your catalogue (notes included), nothing more. If it leaks, make a new one.",
|
|
883
|
-
newShareKey: "
|
|
936
|
+
newShareKey: "Replace key", shareKeySure: "Click again: the old key stops working", langPlaceholder: "Default: English", noShareKey: "No share key yet.",
|
|
884
937
|
agentTokens: "Agent tokens", agentTokensHelp: "One key per agent instead of the admin password. A write token can add, move and tidy; a read token can only look. Revoke one and only that agent is cut off; changing the admin password doesn't affect them.",
|
|
885
938
|
tokName: "Agent name", tokScope: "Access", tokScopes: { write: "Read and write", read: "Read only" }, tokCreate: "Create token",
|
|
886
939
|
tokNew: "New token for “{name}”", tokNewWarn: "Copy it now. It will not be shown again; only a fingerprint is kept.",
|
|
@@ -971,7 +1024,7 @@
|
|
|
971
1024
|
DRIFTNET_LLM_EFFORT: { "": "Default", low: "Low", medium: "Medium", high: "High", xhigh: "Extra high" },
|
|
972
1025
|
DRIFTNET_JUDGE: { "": "Jev if a key is set", jev: "Jev", rules: "Rules (free, no model)", llm: "The model decides", heuristic: "No judge: unsorted links go to Other", off: "No judge" },
|
|
973
1026
|
DRIFTNET_SUMMARY_DEPTH: { "": "Standard (default)", brief: "Brief: one line, 2 highlights, what you see", standard: "Standard", detailed: "Detailed: more highlights, use cases, how to try it" },
|
|
974
|
-
DRIFTNET_LOCALE: { "": "Same as the summaries", en: "English", "zh-TW": "繁體中文" },
|
|
1027
|
+
DRIFTNET_LOCALE: { "": "Same as the summaries", en: "English", "zh-TW": "繁體中文", "zh-CN": "简体中文", ja: "日本語", ko: "한국어", es: "Español" },
|
|
975
1028
|
DRIFTNET_REPLY_STYLE: { "": "Rich (default)", rich: "Rich: cards and vote buttons", text: "Plain text" },
|
|
976
1029
|
DRIFTNET_REPLY: { "": "One line + link (default)", link: "One line + link", full: "Full summary", off: "Don't reply" },
|
|
977
1030
|
DRIFTNET_DIGEST: { "": "Off (default)", off: "Off", daily: "Every day", weekly: "Every week" },
|
|
@@ -987,233 +1040,6 @@
|
|
|
987
1040
|
},
|
|
988
1041
|
},
|
|
989
1042
|
},
|
|
990
|
-
"zh-TW": {
|
|
991
|
-
search: "搜尋工具、標籤、連結…", all: "全部", favorites: "最愛", trash: "垃圾桶", any: "不限",
|
|
992
|
-
kind: "類型", switchTo: "EN", nav: "檢視與分類",
|
|
993
|
-
stats: (n, s) => `${n} 則 · 分享 ${s} 次`, shared: (n) => `分享 ${n} 次`,
|
|
994
|
-
empty: "這裡還沒有內容。", emptyStart: "還沒有內容。在下面貼一個連結開始,或用 Chrome 擴充功能收錄,也可以執行 npx driftnet add <連結>。",
|
|
995
|
-
noMatch: (q, v) => `「${v}」裡沒有符合「${q}」的卡片。`, searchAll: "搜尋全部", searchIn: (v) => `在「${v}」裡搜尋…`,
|
|
996
|
-
showingFor: (c) => `顯示「${c}」的搜尋結果`, searchInstead: (q) => `改搜尋「${q}」`,
|
|
997
|
-
addTitle: "收錄連結", addHelp: "工具、貼文或影片的連結(只打 example.com 也可以)", addThis: (u) => `收錄這個連結:${u}`, kAdd: "收錄連結",
|
|
998
|
-
addedAlready: "已經收過了,就是這張", addNothing: "裡面找不到連結。", noSuggestion: "這張卡片沒有建議的資料夾,按 m 自己選", emptyFav: "還沒有最愛,把卡片往右滑或按星號。",
|
|
999
|
-
pageMore: (n) => `再顯示 ${n} 張`, emptyTrash: "垃圾桶是空的。", hint: "往右滑加入最愛,往左滑移到垃圾桶。", hintTrash: "往右滑還原。",
|
|
1000
|
-
kinds: { repo: "程式庫", product: "產品", video: "影片", article: "文章", post: "貼文", other: "其他" },
|
|
1001
|
-
worth: { skip: "略過", low: "次要", normal: "值得看", "must-see": "必看" },
|
|
1002
|
-
flags: { injection: "提示詞注入", "hidden-chars": "隱藏字元", "low-reputation": "低信譽來源", "video-read": "已從影片讀取", "video-captions": "影片字幕", "video-ocr": "影片畫面文字", "video-speech": "影片語音", "video-watch": "模型已看過影片", "video-vision": "模型已看過畫面" },
|
|
1003
|
-
pending: "等待摘要", noModel: "沒有摘要(未設定模型)", enrichedBy: (a) => `由 ${a} 整理`,
|
|
1004
|
-
favorite: "加入最愛", unfavorite: "移出最愛", remove: "移到垃圾桶", restore: "還原",
|
|
1005
|
-
swipeFav: "加入最愛", swipeUnfav: "移出最愛", swipeTrash: "移到垃圾桶", swipeRestore: "還原",
|
|
1006
|
-
removed: (n) => `已將「${n}」移到垃圾桶`, restored: (n) => `已還原「${n}」`, faved: (n) => `已將「${n}」加入最愛`,
|
|
1007
|
-
undo: "復原", tokenPrompt: "這份清單是私人的。請輸入管理密碼;只想瀏覽的話,輸入唯讀分享碼也可以。", tokenSave: "開啟",
|
|
1008
|
-
tokenToEdit: "你是用唯讀連結在瀏覽。要修改的話,請輸入一次管理密碼。", back: "返回",
|
|
1009
|
-
tokenForOne: "這個連結只開這一張卡片。要看整份清單,請輸入管理密碼或唯讀分享碼。",
|
|
1010
|
-
failed: "沒有存成功,請檢查網路。", menu: "選單", close: "關閉選單", showing: "目前顯示:",
|
|
1011
|
-
folders: "資料夾", newFolder: "新資料夾", newSub: "在裡面新增資料夾", editFolder: "編輯資料夾", folderName: "名稱",
|
|
1012
|
-
folderDesc: "放什麼?(driftnet 的 AI 會照這段說明把新連結分進來)", folderParent: "放在", topLevel: "— 最上層 —",
|
|
1013
|
-
save: "儲存", cancel: "取消", del: "刪除資料夾", delSure: "確定刪除?內容移到上一層",
|
|
1014
|
-
refresh: "重新整理(再抓一次並重新摘要)", refreshShort: "重新摘要", refreshed: (n) => `已重新整理「${n}」`, refreshBusy: "這張卡片正在重新整理。", refreshWait: "剛剛才整理過,請一分鐘後再試。", refreshFailed: (why) => `重新整理失敗${why ? `:${why}` : ""}`,
|
|
1015
|
-
moveTo: "移動到…", moveTitle: (n) => `把「${n}」移動到`, moved: (n, f) => `已將「${n}」移到 ${f}`, expand: "展開子資料夾",
|
|
1016
|
-
dragHint: "拖到側邊欄的資料夾", foundIn: "從這篇找到:", related: "相關卡片:", folderMoved: (n, f) => `「${n}」已移到 ${f} 底下`,
|
|
1017
|
-
topLevelShort: "最上層",
|
|
1018
|
-
pkShare: "分享成資料夾包…", pkTitle: "分享成資料夾包", pkHelp: "資料夾包把這個資料夾、底下的子資料夾和裡面的卡片包成一個檔案,別人一鍵就能匯入。你的筆記、聊天內容和各種計數都不會放進去。", pkName: "資料夾包名稱", pkDesc: "說明", pkDownload: "下載資料夾包", pkLinkL: "分享連結", pkCopy: "複製連結", pkCopied: "已複製連結", pkSigned: "拿到這個連結的人只能下載這一個資料夾包,看不到你目錄裡的其他內容。", pkOpen: "任何連得到這個位址的人都能下載這個資料夾包。", pkNoLink: "還沒設定公開網址,所以暫時沒有可分享的連結。請到「設定 → 存取」設定,或啟動通道。現在仍可以下載檔案。", pkClose: "關閉", pkTooBig: "這個資料夾太大,無法分享成資料夾包。",
|
|
1019
|
-
mapAll: "全部", focusCrumb: "樹狀圖位置", focusUp: "回上一層", focusFolder: "聚焦這個資料夾", mapTree: "樹狀圖",
|
|
1020
|
-
mapHintFocus: "連點兩下資料夾(或在資料夾上按 z)可以只看這個資料夾。", mapHintFocusTouch: "想只看一個資料夾:點它的 ⋯,再選「聚焦這個資料夾」。",
|
|
1021
|
-
kTreeNav: "樹狀圖:下一個/上一個節點", kTreeOpen: "展開資料夾,或進入第一個子項", kTreeClose: "收合資料夾,或回到上一層", kTreeEnds: "第一個/最後一個節點", kTreeType: "直接輸入名稱", kTreeTypeText: "跳到名稱開頭相符的節點",
|
|
1022
|
-
kFocus: "聚焦這個資料夾(樹狀圖)", kFocusUp: "回上一層(樹狀圖)", keysMap: "樹狀圖",
|
|
1023
|
-
map: "樹狀圖", mapHint: "點資料夾展開,點卡片預覽。整理卡片:把它拖到資料夾上;手機上按住卡片一下、放開,再點要放進去的資料夾。按 ⋯ 可以改資料夾名稱。",
|
|
1024
|
-
a11yFolder: (n, c) => `資料夾 ${n},${c} 張卡片`, a11yCard: (n) => `卡片 ${n}`,
|
|
1025
|
-
expandAll: "全部展開", collapseAll: "全部收合", zoomIn: "放大", zoomOut: "縮小", fit: "符合畫面", openCard: "開啟卡片",
|
|
1026
|
-
layoutBoth: "兩側展開", layoutRight: "往右展開", layoutHelp: "切換:分支分佈在兩側(XMind 預設)或全部往右",
|
|
1027
|
-
zoom: "縮放", gotIt: "知道了", more: (n) => `還有 ${n} 張`, mapSearch: (q) => `標亮「${q}」`, openLink: "開啟連結", mdDemo: "你會看到什麼", mdWhy: "為什麼收進來", mdHighlights: "重點", mdUse: "適合用在", mdTry: "試試看", mdCopy: "複製", mdCopied: "已複製", mdPrev: "上一張卡片", mdNext: "下一張卡片", mdPos: (n, m) => `第 ${n} / ${m} 張`, mdSlide: (n, m) => `第 ${n} 張圖,共 ${m} 張`, mdPlay: "播放影片", mdPictures: "圖片", mdTags: "標籤", mdHasNote: "有你的筆記", showInList: "在清單中查看", close: "關閉",
|
|
1028
|
-
needPassword: "要修改需要管理密碼。",
|
|
1029
|
-
histBtn: "修改紀錄", histTitle: "修改紀錄", histNone: "還沒有修改紀錄。", histRestore: "還原", histRestored: "已還原成先前的版本。", histErr: "無法載入修改紀錄。", histForget: "清除紀錄", histForgot: "這張卡片的修改紀錄已清除。",
|
|
1030
|
-
histField: { note: "筆記", summary: "摘要", title: "標題", folder: "資料夾", favorite: "星號", trashed: "垃圾桶" }, histEmptyVal: "(空白)", histStarOn: "已加星", histStarOff: "未加星", histInTrash: "在垃圾桶", histOutTrash: "不在垃圾桶",
|
|
1031
|
-
histActor: (a) => a === "admin" ? "你" : a === "system:refresh" ? "重新整理" : a === "system" ? "系統" : a.replace(/^agent:/, "agent "),
|
|
1032
|
-
notes: "筆記", note: "筆記", addNote: "加筆記", editNote: "改筆記", noteFor: (n) => `「${n}」的筆記`,
|
|
1033
|
-
noteHelp: "只有你看得到:心得、試用結果、要注意的地方…", newNote: "新筆記", noteTitle: "標題",
|
|
1034
|
-
noteBody: "輸入 # 加卡片編號(例如 #3)就能連到那張卡片。", delNote: "刪除筆記", delNoteSure: "確定刪除?", untitled: "未命名",
|
|
1035
|
-
emptyNotes: "還沒有筆記。筆記可以連到卡片:輸入 # 加卡片編號(例如 #3)。", exportMd: "匯出成 Markdown", exportVault: "下載給 Obsidian/Notion",
|
|
1036
|
-
saved: "已儲存", tagsEdit: "編輯標籤", tagsHelp: "標籤,用逗號分隔(最多 8 個)", purge: "永久刪除", purgeSure: "再按一次即永久刪除", purged: (n) => `已永久刪除「${n}」`,
|
|
1037
|
-
emptyTrashBtn: "清空垃圾桶", emptyTrashSure: (n) => `再按一次,永久刪除這 ${n} 張`, trashEmptied: (n) => `已永久刪除 ${n} 張卡片`, settings: "設定", pickedUp: (n) => `已拿起「${n}」,點要放進去的資料夾`, alreadyThere: "它已經在這個資料夾裡了",
|
|
1038
|
-
readOnlyNudge: "目前只能看。要修改,請點上方的「解鎖」", filterFolders: "輸入文字找資料夾…", undoHint: "按 z 復原",
|
|
1039
|
-
tplTitle: "選一組起始資料夾(會取代目前的預設資料夾):", tplAi: "AI 與程式", tplResearch: "研究", tplEveryday: "日常生活", tplSkip: "維持預設", tplFailed: "現在不能換資料夾了:已經有卡片,或資料夾被你改過。",
|
|
1040
|
-
addLink: "收錄", addPlaceholder: "貼上工具、貼文或影片的連結…", added: "收到,正在整理",
|
|
1041
|
-
shortcuts: "快捷鍵:j/k 下一張/上一張 · f 最愛 · m 移動 · n 筆記 · # 垃圾桶 · / 搜尋 · g m 樹狀圖",
|
|
1042
|
-
keysTitle: "快捷鍵", keysMove: "移動、最愛、垃圾桶", keysSelect: "一次選多張卡片", keysGo: "切換畫面", keysQuick: "放進最常用的資料夾",
|
|
1043
|
-
kNext: "下一張/上一張", kFav: "最愛", kMove: "移動到…", kNote: "筆記", kTrash: "垃圾桶(在垃圾桶裡是還原)", kSearch: "搜尋", kMap: "樹狀圖", kAll: "全部卡片",
|
|
1044
|
-
palette: "命令面板", palPlaceholder: "跳到資料夾、找卡片,或執行指令…", palGroups: { folders: "資料夾", cards: "卡片", commands: "指令" }, palNone: "沒有符合的項目", kPalette: "命令面板",
|
|
1045
|
-
split: "並排", splitHelp: "卡片列表與樹狀圖並排顯示", splitCards: "卡片",
|
|
1046
|
-
kSelect: "選取/取消選取這張", kRange: "選取一段範圍", kHold: "長按", kLong: "在手機上開始選取卡片", keysClose: "關閉", kClear: "取消全部選取", kUndo: "復原上一個動作", kHelp: "顯示這份清單",
|
|
1047
|
-
kQuickNone: "先把卡片移進某個資料夾;最常用的九個資料夾會在這裡得到數字鍵。", kQuickN: (f) => `移到 ${f}`,
|
|
1048
|
-
review: "需要檢查", emptyReview: "沒有發現失效、封存或久未更新的連結。", hintReview: "這些連結看起來已失效、封存或久未更新。可以重新整理、在卡片上再檢查一次連結,或移到垃圾桶。",
|
|
1049
|
-
checkLink: "檢查連結", linkChecked: "已檢查連結", linkCheckFailed: "無法檢查連結",
|
|
1050
|
-
health: { dead: ["☠", "失效", "連結已經打不開(404/已移除)"], archived: ["🗄", "已封存", "這個儲存庫已封存(唯讀)"], stale: ["💤", "久未更新", "已超過 18 個月沒有更新"], moved: ["↪", "已搬家", "這個儲存庫已搬家或改名"] },
|
|
1051
|
-
stars: (n) => `${n} 顆 GitHub 星`,
|
|
1052
|
-
inbox: "收件匣", emptyInbox: "收件匣清空了——每張卡片都有你選的資料夾。", hintInbox: "點一下資料夾就能歸檔。下面是還沒歸檔的卡片。",
|
|
1053
|
-
chipOther: "其他資料夾…", chipTitle: (p) => `信心 ${p}%`,
|
|
1054
|
-
keysInbox: "在收件匣", kChip: "歸到這張卡片建議的第 1–3 個資料夾", kSkip: "略過:移到下一張卡片", kQuickInbox: "在收件匣裡,1–3 改成選擇目前卡片的建議資料夾;4–9 仍然是放進最常用的資料夾。",
|
|
1055
|
-
planBtn: "建議整理資料夾", planNoModel: "需要 AI 模型:請到 ⚙ 設定 → AI 設定一個", planTitle: "建議的資料夾調整",
|
|
1056
|
-
planIntro: "AI 只負責提議。勾選想要的項目再套用,套用前什麼都不會改;復原可以一次還原整份方案。你親手歸檔的卡片不會被移動。",
|
|
1057
|
-
planThinking: "正在請模型想想…", planNone: "模型認為目前沒有值得調整的地方。", planApply: (n) => `套用選取的 ${n} 項`,
|
|
1058
|
-
planCreate: (p) => `新增「${p}」`, planRename: (a, b) => `把「${a}」改名為「${b}」`, planMove: (n, d) => `把 ${n} 張卡片移到「${d}」`,
|
|
1059
|
-
planMerge: (a, b) => `把「${a}」合併到「${b}」`, planApplied: (n) => `已套用 ${n} 項資料夾調整`, planNeeds: "需要它新增的資料夾",
|
|
1060
|
-
nSelected: (n) => `已選 ${n} 張`, selectAll: "全選", clearSel: "清除", trashShort: "垃圾桶",
|
|
1061
|
-
moveTitleMany: (n) => `把 ${n} 張卡片移動到`, pickedMany: (n) => `已拿起 ${n} 張卡片,點要放進去的資料夾`,
|
|
1062
|
-
bulkMoved: (n, f) => `已將 ${n} 張卡片移到 ${f}`, bulkRemoved: (n) => `已將 ${n} 張卡片移到垃圾桶`, bulkRestored: (n) => `已還原 ${n} 張卡片`,
|
|
1063
|
-
bulkFaved: (n) => `已將 ${n} 張卡片加入最愛`, bulkUnfaved: (n) => `已將 ${n} 張卡片移出最愛`,
|
|
1064
|
-
st: {
|
|
1065
|
-
title: "設定", save: "儲存", welcome: "歡迎!在下面選一個模型,就會有摘要,連結也會自動分進資料夾。不選也可以:連結照樣會存下來,先放在「其他」(和收件匣)等你歸檔,接上的 agent 也能幫你寫摘要。接著貼一個連結試試看。",
|
|
1066
|
-
advanced: "進階", advancedHelp: "其他供應商的設定、語意搜尋、額外的金鑰和影片工具路徑。", openSettings: "開啟設定",
|
|
1067
|
-
display: "這個瀏覽器", sort: "排序", sorts: { best: "值得看的在前", newest: "最新的在前", shared: "最多人分享的在前" },
|
|
1068
|
-
compact: "精簡卡片(每張一行)", tags: "顯示標籤", said: "顯示大家在聊天室說的話",
|
|
1069
|
-
theme: "外觀", themes: { auto: "跟系統一樣", light: "淺色", dark: "深色" },
|
|
1070
|
-
model: "模型與分類", language: "語言與聊天回覆", rules: "自訂規則",
|
|
1071
|
-
plugins: "外掛", pluginsNone: (dir) => `沒有外掛。把 .js 檔放進 ${dir},範例在 repo 的 examples/plugins。`,
|
|
1072
|
-
status: (e) => `目前:分類用 ${({ jev: "Jev", llm: "模型", heuristic: "內建規則" })[e.judge] ?? e.judge},摘要用 ${e.summarizer === "off" ? "(未開啟)" : e.summarizer}`, keep: "已設定,留空就不變", unset: "未設定",
|
|
1073
|
-
locked: "由執行環境設定", forbidden: "伺服器設定只能在執行 driftnet 的那台電腦上改(或設定 DRIFTNET_TOKEN)。顯示設定照常可用。",
|
|
1074
|
-
savedServer: "已儲存,馬上生效", chat: "聊天室回覆", webhook: "對外 Webhook", digest: "定時摘要", feed: "訂閱源(RSS)", genCopied: "已產生新密碼並複製,按「儲存」才會生效",
|
|
1075
|
-
tabGeneral: "一般", tabAccess: "存取", tabAi: "AI", tabChats: "聊天室",
|
|
1076
|
-
chatsIntro: "貼上機器人的權杖,按「儲存」就會馬上連線,不用重新啟動。接著傳一個連結給機器人試試。",
|
|
1077
|
-
chatsAdvanced: "進階", chatsAdvancedHelp: "只讓機器人在某些聊天室或頻道運作,以及不用 Socket Mode 的 Slack(需要公開網址)。",
|
|
1078
|
-
chatState: { off: "尚未連線,請在下面貼上權杖", starting: "連線中…", connected: (n) => n ? `已連線:${n}` : "已連線",
|
|
1079
|
-
webhook: (url) => `已就緒,訊息會送到 ${url}`, error: (e) => `有問題:${e}`, needs: (f) => `還需要填:${f}`, publicUrl: "你的公開網址" },
|
|
1080
|
-
chatHelp: {
|
|
1081
|
-
telegram: ["在 Telegram 找 @BotFather,傳 /newbot,把它給你的權杖貼到這裡。要在群組用的話,再傳 /setprivacy → Disable,機器人才看得到連結。", [["https://t.me/BotFather", "開啟 @BotFather"]]],
|
|
1082
|
-
discord: ["在 Discord Developer Portal 建立應用程式,進 Bot 頁按 Reset Token,並在同一頁打開 Message Content Intent。再用 OAuth2 → URL Generator → bot 邀請它進伺服器。", [["https://discord.com/developers/applications", "Discord Developer Portal"]]],
|
|
1083
|
-
slack: ["在 api.slack.com 建立 app,打開 Socket Mode(會產生 xapp- 開頭的權杖),加上 bot 權限 channels:history、groups:history、chat:write 和 message 事件,安裝後複製 xoxb- 開頭的 Bot User OAuth Token。", [["https://api.slack.com/apps", "Slack apps"]]],
|
|
1084
|
-
line: ["在 LINE Developers 建立 Messaging API channel:Channel secret 在 Basic settings,存取權杖在 Messaging API 頁。LINE 要從網路連到 driftnet,所以需要公開網址;把 webhook 設成該網址加上 /webhooks/line。", [["https://developers.line.biz/console/", "LINE Developers"], ["https://github.com/KevinChu1110/driftnet/blob/main/docs/zh-TW/online.md", "放上網路"]]],
|
|
1085
|
-
},
|
|
1086
|
-
updates: "更新", bkTitle: "備份", bkHelp: "一個 zip 檔,包含整個收藏(卡片、資料夾、筆記、權杖)和設定。除非勾選,否則不會包含密碼和金鑰。",
|
|
1087
|
-
bkDownload: "下載備份", bkSecrets: "包含密碼和金鑰(需要再輸入一次管理員密碼)", bkPassword: "管理員密碼",
|
|
1088
|
-
bkRestoreFile: "從備份檔還原", bkRestoreHelp: "會先檢查備份檔。重新啟動 driftnet 之前不會有任何改變;目前的資料會留在旁邊,檔名帶有 before-restore。",
|
|
1089
|
-
bkChecking: "正在檢查備份檔…", bkNeedPassword: "要包含密碼和金鑰,請輸入管理員密碼。", bkMade: "備份已下載。",
|
|
1090
|
-
bkRestartTitle: "請重新啟動 driftnet 以完成還原", bkRestartBody: (n) => `備份檔(${n} 張卡片)已檢查完畢並等待中,下次 driftnet 啟動時會取代目前的資料。`,
|
|
1091
|
-
bkSettingsTitle: "備份裡的設定(不會自動套用)。需要的話請自行複製到「設定」:", bkPending: "有一份還原正在等待:請重新啟動 driftnet 以完成還原。",
|
|
1092
|
-
updOut: (v) => `driftnet ${v} 已發布`, updHow: "如何更新", updDismiss: "關閉",
|
|
1093
|
-
impPackTitle: "從資料夾包連結匯入", impPackHelp: "貼上別人傳給你的資料夾包連結。卡片已經整理好(不會呼叫模型),會放進它自己的資料夾。", impPackGo: "檢查連結", impPackConfirm: (name, n, dup) => `資料夾包「${name}」:${n} 張新卡片(${dup} 張已經有了)。要匯入嗎?`, impPackNone: (name, dup) => `資料夾包「${name}」沒有新的卡片(${dup} 張已經有了)。仍要匯入把它們歸檔嗎?`, impPackDone: (name, added, already) => `已匯入「${name}」:新增 ${added}、原本就有 ${already}。`,
|
|
1094
|
-
impTitle: "匯入書籤", impHelp: "匯入瀏覽器的書籤檔(HTML)、Pocket、Raindrop(CSV)、driftnet 的 JSON 清單,或任何含有連結的文字檔。",
|
|
1095
|
-
impFile: "選擇檔案", impKeep: "保留我的書籤資料夾(放在「Imported」底下)", impReading: "讀取檔案中…",
|
|
1096
|
-
impConfirm: (n, dup) => `匯入 ${n} 個連結(${dup} 個已經有了)?若已設定模型,每個新連結都會呼叫一次模型。`,
|
|
1097
|
-
impNone: (dup, skip) => `沒有新的連結可匯入(${dup} 個已經有了,略過 ${skip} 個)。`, impCapped: (n) => `一次最多匯入前 ${n} 個連結。`,
|
|
1098
|
-
impSkipped: (n) => `略過 ${n} 個(不是網頁連結,或是內網位址)。`, impStart: "開始匯入", impBusy: "已有匯入正在進行,請等它完成再試。",
|
|
1099
|
-
impProgress: (done, total, added, failed) => `匯入中… ${done} / ${total}(新增 ${added}、失敗 ${failed})`,
|
|
1100
|
-
impDone: (total, added, already, failed) => `完成:新增 ${added}、原本就有 ${already}、失敗 ${failed}(共 ${total})。`,
|
|
1101
|
-
impFailedRun: "匯入意外中止。", impBadFile: "讀不了這個檔案。",
|
|
1102
|
-
accessStatus: (pw, key, url) => `密碼:${pw === "✓" ? "已設定" : "未設定"} · 分享碼:${key === "✓" ? "已產生" : "沒有"} · 公開網址:${url === "—" ? "關閉" : url}`,
|
|
1103
|
-
access: "存取與連線",
|
|
1104
|
-
password: "管理密碼", passwordHelp: "設定之後,新增連結、改設定、agent 寫入都需要它。至少 8 個字元,不能有空白。",
|
|
1105
|
-
generate: "產生", show: "顯示", hide: "隱藏", copy: "複製", copied: "已複製",
|
|
1106
|
-
strength: { weak: "弱:很容易被猜到。只在這台電腦用還可以,不要拿它開公開網址。", ok: "普通", strong: "強" },
|
|
1107
|
-
passwordWarn: "知道這組密碼的人,可以新增、移動、刪除你清單裡的東西。不要沿用其他網站的密碼,也不要貼到公開的聊天室。",
|
|
1108
|
-
accessMode: "誰可以讀", accessChoices: { "": "連得到這個網頁的人都可以", public: "連得到這個網頁的人都可以", private: "要有密碼或分享碼才能讀" },
|
|
1109
|
-
shareKey: "唯讀分享碼", shareKeyHelp: "給只會開連結的 AI(ChatGPT、Grok、Claude 網頁版):只能讀你的清單(包含筆記),不能改。外流的話重產一組就好。",
|
|
1110
|
-
newShareKey: "重新產生", noShareKey: "還沒有分享碼。",
|
|
1111
|
-
agentTokens: "Agent 專用金鑰", agentTokensHelp: "每個 agent 用自己的金鑰,不必拿管理密碼出去。可寫入的金鑰能收錄、搬移、整理;唯讀的只能看。撤銷其中一把只會斷掉那個 agent,換管理密碼也不影響它們。",
|
|
1112
|
-
tokName: "Agent 名稱", tokScope: "權限", tokScopes: { write: "可讀寫", read: "唯讀" }, tokCreate: "建立金鑰",
|
|
1113
|
-
tokNew: "「{name}」的新金鑰", tokNewWarn: "請現在複製。之後不會再顯示,系統只留下指紋。",
|
|
1114
|
-
tokNone: "還沒有金鑰。", tokCreatedOn: "建立於", tokLastUsed: "最後使用", tokNever: "從未", tokRevoke: "撤銷", tokRevoked: "已撤銷", tokRemove: "移除",
|
|
1115
|
-
tokDuplicate: "已經有一把叫「{name}」的金鑰。舊的仍然有效;如果是要換新,請到「設定 → 存取」撤銷舊的。",
|
|
1116
|
-
tokCardName: "金鑰名稱", tokCardCreate: "幫這個 agent 建一把專用金鑰",
|
|
1117
|
-
tokCardDone: "已建立「{name}」專用金鑰,已填進上面的設定。請現在複製:之後不會再顯示。不用時到「設定 → 存取」撤銷。",
|
|
1118
|
-
tokNameNeeded: "請幫金鑰取個名字。", tokPasswordOnly: "請先設定管理密碼:金鑰就是用來取代它交給 agent 的。",
|
|
1119
|
-
pairTitle: "用 QR code 解鎖手機", pairHelp: "用手機相機掃描這個圖形碼:會直接開啟已解鎖的 driftnet,並取得專屬、可隨時撤銷的金鑰。圖形碼只能用一次,5 分鐘內有效。",
|
|
1120
|
-
pairName: "裝置名稱", pairCreate: "顯示 QR code", pairExpires: "剩餘 {t}", pairExpired: "這個圖形碼已過期,請重新產生。",
|
|
1121
|
-
pairLink: "或在手機上開啟這個連結", pairDone: "「{name}」已配對完成。", pairNameNeeded: "請先為裝置命名。",
|
|
1122
|
-
pairLocal: "這個位址只有這台電腦連得到。手機需要公開網址(見下方)或這台電腦的區域網路位址。",
|
|
1123
|
-
pairOk: "這台裝置已解鎖。", pairFailed: "配對碼無法使用,可能已過期或已被使用,請在電腦上重新產生。",
|
|
1124
|
-
tunnel: "給雲端 AI 的公開網址", tunnelHelp: "Claude 網頁版、ChatGPT、Grok 和其他機器上的 agent 連不到 localhost。這會透過 Cloudflare(免帳號)開一個臨時的 https 網址;每次都不一樣,driftnet 關掉就跟著關。",
|
|
1125
|
-
tunnelOn: "開啟公開網址", tunnelOff: "關閉", tunnelNeedsPassword: "要先儲存管理密碼。",
|
|
1126
|
-
tunnelInstall: "需要 cloudflared(driftnet 不會自動幫你下載):", tunnelPrivate: "開啟後,「誰可以讀」會改成要有密碼或分享碼。",
|
|
1127
|
-
tunnelStarting: "正在開通道…(最多 30 秒)", saveFirst: "先按儲存,再開公開網址。",
|
|
1128
|
-
connect: "連接 AI",
|
|
1129
|
-
login: "輸入管理密碼", logout: "在這台裝置登出", loginTitle: "解鎖編輯", loginOk: "解鎖", unlocked: "已解鎖,現在可以編輯了", unlockShort: "解鎖",
|
|
1130
|
-
loginWrong: "密碼不對,再試一次。", viewOnly: "只能看 · 解鎖編輯",
|
|
1131
|
-
loginHelp: "輸入這個 driftnet 的密碼,通常是架設它的人給你的。沒有密碼也能看所有內容,只是不能修改。",
|
|
1132
|
-
loginAdvanced: "密碼是你自己設的但忘了?到跑 driftnet 的那台電腦打開網頁,設定裡可以直接設新的。跑在伺服器上的話:在你的電腦執行 ssh -L PORT:127.0.0.1:PORT <伺服器> 再打開 http://localhost:PORT。",
|
|
1133
|
-
keyWrong: "這不是管理密碼,也不是分享碼。",
|
|
1134
|
-
labels: {
|
|
1135
|
-
DRIFTNET_LLM_PROVIDER: ["模型來源", "用來寫摘要,並把連結分進資料夾。選「不使用」:連結照樣存下來,放在「其他」/收件匣等你歸檔;接上的 agent 也能幫忙寫摘要。"],
|
|
1136
|
-
DRIFTNET_LLM_MODEL: ["模型", "例如 claude-haiku-5-5、gpt-5-mini、gemini-3.8-flash、qwen3"],
|
|
1137
|
-
DRIFTNET_LLM_BASE_URL: ["API 網址", "OpenAI 相容 API 用:Gemini、Grok、OpenRouter、Ollama(http://127.0.0.1:11434/v1)…"],
|
|
1138
|
-
DRIFTNET_LLM_ALLOW_LOCAL: ["允許區網裡的模型", "這台電腦(localhost)一律可用。只有模型或 embedding 跑在區網另一台機器時才需要;只放行你填的那個位址。"],
|
|
1139
|
-
DRIFTNET_LLM_API_KEY: ["API 金鑰", ""],
|
|
1140
|
-
DRIFTNET_LLM_EFFORT: ["推理強度", ""],
|
|
1141
|
-
TYPESAFE_API_KEY: ["Jev 金鑰", "選填:約 100ms 的分類器,可以省下模型呼叫(console.typesafe.ai)"],
|
|
1142
|
-
DRIFTNET_JUDGE: ["判斷器", "在模型之前先決定每個連結放哪。「規則」免費,不需要模型。"],
|
|
1143
|
-
DRIFTNET_EMBED: ["以語意搜尋", "依內容意思找卡片,不只比對字(搜「登入」能找到 OAuth)。需要嵌入模型:本機 Ollama 的 nomic-embed-text,或下面的服務。不花摘要的 token。"],
|
|
1144
|
-
DRIFTNET_EMBED_PROVIDER: ["嵌入服務", "指定一個就會開啟語意搜尋。Ollama 全程在你的電腦上;OpenAI、Gemini 會收到每張卡片的摘要(不會有你的筆記或聊天內容)。"],
|
|
1145
|
-
DRIFTNET_EMBED_MODEL: ["嵌入模型", "預設:nomic-embed-text(Ollama)、text-embedding-3-small(OpenAI)、gemini-embedding-001(Gemini)。更換後會在背景重新計算全部卡片。"],
|
|
1146
|
-
DRIFTNET_EMBED_BASE_URL: ["嵌入 API 網址", "Ollama 或相容 OpenAI 的伺服器,例如 http://127.0.0.1:11434。留空:用該服務的預設位址。"],
|
|
1147
|
-
DRIFTNET_EMBED_API_KEY: ["嵌入 API 金鑰", "OpenAI 或 Gemini 用。只有摘要模型是同一家時才會沿用它的金鑰。"],
|
|
1148
|
-
DRIFTNET_EMBED_FLOOR: ["語意相符門檻", "0–1。沒有字面相符時,意思要多接近才會出現。nomic-embed-text 預設 0.55;調高結果會變少。"],
|
|
1149
|
-
DRIFTNET_LLM_REGION: ["區域", "Bedrock:例如 us-east-1。Vertex:例如 us-central1(預設)。其他供應商用不到。"],
|
|
1150
|
-
AWS_ACCESS_KEY_ID: ["AWS 存取金鑰 ID", "Bedrock 用。有 Bedrock API 金鑰就留空。"],
|
|
1151
|
-
AWS_SECRET_ACCESS_KEY: ["AWS 秘密存取金鑰", "Bedrock 用。"],
|
|
1152
|
-
AWS_SESSION_TOKEN: ["AWS 工作階段權杖", "Bedrock 用,只有臨時憑證才需要。"],
|
|
1153
|
-
AWS_BEARER_TOKEN_BEDROCK: ["Bedrock API 金鑰", "Bedrock 用:填這個就不用上面的 AWS 金鑰。"],
|
|
1154
|
-
GOOGLE_CLOUD_PROJECT: ["Google Cloud 專案", "Vertex 用。憑證檔裡有寫專案就可以不填。"],
|
|
1155
|
-
DRIFTNET_VERTEX_CREDENTIALS: ["Vertex 憑證檔", "Vertex 用:這台電腦上服務帳戶 JSON 檔的路徑(或在「API 金鑰」填存取權杖)。"],
|
|
1156
|
-
DRIFTNET_JUDGE_RULES: ["規則檔", "給「規則」判斷器:檔案路徑。一行一條,例如 github.com/* -> coding"],
|
|
1157
|
-
GITHUB_TOKEN: ["GitHub token", "選填:GitHub 查詢上限從每小時 60 次變 5000 次"],
|
|
1158
|
-
DRIFTNET_LANGUAGE: ["摘要語言", "English、Traditional Chinese (Taiwan)、Japanese…"],
|
|
1159
|
-
DRIFTNET_LOCALE: ["機器人語言", ""],
|
|
1160
|
-
DRIFTNET_REPLY: ["機器人怎麼回覆", ""],
|
|
1161
|
-
DRIFTNET_REPLY_STYLE: ["回覆樣式", "豐富:各平台的 embed、區塊、卡片與投票按鈕;純文字:一般訊息。"],
|
|
1162
|
-
DRIFTNET_PUBLIC_URL: ["這個網頁的公開網址", "回覆裡的連結會指到這裡,例如 https://driftnet.example.com"],
|
|
1163
|
-
DRIFTNET_SUMMARY_DEPTH: ["摘要詳細程度", "每張卡片寫多少。詳細會用較多模型 token,且每個頁面讀兩倍的內容。"],
|
|
1164
|
-
DRIFTNET_SUMMARY_RULES: ["摘要的額外規則", "例如:說明是否免費。需要 GPU 的話要提到。"],
|
|
1165
|
-
DRIFTNET_PROFILE: ["關於你", "你是誰、關心什麼(最多 600 字)。模型會用它判斷什麼值得你花時間,並寫「為什麼值得看」那一句。例如:後端工程師,做 Odoo 和 TypeScript;蒐集 AI 寫程式工具和 MCP 伺服器;對加密貨幣沒興趣。"],
|
|
1166
|
-
DRIFTNET_UPDATE_CHECK: ["檢查新版本", "每天向 npm 查一次最新版本號(不會傳送任何與你有關的資料),有新版就顯示小提示。關閉(預設)=完全不查。"],
|
|
1167
|
-
DRIFTNET_BLOCK_DOMAINS: ["不要收錄的網域", "用逗號或空白分隔,例如 example.com, spam.io"],
|
|
1168
|
-
DRIFTNET_LINKS_PER_MESSAGE: ["每則聊天訊息最多讀幾條連結", "預設 10。每條連結都可能花一次模型呼叫,而群組裡任何人都能貼連結;超過的不讀。"],
|
|
1169
|
-
DRIFTNET_LINKS_PER_HOUR: ["每個聊天室每小時最多讀幾條連結", "預設 60,以聊天室/頻道計。超過配額的連結不讀,等這一小時過去。"],
|
|
1170
|
-
DRIFTNET_WEBHOOK_URL: ["Webhook 網址", "每張新增或更新的卡片都會 POST 到這裡(n8n、Zapier、Slack 工作流程…)。視為機密。"],
|
|
1171
|
-
DRIFTNET_WEBHOOK_SECRET: ["Webhook 簽章密鑰", "選填。會加上 X-Driftnet-Signature: sha256=<內容的 HMAC>。"],
|
|
1172
|
-
DRIFTNET_DIGEST: ["定時摘要", "把新卡片整理成一則短訊息,貼進你的聊天室。"],
|
|
1173
|
-
DRIFTNET_DIGEST_AT: ["摘要時間", "伺服器所在時區的 HH:MM,例如 09:00(預設)。"],
|
|
1174
|
-
DRIFTNET_DIGEST_DAY: ["摘要星期(每週)", ""],
|
|
1175
|
-
DRIFTNET_DIGEST_TO: ["摘要送到哪裡", "以逗號分隔:telegram:<聊天室 id>、discord:<頻道 id>、slack:<頻道 id>、line:<使用者、群組或聊天室 id>。使用已設定的機器人金鑰。"],
|
|
1176
|
-
DRIFTNET_HEALTH: ["連結健康檢查", "每週:每次幾張,檢查連結是否還能開、儲存庫是否已封存,並標記失效、封存、久未更新的卡片。"],
|
|
1177
|
-
DRIFTNET_VIDEO: ["讀影片(reels、shorts)", "Instagram、Facebook、Threads、TikTok、YouTube Shorts、X 的影片,若頁面文字幾乎沒內容,就用本機工具(yt-dlp、ffmpeg、tesseract、whisper,有裝才用)讀字幕、畫面文字和語音。一次只處理一支影片。"],
|
|
1178
|
-
DRIFTNET_YTDLP: ["yt-dlp 路徑", "只有 yt-dlp 不在 PATH 時才需要。"],
|
|
1179
|
-
DRIFTNET_YTDLP_IMPERSONATE: ["yt-dlp 瀏覽器指紋", "讓 yt-dlp 看起來像真的瀏覽器(chrome、safari、firefox),給拒絕一般程式連線的網站用。需要 yt-dlp 旁邊裝有 curl_cffi(Homebrew 版已內建;用 pip 的話:pip install 'yt-dlp[curl-cffi]')。沒有就留空:填了不支援的值會讓每支影片都失敗。"],
|
|
1180
|
-
DRIFTNET_YTDLP_COOKIES: ["yt-dlp cookies 檔", "從已登入的瀏覽器匯出的 cookies.txt(用「Get cookies.txt」之類的擴充功能)。給 Facebook、Instagram 和 YouTube 的「登入以確認你不是機器人」用。檔案只留在這台機器上。"],
|
|
1181
|
-
DRIFTNET_FFMPEG: ["ffmpeg 路徑", "只有 ffmpeg 不在 PATH 時才需要。"],
|
|
1182
|
-
DRIFTNET_TESSERACT: ["tesseract 路徑", "只有 tesseract(讀畫面文字)不在 PATH 時才需要。"],
|
|
1183
|
-
DRIFTNET_WHISPER: ["whisper 路徑", "只有 whisper 或 whisper-cli(語音轉文字)不在 PATH 時才需要。"],
|
|
1184
|
-
DRIFTNET_VIDEO_FRAMES: ["把畫面交給模型看", "預設關閉。開啟後,reel 或 short 在本機工具讀完後仍然太少時,最多 8 張不重複的畫面會附在同一次摘要請求裡,只送給你設定的模型。模型必須看得懂圖片(Ollama:要用視覺模型)。"],
|
|
1185
|
-
DRIFTNET_WEBHOOK_ALLOW_LOCAL: ["允許本機 Webhook", "接收端在你自己的區域網路時需要(例如內網的 n8n)。只放行你填的那個位址。"],
|
|
1186
|
-
TELEGRAM_BOT_TOKEN: ["機器人權杖", "長得像 123456789:AA…"],
|
|
1187
|
-
DRIFTNET_TELEGRAM_CHATS: ["Telegram:只限這些聊天室", "以逗號分隔的聊天室 ID。留空:任何找到機器人的人都能用。記錄檔會印出每個新聊天室的 ID。"],
|
|
1188
|
-
DISCORD_BOT_TOKEN: ["機器人權杖", "在 Bot → Reset Token 取得(不是 client secret)。"],
|
|
1189
|
-
DISCORD_CHANNELS: ["Discord:只限這些頻道", "以逗號分隔的頻道 ID(在頻道上按右鍵 → 複製頻道 ID)。留空:機器人看得到的所有頻道。"],
|
|
1190
|
-
SLACK_APP_TOKEN: ["App-level 權杖", "xapp- 開頭(Basic Information → App-Level Tokens,權限 connections:write)。"],
|
|
1191
|
-
SLACK_BOT_TOKEN: ["機器人權杖", "xoxb- 開頭(OAuth & Permissions 頁)。"],
|
|
1192
|
-
SLACK_SIGNING_SECRET: ["Slack 簽章密鑰", "只有不用 Socket Mode 時才需要:事件會送到你的公開網址 + /webhooks/slack。"],
|
|
1193
|
-
LINE_CHANNEL_SECRET: ["Channel secret", "32 個英數字,在 Basic settings 頁。"],
|
|
1194
|
-
LINE_CHANNEL_ACCESS_TOKEN: ["Channel access token", "Messaging API → Channel access token (long-lived) → Issue。"],
|
|
1195
|
-
},
|
|
1196
|
-
choices: {
|
|
1197
|
-
DRIFTNET_LLM_PROVIDER: { "": "不使用", anthropic: "Anthropic(API 金鑰)", openai: "OpenAI 相容(OpenAI、Grok、Ollama…)", gemini: "Google Gemini(API 金鑰)", bedrock: "Amazon Bedrock", vertex: "Google Vertex AI", "claude-cli": "Claude 訂閱(Claude Code CLI)", "gemini-cli": "Google 帳號(Gemini CLI)" },
|
|
1198
|
-
DRIFTNET_LLM_EFFORT: { "": "預設", low: "低", medium: "中", high: "高", xhigh: "極高" },
|
|
1199
|
-
DRIFTNET_JUDGE: { "": "有 Jev 金鑰就用 Jev", jev: "Jev", rules: "規則(免費,不用模型)", llm: "交給模型", heuristic: "不用判斷器:沒分類的連結放到「其他」", off: "不用判斷器" },
|
|
1200
|
-
DRIFTNET_SUMMARY_DEPTH: { "": "標準(預設)", brief: "簡短:一句話、2 個重點、看得到什麼", standard: "標準", detailed: "詳細:更多重點、使用情境、怎麼試用" },
|
|
1201
|
-
DRIFTNET_LOCALE: { "": "跟摘要一樣", en: "English", "zh-TW": "繁體中文" },
|
|
1202
|
-
DRIFTNET_REPLY_STYLE: { "": "豐富(預設)", rich: "豐富:卡片與投票按鈕", text: "純文字" },
|
|
1203
|
-
DRIFTNET_REPLY: { "": "一行+連結(預設)", link: "一行+連結", full: "完整摘要", off: "不回覆" },
|
|
1204
|
-
DRIFTNET_DIGEST: { "": "關閉(預設)", off: "關閉", daily: "每天", weekly: "每週" },
|
|
1205
|
-
DRIFTNET_DIGEST_DAY: { "": "週一(預設)", mon: "週一", tue: "週二", wed: "週三", thu: "週四", fri: "週五", sat: "週六", sun: "週日" },
|
|
1206
|
-
DRIFTNET_WEBHOOK_ALLOW_LOCAL: { "": "否(只允許公開位址)", 1: "是" },
|
|
1207
|
-
DRIFTNET_LLM_ALLOW_LOCAL: { "": "否(只有這台電腦和公開位址)", 1: "是" },
|
|
1208
|
-
DRIFTNET_HEALTH: { "": "關閉(預設)", off: "關閉", weekly: "每週(建議)" },
|
|
1209
|
-
DRIFTNET_EMBED: { "": "自動(預設):找到本機模型就開", auto: "自動:找到本機模型就開", off: "關閉" },
|
|
1210
|
-
DRIFTNET_EMBED_PROVIDER: { "": "自動(只找本機 Ollama)", ollama: "Ollama(在這台電腦上)", openai: "OpenAI", gemini: "Gemini" },
|
|
1211
|
-
DRIFTNET_UPDATE_CHECK: { "": "關閉(預設)", 1: "開啟", 0: "關閉" },
|
|
1212
|
-
DRIFTNET_VIDEO: { "": "自動(預設)", auto: "自動:有找到工具就用", captions: "只抓字幕(省電:不下載影片、不跑文字辨識和語音模型)", watch: "再讓 Gemini/Vertex 直接看影片(會把影片或 YouTube 連結送給該模型)", off: "關閉" },
|
|
1213
|
-
DRIFTNET_VIDEO_FRAMES: { "": "關閉(預設)", off: "關閉", vision: "把最多 8 張畫面附在摘要請求裡(需要視覺模型)" },
|
|
1214
|
-
},
|
|
1215
|
-
},
|
|
1216
|
-
},
|
|
1217
1043
|
};
|
|
1218
1044
|
const state = { view: "all", category: "", kind: "", q: "" };
|
|
1219
1045
|
/** While a pane renders (split view), $("list") means that pane, so the list and map renderers can share the page unchanged. */
|
|
@@ -1273,7 +1099,7 @@
|
|
|
1273
1099
|
const n = Math.max(0, kids(null).findIndex((x) => x.id === f?.id));
|
|
1274
1100
|
return `var(--m${(n % 8) + 1})`;
|
|
1275
1101
|
}
|
|
1276
|
-
const catLabel = (id) => catLabels[id]?.[locale] ?? id;
|
|
1102
|
+
const catLabel = (id) => catLabels[id]?.[locale] ?? (locale === "zh-CN" ? catLabels[id]?.["zh-TW"] : undefined) ?? catLabels[id]?.en ?? id;
|
|
1277
1103
|
|
|
1278
1104
|
// Private instances need the token on every request; it stays in this browser only.
|
|
1279
1105
|
// A link with ?key= (a read-only share key, e.g. from a chat bot or an agent) opens the page
|
|
@@ -1286,6 +1112,15 @@
|
|
|
1286
1112
|
u.searchParams.delete("key");
|
|
1287
1113
|
history.replaceState(null, "", u.pathname + u.search + u.hash);
|
|
1288
1114
|
})();
|
|
1115
|
+
// Web Share Target (Android PWA): catch ?share_url= / ?share_text= from the OS share sheet and clear the URL.
|
|
1116
|
+
let pendingShare = (() => {
|
|
1117
|
+
const u = new URL(location.href);
|
|
1118
|
+
const raw = [u.searchParams.get("share_url"), u.searchParams.get("share_text"), u.searchParams.get("share_title")].filter(Boolean).join(" ");
|
|
1119
|
+
if (!raw) return "";
|
|
1120
|
+
for (const k of ["share_url", "share_text", "share_title"]) u.searchParams.delete(k);
|
|
1121
|
+
history.replaceState(null, "", u.pathname + u.search + u.hash);
|
|
1122
|
+
return raw.match(/https?:\/\/[^\s<>"]+/)?.[0] ?? "";
|
|
1123
|
+
})();
|
|
1289
1124
|
// A card's own signed link (?card=<id>&s=…, what a chat reply carries on a private catalogue) opens that one
|
|
1290
1125
|
// card without any key. The signature leaves the address bar at once; with a key or password the page is just the page.
|
|
1291
1126
|
const cardOnly = (() => {
|
|
@@ -1356,12 +1191,36 @@
|
|
|
1356
1191
|
openModal(item.id, "link");
|
|
1357
1192
|
}
|
|
1358
1193
|
|
|
1194
|
+
const LOCALE_ORDER = ["en", "zh-TW", "zh-CN", "ja", "ko", "es"];
|
|
1195
|
+
const HTML_LANG = { en: "en", "zh-TW": "zh-Hant", "zh-CN": "zh-Hans", ja: "ja", ko: "ko", es: "es" };
|
|
1196
|
+
async function ensureLocale(code) {
|
|
1197
|
+
if (!code || code === "en" || STRINGS[code]) return;
|
|
1198
|
+
if (!LOCALE_ORDER.includes(code)) return;
|
|
1199
|
+
try {
|
|
1200
|
+
const mod = await import(`./locales/${code}.js`);
|
|
1201
|
+
if (mod?.default) STRINGS[code] = mergeLocale(STRINGS.en, mod.default);
|
|
1202
|
+
} catch {}
|
|
1203
|
+
}
|
|
1204
|
+
function detectBrowserLocale() {
|
|
1205
|
+
const langs = navigator.languages?.length ? navigator.languages : [navigator.language || ""];
|
|
1206
|
+
for (const raw of langs) {
|
|
1207
|
+
const l = String(raw).toLowerCase();
|
|
1208
|
+
if (l === "zh-tw" || l === "zh-hk" || l === "zh-mo" || l.startsWith("zh-hant")) return "zh-TW";
|
|
1209
|
+
if (l === "zh-cn" || l === "zh-sg" || l.startsWith("zh-hans") || l === "zh") return "zh-CN";
|
|
1210
|
+
if (l.startsWith("ja")) return "ja";
|
|
1211
|
+
if (l.startsWith("ko")) return "ko";
|
|
1212
|
+
if (l.startsWith("es")) return "es";
|
|
1213
|
+
if (l.startsWith("en")) return "en";
|
|
1214
|
+
}
|
|
1215
|
+
return "en";
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1359
1218
|
function applyLocale() {
|
|
1360
|
-
document.documentElement.lang = locale;
|
|
1361
|
-
document.querySelector(".skip").textContent =
|
|
1219
|
+
document.documentElement.lang = HTML_LANG[locale] ?? locale;
|
|
1220
|
+
document.querySelector(".skip").textContent = T().skip;
|
|
1362
1221
|
$("q").placeholder = T().search;
|
|
1363
1222
|
$("q").setAttribute("aria-label", T().search);
|
|
1364
|
-
$("lang").
|
|
1223
|
+
$("lang").value = locale;
|
|
1365
1224
|
$("palette-btn").textContent = isMac ? "⌘K" : "Ctrl K";
|
|
1366
1225
|
$("palette-btn").title = $("palette-btn").ariaLabel = T().palette;
|
|
1367
1226
|
$("add-btn").innerHTML = ic("plus"); $("add-btn").title = $("add-btn").ariaLabel = `${T().addTitle} (a)`;
|
|
@@ -1434,7 +1293,9 @@
|
|
|
1434
1293
|
|
|
1435
1294
|
async function load() {
|
|
1436
1295
|
const saved = store.get("driftnet-locale");
|
|
1437
|
-
|
|
1296
|
+
const hasSaved = LOCALE_ORDER.includes(saved);
|
|
1297
|
+
locale = hasSaved ? saved : detectBrowserLocale();
|
|
1298
|
+
await ensureLocale(locale);
|
|
1438
1299
|
applyLocale();
|
|
1439
1300
|
let stats, ui;
|
|
1440
1301
|
try {
|
|
@@ -1453,7 +1314,8 @@
|
|
|
1453
1314
|
document.body.classList.toggle("readonly", role !== "admin");
|
|
1454
1315
|
$("lock").hidden = role === "admin";
|
|
1455
1316
|
if (ui.setup && !store.get("driftnet-setup-seen")) { store.set("driftnet-setup-seen", "1"); setTimeout(() => openSettings(true), 300); }
|
|
1456
|
-
if (!
|
|
1317
|
+
if (!hasSaved && LOCALE_ORDER.includes(ui.locale)) locale = ui.locale;
|
|
1318
|
+
await ensureLocale(locale);
|
|
1457
1319
|
applyLocale();
|
|
1458
1320
|
$("stats").textContent = T().stats(stats.items, stats.shares);
|
|
1459
1321
|
showUpdate(stats.update);
|
|
@@ -1921,7 +1783,7 @@
|
|
|
1921
1783
|
if (s.choices) input = `<select data-key="${s.key}" ${dis}>${s.choices.map((c) => opt(c, st.choices[s.key]?.[c] ?? c, s.value ?? "")).join("")}</select>`;
|
|
1922
1784
|
else if (s.multiline) input = `<textarea data-key="${s.key}" rows="3" ${dis}>${esc(s.value)}</textarea>`;
|
|
1923
1785
|
else if (s.secret) input = `<input data-key="${s.key}" type="password" autocomplete="off" placeholder="${esc(s.set ? st.keep : st.unset)}" ${dis}>`;
|
|
1924
|
-
else input = `<input data-key="${s.key}" value="${esc(s.value)}" autocomplete="off" ${dis}>`;
|
|
1786
|
+
else input = `<input data-key="${s.key}" value="${esc(s.value)}" autocomplete="off" ${s.key === "DRIFTNET_LANGUAGE" ? `placeholder="${esc(st.langPlaceholder)}"` : ""} ${dis}>`;
|
|
1925
1787
|
return `<label class="set-row"><span>${esc(label)}</span>${input}${hint ? `<small>${esc(hint)}</small>` : ""}<small class="envname">${esc(s.key)}</small></label>`;
|
|
1926
1788
|
};
|
|
1927
1789
|
const group = (g) => `<fieldset class="set-group"><legend>${esc(st[g])}</legend>${serverSettings.settings.filter((s) => s.group === g).map(field).join("")}</fieldset>`;
|
|
@@ -1950,7 +1812,10 @@
|
|
|
1950
1812
|
? section("general", local) + section("access", server) + section("ai", server) + section("chats", server)
|
|
1951
1813
|
: section("general", local + server.general) + section("access", server.access) + section("ai", server.ai) + section("chats", server.chats));
|
|
1952
1814
|
$("st-body").dataset.tab = tab;
|
|
1815
|
+
$("st-body").classList.toggle("is-welcome", !!welcome);
|
|
1816
|
+
detectedAi = [];
|
|
1953
1817
|
placeAi();
|
|
1818
|
+
if (serverSettings && tab === "ai") probeLocalAi();
|
|
1954
1819
|
$("st-cancel").textContent = t.cancel;
|
|
1955
1820
|
$("st-save").textContent = st.save;
|
|
1956
1821
|
// Re-drawn while open (after saving a chat token): keep who opened it.
|
|
@@ -2019,17 +1884,47 @@
|
|
|
2019
1884
|
GOOGLE_CLOUD_PROJECT: "vertex", DRIFTNET_VERTEX_CREDENTIALS: "vertex" };
|
|
2020
1885
|
const AI_ADVANCED = ["TYPESAFE_API_KEY", "GITHUB_TOKEN", "DRIFTNET_EMBED", "DRIFTNET_EMBED_PROVIDER", "DRIFTNET_EMBED_MODEL", "DRIFTNET_EMBED_BASE_URL",
|
|
2021
1886
|
"DRIFTNET_EMBED_API_KEY", "DRIFTNET_EMBED_FLOOR", "DRIFTNET_YTDLP", "DRIFTNET_FFMPEG", "DRIFTNET_TESSERACT", "DRIFTNET_WHISPER", "DRIFTNET_YTDLP_COOKIES", "DRIFTNET_YTDLP_IMPERSONATE"];
|
|
1887
|
+
// Rarely needed knobs: kept out of the first screen of Settings › AI.
|
|
1888
|
+
const AI_ADVANCED_EXTRA = ["DRIFTNET_JUDGE", "DRIFTNET_BLOCK_DOMAINS", "DRIFTNET_LINKS_PER_MESSAGE", "DRIFTNET_LINKS_PER_HOUR", "DRIFTNET_HEALTH", "DRIFTNET_VIDEO", "DRIFTNET_VIDEO_FRAMES"];
|
|
1889
|
+
let detectedAi = [];
|
|
2022
1890
|
function aiPanel(sv, field) {
|
|
2023
1891
|
const st = T().st, all = sv.settings;
|
|
2024
|
-
const adv = new Set(AI_ADVANCED);
|
|
1892
|
+
const adv = new Set([...AI_ADVANCED, ...AI_ADVANCED_EXTRA]);
|
|
2025
1893
|
if (all.find((x) => x.key === "DRIFTNET_JUDGE")?.value !== "rules") adv.add("DRIFTNET_JUDGE_RULES");
|
|
2026
1894
|
const row = (s, n) => field(s).replace('<label class="set-row"', `<label class="set-row" data-n="${n}"${PROVIDER_FIELDS[s.key] ? ` data-for="${PROVIDER_FIELDS[s.key]}"` : ""}`);
|
|
2027
1895
|
const pick = (test) => all.map((s, n) => (test(s) ? row(s, n) : "")).join("");
|
|
2028
1896
|
const plain = (g) => (s) => s.group === g && !adv.has(s.key) && !PROVIDER_FIELDS[s.key] && s.key !== "DRIFTNET_LLM_PROVIDER";
|
|
2029
|
-
return `<
|
|
1897
|
+
return `<div class="ai-detect" id="ai-detect"></div>` +
|
|
1898
|
+
`<fieldset class="set-group"><legend>${esc(st.model)}</legend>${pick((s) => s.key === "DRIFTNET_LLM_PROVIDER")}<div id="ai-prov"></div>` +
|
|
1899
|
+
`<div class="ai-test-row"><button type="button" class="btn" id="ai-test">${esc(st.aiTest)}</button><span class="hint" id="ai-test-out" role="status" aria-live="polite"></span></div>` +
|
|
1900
|
+
`${pick(plain("model"))}</fieldset>` +
|
|
2030
1901
|
`<fieldset class="set-group"><legend>${esc(st.rules)}</legend>${pick(plain("rules"))}</fieldset>` +
|
|
2031
1902
|
`<details class="set-adv"><summary>${esc(st.advanced)}</summary><small>${esc(st.advancedHelp)}</small><div id="ai-prov-other">${pick((s) => !!PROVIDER_FIELDS[s.key])}</div>${pick((s) => adv.has(s.key))}</details>`;
|
|
2032
1903
|
}
|
|
1904
|
+
async function probeLocalAi(force = false) {
|
|
1905
|
+
const box = $("ai-detect");
|
|
1906
|
+
if (!box || !serverSettings) return;
|
|
1907
|
+
if (!force && box.dataset.probed === "1") return;
|
|
1908
|
+
box.dataset.probed = "1";
|
|
1909
|
+
const st = T().st;
|
|
1910
|
+
box.innerHTML = `<div class="ai-detect-head"><span>${esc(st.aiDetectScanning)}</span></div>`;
|
|
1911
|
+
let list = [];
|
|
1912
|
+
try {
|
|
1913
|
+
const data = await api("/api/settings/detect-ai");
|
|
1914
|
+
if (Array.isArray(data?.detected)) list = data.detected;
|
|
1915
|
+
} catch {
|
|
1916
|
+
list = [];
|
|
1917
|
+
}
|
|
1918
|
+
if (!box.isConnected) return;
|
|
1919
|
+
detectedAi = list;
|
|
1920
|
+
if (list.length) {
|
|
1921
|
+
box.innerHTML = `<div class="ai-detect-head"><b>${esc(st.aiDetectTitle)}</b><button type="button" class="btn compact" id="ai-rescan">${esc(st.aiDetectRescan)}</button></div>` +
|
|
1922
|
+
`<div class="ai-detect-chips">${list.map((d) => `<button type="button" class="chip" data-detect-id="${esc(d.id)}">${esc(d.label)}</button>`).join("")}</div>` +
|
|
1923
|
+
`<p class="ai-detect-hint" id="ai-detect-hint" role="status" aria-live="polite" hidden></p>`;
|
|
1924
|
+
} else {
|
|
1925
|
+
box.innerHTML = `<div class="ai-detect-head"><span>${esc(st.aiDetectNone)}</span><button type="button" class="btn compact" id="ai-rescan">${esc(st.aiDetectRescan)}</button></div>`;
|
|
1926
|
+
}
|
|
1927
|
+
}
|
|
2033
1928
|
/** Move each provider field next to the provider select when that provider uses it, else into Advanced. */
|
|
2034
1929
|
function placeAi() {
|
|
2035
1930
|
const sel = $("st-body").querySelector('[data-key="DRIFTNET_LLM_PROVIDER"]'), here = $("ai-prov"), there = $("ai-prov-other");
|
|
@@ -2185,6 +2080,7 @@
|
|
|
2185
2080
|
$("st-body").dataset.tab = b.dataset.tabBtn;
|
|
2186
2081
|
store.set("driftnet-settings-tab", b.dataset.tabBtn);
|
|
2187
2082
|
$("st-body").querySelectorAll("[data-tab-btn]").forEach((x) => { x.setAttribute("aria-selected", x === b); x.tabIndex = x === b ? 0 : -1; });
|
|
2083
|
+
if (b.dataset.tabBtn === "ai" && serverSettings) probeLocalAi();
|
|
2188
2084
|
}
|
|
2189
2085
|
$("st-body").addEventListener("keydown", (e) => {
|
|
2190
2086
|
const b = e.target.closest?.("[data-tab-btn]");
|
|
@@ -2336,6 +2232,51 @@
|
|
|
2336
2232
|
} else if (b.id === "st-login") {
|
|
2337
2233
|
$("settings-dlg").close();
|
|
2338
2234
|
openLogin();
|
|
2235
|
+
} else if (b.dataset.detectId) {
|
|
2236
|
+
const item = detectedAi.find((d) => d.id === b.dataset.detectId);
|
|
2237
|
+
if (!item?.values) return;
|
|
2238
|
+
for (const el of $("st-body").querySelectorAll("[data-key]")) {
|
|
2239
|
+
if (Object.prototype.hasOwnProperty.call(item.values, el.dataset.key) && !el.disabled) {
|
|
2240
|
+
el.value = item.values[el.dataset.key] ?? "";
|
|
2241
|
+
}
|
|
2242
|
+
}
|
|
2243
|
+
placeAi();
|
|
2244
|
+
const out = $("ai-test-out");
|
|
2245
|
+
if (out) { out.textContent = ""; delete out.dataset.state; }
|
|
2246
|
+
const hint = $("ai-detect-hint");
|
|
2247
|
+
if (hint) { hint.textContent = st.aiDetectApplied; hint.hidden = false; }
|
|
2248
|
+
} else if (b.id === "ai-rescan") {
|
|
2249
|
+
probeLocalAi(true);
|
|
2250
|
+
} else if (b.id === "ai-test") {
|
|
2251
|
+
const out = $("ai-test-out");
|
|
2252
|
+
const aiSec = $("st-body").querySelector('section[data-tab="ai"]');
|
|
2253
|
+
const values = {};
|
|
2254
|
+
for (const el of aiSec?.querySelectorAll("[data-key]:not([disabled])") ?? []) {
|
|
2255
|
+
const s = serverSettings?.settings?.find((x) => x.key === el.dataset.key);
|
|
2256
|
+
if (s?.secret) {
|
|
2257
|
+
if (el.value.trim()) values[el.dataset.key] = el.value;
|
|
2258
|
+
} else {
|
|
2259
|
+
values[el.dataset.key] = el.value.trim() === "" ? null : el.value;
|
|
2260
|
+
}
|
|
2261
|
+
}
|
|
2262
|
+
b.disabled = true;
|
|
2263
|
+
if (out) { out.textContent = st.aiTesting; delete out.dataset.state; }
|
|
2264
|
+
const token = store.get("driftnet-token");
|
|
2265
|
+
const res = await fetch("/api/settings/test-ai", {
|
|
2266
|
+
method: "POST",
|
|
2267
|
+
headers: { "content-type": "application/json", ...(token ? { authorization: `Bearer ${token}` } : {}) },
|
|
2268
|
+
body: JSON.stringify({ values }),
|
|
2269
|
+
}).catch(() => null);
|
|
2270
|
+
const data = await res?.json().catch(() => null);
|
|
2271
|
+
if (b.isConnected) b.disabled = false;
|
|
2272
|
+
if (!out?.isConnected) return;
|
|
2273
|
+
if (res?.ok && data?.ok) {
|
|
2274
|
+
out.dataset.state = "ok";
|
|
2275
|
+
out.textContent = st.aiTestOk(data.provider ?? "", data.ms ?? 0);
|
|
2276
|
+
} else {
|
|
2277
|
+
out.dataset.state = "err";
|
|
2278
|
+
out.textContent = `✕ ${friendlyError(data?.error) ?? data?.error ?? T().failed}`;
|
|
2279
|
+
}
|
|
2339
2280
|
} else if (b.id === "ac-show") {
|
|
2340
2281
|
const i = $("ac-pw"); i.type = i.type === "password" ? "text" : "password"; b.textContent = i.type === "password" ? st.show : st.hide;
|
|
2341
2282
|
} else if (b.id === "ac-gen") {
|
|
@@ -2344,9 +2285,14 @@
|
|
|
2344
2285
|
await navigator.clipboard?.writeText(i.value).catch(() => {});
|
|
2345
2286
|
toast(st.genCopied);
|
|
2346
2287
|
} else if (b.id === "ac-newkey") {
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2288
|
+
const regen = async () => {
|
|
2289
|
+
// Whatever was typed (a new password, private reading) is saved first, not thrown away.
|
|
2290
|
+
if (!(await saveSettings())) return;
|
|
2291
|
+
if (await adminFetch("/api/read-key", "POST", {})) openSettings();
|
|
2292
|
+
};
|
|
2293
|
+
// An existing key stops working when replaced: ask twice. The first key needs no confirmation.
|
|
2294
|
+
if ($("ac-key")) return confirmClick(b, st.shareKeySure, regen);
|
|
2295
|
+
return regen();
|
|
2350
2296
|
} else if (b.id === "at-create") {
|
|
2351
2297
|
const name = $("at-name").value.trim();
|
|
2352
2298
|
if (!name) { $("st-error").textContent = st.tokNameNeeded; return; }
|
|
@@ -3026,7 +2972,7 @@
|
|
|
3026
2972
|
$("md-scroll").innerHTML = `${galleryHtml(i)}
|
|
3027
2973
|
<h3 id="md-title"><a href="${esc(url)}" target="_blank" rel="noopener noreferrer">${esc(name)}</a></h3>
|
|
3028
2974
|
<p class="md-sub"><span class="badge folder" style="--c:${folderColor(i.category)}">${esc(folderPath(i.category))}</span>
|
|
3029
|
-
|
|
2975
|
+
${i.worth === "normal" ? "" : `<span class="rating ${i.worth === "must-see" ? "must" : ""}">${i.worth === "must-see" ? ic("star") : ""}${esc(t.worth[i.worth] ?? i.worth)}</span>`}
|
|
3030
2976
|
${healthBadge(i)}${starsHtml(i)}
|
|
3031
2977
|
<span>#${i.id} · ${esc(t.kind1?.[i.kind] ?? t.kinds[i.kind] ?? i.kind)}</span></p>
|
|
3032
2978
|
${s?.oneLiner ? `<p class="md-one">${esc(s.oneLiner)}</p>` : ""}
|
|
@@ -3329,9 +3275,9 @@
|
|
|
3329
3275
|
function openLogin() {
|
|
3330
3276
|
const st = T().st;
|
|
3331
3277
|
$("lg-title").textContent = st.loginTitle;
|
|
3332
|
-
$("lg-label").textContent =
|
|
3278
|
+
$("lg-label").textContent = T().lgLabel;
|
|
3333
3279
|
$("lg-help").textContent = st.loginHelp;
|
|
3334
|
-
$("lg-adv-s").textContent =
|
|
3280
|
+
$("lg-adv-s").textContent = T().lgForgot;
|
|
3335
3281
|
$("lg-adv").textContent = st.loginAdvanced.replaceAll("PORT", String(serverPort));
|
|
3336
3282
|
$("lg-ok").textContent = st.loginOk;
|
|
3337
3283
|
$("lg-cancel").textContent = T().cancel;
|
|
@@ -3830,7 +3776,7 @@
|
|
|
3830
3776
|
pageBusy = false;
|
|
3831
3777
|
pageObserver?.disconnect();
|
|
3832
3778
|
const t = T();
|
|
3833
|
-
const fresh = state.view === "all" && !state.q && !state.category && !state.kind && role === "admin";
|
|
3779
|
+
const fresh = state.view === "all" && !state.q && !state.category && !state.kind && pageTotal === 0 && role === "admin";
|
|
3834
3780
|
const empty = state.view === "trash" ? t.emptyTrash : state.view === "favorites" ? t.emptyFav : state.view === "inbox" ? t.emptyInbox : state.view === "review" ? t.emptyReview : fresh ? t.emptyStart : t.empty;
|
|
3835
3781
|
// A link typed into search: offer to save it (right away for a full URL, otherwise only when nothing matched).
|
|
3836
3782
|
const addQ = role === "admin" && state.q && linkLike(state.q) && (!items.length || /^(https?:\/\/|www\.)/i.test(state.q))
|
|
@@ -3839,21 +3785,32 @@
|
|
|
3839
3785
|
// Nothing matched the words as typed: say which spelling was searched, and offer the original.
|
|
3840
3786
|
const fixed = items.length && state.q && meta.corrected
|
|
3841
3787
|
? `<p class="hint corrected">${esc(t.showingFor(meta.corrected))} — <button type="button" data-search-exact>${esc(t.searchInstead(state.q))}</button></p>` : "";
|
|
3788
|
+
const onboardHtml = `<div class="onboard">
|
|
3789
|
+
<div class="onboard-head"><h2>${esc(t.obTitle)}</h2><p>${esc(t.obSub)}</p></div>
|
|
3790
|
+
<div class="onboard-grid">
|
|
3791
|
+
<div class="onboard-card"><h3>${ic("plus")} ${esc(t.obAddTitle)}</h3><p>${esc(t.obAddDesc)}</p>
|
|
3792
|
+
<div class="onboard-acts"><button class="btn primary" type="button" data-empty-add>${ic("plus")} ${esc(t.obAddBtn)}</button>
|
|
3793
|
+
<button class="btn" type="button" data-empty-sample>${esc(t.obSampleBtn)}</button></div></div>
|
|
3794
|
+
<div class="onboard-card"><h3>${ic("download")} ${esc(t.obImpTitle)}</h3><p>${esc(t.obImpDesc)}</p>
|
|
3795
|
+
<div class="onboard-acts"><button class="btn" type="button" data-empty-import>${ic("download")} ${esc(t.obImpBtn)}</button></div></div>
|
|
3796
|
+
<div class="onboard-card"><h3>${ic("plug")} ${esc(t.obConnTitle)}</h3><p>${esc(t.obConnDesc)}</p>
|
|
3797
|
+
<div class="onboard-acts"><button class="btn" type="button" data-connect-empty>${ic("plug")} ${esc(t.obConnBtn)}</button></div></div>
|
|
3798
|
+
</div></div>${templateChooser(t)}`;
|
|
3799
|
+
// One-time, dismissible hint when cards are waiting but no summary model is configured.
|
|
3800
|
+
const aiBanner = role === "admin" && !summaries && items.some((x) => x.pending) && store.get("driftnet-ai-banner") !== "dismissed"
|
|
3801
|
+
? `<div class="ai-banner" role="note"><span>${esc(t.aiBannerText)}</span><button type="button" class="btn primary compact" data-open-ai>${esc(t.aiBannerOpen)}</button><button type="button" class="btn compact" data-ai-banner-dismiss>${esc(t.aiBannerDismiss)}</button></div>` : "";
|
|
3842
3802
|
$("list").innerHTML = items.length
|
|
3843
|
-
? fixed + addQ + (state.view === "trash" ? `<div class="trash-bar"><button class="btn danger" type="button" id="trash-empty">${ic("trash")} ${esc(t.emptyTrashBtn)}</button></div>` : "") + `<p class="hint swipe-hint">${esc(state.view === "trash" ? t.hintTrash : state.view === "inbox" ? t.hintInbox : state.view === "review" ? t.hintReview : t.hint)}</p>` + items.map(card).join("") + moreHtml()
|
|
3803
|
+
? aiBanner + fixed + addQ + (state.view === "trash" ? `<div class="trash-bar"><button class="btn danger" type="button" id="trash-empty">${ic("trash")} ${esc(t.emptyTrashBtn)}</button></div>` : "") + `<p class="hint swipe-hint">${esc(state.view === "trash" ? t.hintTrash : state.view === "inbox" ? t.hintInbox : state.view === "review" ? t.hintReview : t.hint)}</p>` + items.map(card).join("") + moreHtml()
|
|
3844
3804
|
: state.q
|
|
3845
3805
|
// Searching found nothing: say so (not "Inbox zero"), and offer the whole catalogue when only part of it was searched.
|
|
3846
|
-
? `<div class="empty nomatch"><span>${esc(t.noMatch(state.q, viewName()))}</span>${scoped ? `<button class="btn" type="button" data-search-all>${esc(t.searchAll)}</button>` : ""}
|
|
3847
|
-
: `<div class="empty first"
|
|
3848
|
-
? `<form class="add" id="add-form"><input id="add-url" type="text" inputmode="url" autocapitalize="off" spellcheck="false" placeholder="${esc(t.addPlaceholder)}" aria-label="${esc(t.addPlaceholder)}">
|
|
3849
|
-
<button class="btn primary" type="submit">${ic("plus")} ${esc(t.addLink)}</button></form>
|
|
3850
|
-
<button class="btn" type="button" data-connect-empty>${ic("plug")} ${esc(t.st.connect)}</button>${templateChooser(t)}` : ""}</div>`;
|
|
3806
|
+
? `<div class="empty nomatch"><span>${esc(t.noMatch(state.q, viewName()))}</span>${scoped ? `<button class="btn" type="button" data-search-all>${esc(t.searchAll)}</button>` : ""}<button class="btn" type="button" data-clear-search>${esc(t.clearSearch)}</button>${addQ}</div>`
|
|
3807
|
+
: `<div class="empty first">${fresh ? onboardHtml : `<span>${esc(empty)}</span>`}</div>`;
|
|
3851
3808
|
$("list").querySelector("[data-add-q]")?.addEventListener("click", (e) => { const b = e.currentTarget; b.disabled = true; addUrl(state.q).then(() => { if (b.isConnected) b.disabled = false; }); });
|
|
3809
|
+
$("list").querySelector("[data-clear-search]")?.addEventListener("click", () => { $("q").value = ""; state.q = ""; load(); $("q").focus(); });
|
|
3852
3810
|
$("list").querySelector("[data-search-all]")?.addEventListener("click", () => { Object.assign(state, { view: "all", category: "", kind: "" }); load(); });
|
|
3853
3811
|
$("list").querySelector("[data-search-exact]")?.addEventListener("click", () => { exactQ = state.q; render(); });
|
|
3854
3812
|
watchMore();
|
|
3855
3813
|
if (keep) scrollTo({ top: y });
|
|
3856
|
-
$("add-form")?.addEventListener("submit", addLink);
|
|
3857
3814
|
$("trash-empty")?.addEventListener("click", (e) => confirmClick(e.currentTarget, T().emptyTrashSure(pageTotal), async () => {
|
|
3858
3815
|
const r = await mapWrite("/api/trash", "DELETE");
|
|
3859
3816
|
if (!r) return;
|
|
@@ -3861,6 +3818,14 @@
|
|
|
3861
3818
|
load(); refreshCounts();
|
|
3862
3819
|
}));
|
|
3863
3820
|
for (const b of $("list").querySelectorAll("[data-template]")) b.addEventListener("click", () => pickTemplate(b.dataset.template));
|
|
3821
|
+
$("list").querySelector("[data-empty-add]")?.addEventListener("click", () => openAdd());
|
|
3822
|
+
$("list").querySelector("[data-empty-sample]")?.addEventListener("click", (e) => {
|
|
3823
|
+
const sampleUrl = "https://github.com/KevinChu1110/driftnet";
|
|
3824
|
+
if (role !== "admin") return openAdd(sampleUrl);
|
|
3825
|
+
const b = e.currentTarget; b.disabled = true;
|
|
3826
|
+
addUrl(sampleUrl).then(() => { if (b.isConnected) b.disabled = false; });
|
|
3827
|
+
});
|
|
3828
|
+
$("list").querySelector("[data-empty-import]")?.addEventListener("click", () => openSettings(false, "general").then(() => $("import-panel")?.scrollIntoView({ behavior: "smooth", block: "nearest" })));
|
|
3864
3829
|
$("list").querySelector("[data-connect-empty]")?.addEventListener("click", () => openConnect());
|
|
3865
3830
|
for (const el of $("list").querySelectorAll(".swipe")) attachSwipe(el);
|
|
3866
3831
|
syncSelection();
|
|
@@ -3914,8 +3879,8 @@
|
|
|
3914
3879
|
<div class="top">
|
|
3915
3880
|
<a class="name" id="name-${i.id}" href="${esc(url)}" target="_blank" rel="noopener noreferrer">${esc(s?.name ?? i.title)}</a>
|
|
3916
3881
|
<span class="badge folder" style="--c:${folderColor(i.category)}">${esc(catLabel(i.category))}</span>
|
|
3917
|
-
|
|
3918
|
-
${i.pending ? `<span class="rating">${esc(summaries ? t.pending : t.noModel)}</span>` : ""}
|
|
3882
|
+
${i.worth === "normal" ? "" : `<span class="rating ${i.worth === "must-see" ? "must" : ""}">${i.worth === "must-see" ? ic("star") : ""}${esc(t.worth[i.worth] ?? i.worth)}</span>`}
|
|
3883
|
+
${i.pending ? (summaries || role !== "admin" ? `<span class="rating">${esc(summaries ? t.pending : t.noModel)}</span>` : `<button type="button" class="rating rating-btn" data-open-ai title="${esc(t.noModelTip)}">${esc(t.noModel)}</button>`) : ""}
|
|
3919
3884
|
${healthBadge(i)}
|
|
3920
3885
|
</div>
|
|
3921
3886
|
${s ? `<p>${esc(s.oneLiner)}</p>` : ""}
|
|
@@ -4169,6 +4134,8 @@
|
|
|
4169
4134
|
}
|
|
4170
4135
|
$("list").addEventListener("click", (e) => {
|
|
4171
4136
|
// With cards selected a click picks or drops the card; Shift-click selects a range. Links and buttons don't fire meanwhile.
|
|
4137
|
+
if (e.target.closest("[data-ai-banner-dismiss]")) { store.set("driftnet-ai-banner", "dismissed"); e.target.closest(".ai-banner")?.remove(); return; }
|
|
4138
|
+
if (e.target.closest("[data-open-ai]")) return openSettings(false, "ai");
|
|
4172
4139
|
const sw = e.target.closest(".swipe");
|
|
4173
4140
|
if (sw && role === "admin" && (e.shiftKey || selected.size) && !e.target.closest(".tool, .link-btn, .chip")) {
|
|
4174
4141
|
e.preventDefault();
|
|
@@ -4328,18 +4295,23 @@
|
|
|
4328
4295
|
applyPrefs();
|
|
4329
4296
|
}
|
|
4330
4297
|
const commands = [
|
|
4331
|
-
{ id: "add", label: { en: "Add a link…", "zh-TW": "收錄連結…" }, keys: ["a"], help: "kAdd", when: () => role === "admin", run: () => openAdd() },
|
|
4332
|
-
{ id: "view-list", label: { en: "Show the card list", "zh-TW": "顯示卡片列表" }, keys: ["g", "a"], help: "kAll", run: () => showLayout("list") },
|
|
4333
|
-
{ id: "view-map", label: { en: "Show the mind map", "zh-TW": "顯示樹狀圖" }, keys: ["g", "m"], help: "kMap", run: () => showLayout("map") },
|
|
4334
|
-
{ id: "view-split", label: { en: "Show cards and mind map side by side", "zh-TW": "並排顯示卡片與樹狀圖" }, when: () => wideQuery.matches, run: () => showLayout("split") },
|
|
4335
|
-
{ id: "move", label: { en: "Move the focused card…", "zh-TW": "移動目前選取的卡片…" }, when: () => role === "admin" && !!pal.focused, run: () => openMovePicker(pal.focused) },
|
|
4336
|
-
{ id: "new-folder", label: { en: "New folder", "zh-TW": "新增資料夾" }, when: () => role === "admin", run: () => openFolderDialog(null, null) },
|
|
4337
|
-
{ id: "export-md", label: { en: "Export as Markdown", "zh-TW": "匯出成 Markdown" }, run: () => download("markdown") },
|
|
4338
|
-
{ id: "export-vault", label: { en: "Download for Obsidian / Notion", "zh-TW": "下載給 Obsidian/Notion" }, run: () => download("vault") },
|
|
4339
|
-
{ id: "settings", label: { en: "Settings", "zh-TW": "設定" }, run: () => openSettings() },
|
|
4340
|
-
{ id: "dark", label: { en: "Toggle dark mode", "zh-TW": "切換深色模式" }, run: toggleDark },
|
|
4341
|
-
{ id: "language", label: { en: "Switch language", "zh-TW": "切換語言" }, run: () =>
|
|
4342
|
-
|
|
4298
|
+
{ id: "add", label: { en: "Add a link…", "zh-TW": "收錄連結…", "zh-CN": "收录链接…", ja: "リンクを追加…", ko: "링크 추가…", es: "Añadir un enlace…" }, keys: ["a"], help: "kAdd", when: () => role === "admin", run: () => openAdd() },
|
|
4299
|
+
{ id: "view-list", label: { en: "Show the card list", "zh-TW": "顯示卡片列表", "zh-CN": "显示卡片列表", ja: "カード一覧を表示", ko: "카드 목록 보기", es: "Mostrar lista de tarjetas" }, keys: ["g", "a"], help: "kAll", run: () => showLayout("list") },
|
|
4300
|
+
{ id: "view-map", label: { en: "Show the mind map", "zh-TW": "顯示樹狀圖", "zh-CN": "显示思维导图", ja: "マインドマップを表示", ko: "마인드맵 보기", es: "Mostrar mapa mental" }, keys: ["g", "m"], help: "kMap", run: () => showLayout("map") },
|
|
4301
|
+
{ id: "view-split", label: { en: "Show cards and mind map side by side", "zh-TW": "並排顯示卡片與樹狀圖", "zh-CN": "并排显示卡片与思维导图", ja: "カードとマインドマップを並べて表示", ko: "카드와 마인드맵 나란히 보기", es: "Mostrar tarjetas y mapa mental en paralelo" }, when: () => wideQuery.matches, run: () => showLayout("split") },
|
|
4302
|
+
{ id: "move", label: { en: "Move the focused card…", "zh-TW": "移動目前選取的卡片…", "zh-CN": "移动当前选中的卡片…", ja: "選択中のカードを移動…", ko: "선택한 카드 이동…", es: "Mover la tarjeta seleccionada…" }, when: () => role === "admin" && !!pal.focused, run: () => openMovePicker(pal.focused) },
|
|
4303
|
+
{ id: "new-folder", label: { en: "New folder", "zh-TW": "新增資料夾", "zh-CN": "新建文件夹", ja: "新しいフォルダ", ko: "새 폴더", es: "Nueva carpeta" }, when: () => role === "admin", run: () => openFolderDialog(null, null) },
|
|
4304
|
+
{ id: "export-md", label: { en: "Export as Markdown", "zh-TW": "匯出成 Markdown", "zh-CN": "导出为 Markdown", ja: "Markdown としてエクスポート", ko: "Markdown으로 내보내기", es: "Exportar como Markdown" }, run: () => download("markdown") },
|
|
4305
|
+
{ id: "export-vault", label: { en: "Download for Obsidian / Notion", "zh-TW": "下載給 Obsidian/Notion", "zh-CN": "下载给 Obsidian/Notion", ja: "Obsidian / Notion 用にダウンロード", ko: "Obsidian / Notion용 다운로드", es: "Descargar para Obsidian / Notion" }, run: () => download("vault") },
|
|
4306
|
+
{ id: "settings", label: { en: "Settings", "zh-TW": "設定", "zh-CN": "设置", ja: "設定", ko: "설정", es: "Ajustes" }, run: () => openSettings() },
|
|
4307
|
+
{ id: "dark", label: { en: "Toggle dark mode", "zh-TW": "切換深色模式", "zh-CN": "切换深色模式", ja: "ダークモードを切り替え", ko: "다크 모드 전환", es: "Alternar modo oscuro" }, run: toggleDark },
|
|
4308
|
+
{ id: "language", label: { en: "Switch language", "zh-TW": "切換語言", "zh-CN": "切换语言", ja: "言語を切り替え", ko: "언어 전환", es: "Cambiar idioma" }, run: async () => {
|
|
4309
|
+
locale = LOCALE_ORDER[(LOCALE_ORDER.indexOf(locale) + 1) % LOCALE_ORDER.length];
|
|
4310
|
+
store.set("driftnet-locale", locale);
|
|
4311
|
+
await ensureLocale(locale);
|
|
4312
|
+
load();
|
|
4313
|
+
} },
|
|
4314
|
+
{ id: "keys", label: { en: "Keyboard shortcuts", "zh-TW": "快捷鍵", "zh-CN": "快捷键", ja: "キーボードショートカット", ko: "키보드 단축키", es: "Atajos de teclado" }, keys: ["?"], help: "kHelp", run: () => openKeys() },
|
|
4343
4315
|
];
|
|
4344
4316
|
const cmdLabel = (c) => c.label[locale] ?? c.label.en;
|
|
4345
4317
|
const goFolder = (id) => { Object.assign(state, { view: "all", category: id, kind: "" }); load(); };
|
|
@@ -4606,9 +4578,12 @@
|
|
|
4606
4578
|
else if (k === "n") openItemNote(Number(swipe.dataset.id));
|
|
4607
4579
|
});
|
|
4608
4580
|
|
|
4609
|
-
$("lang").
|
|
4610
|
-
|
|
4581
|
+
$("lang").onchange = async (e) => {
|
|
4582
|
+
const next = e.target.value;
|
|
4583
|
+
if (!LOCALE_ORDER.includes(next)) return;
|
|
4584
|
+
locale = next;
|
|
4611
4585
|
store.set("driftnet-locale", locale);
|
|
4586
|
+
await ensureLocale(locale);
|
|
4612
4587
|
load();
|
|
4613
4588
|
};
|
|
4614
4589
|
let timer;
|
|
@@ -4634,7 +4609,10 @@
|
|
|
4634
4609
|
store.set(dev.scope === "write" ? "driftnet-key" : "driftnet-token", "");
|
|
4635
4610
|
toast(T().st.pairOk);
|
|
4636
4611
|
}
|
|
4637
|
-
claimPairing().finally(
|
|
4612
|
+
claimPairing().finally(async () => {
|
|
4613
|
+
await load();
|
|
4614
|
+
if (pendingShare && role === "admin") { const u = pendingShare; pendingShare = ""; openAdd(u); }
|
|
4615
|
+
});
|
|
4638
4616
|
</script>
|
|
4639
4617
|
</body>
|
|
4640
4618
|
</html>
|