dsh-cookie-cleaner 0.2.0 → 0.2.1
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/CHANGELOG.md +158 -114
- package/README.md +314 -236
- package/dsh.plugin.json +2 -2
- package/lib/client.js +57 -92
- package/lib/client.js.map +1 -1
- package/package.json +2 -2
- package/src/api-routes.js +19 -11
- package/src/cli.js +6 -1
- package/src/client/card.tsx +47 -56
- package/src/client/locales.ts +2 -5
- package/src/client/routes.ts +29 -8
- package/src/core.js +98 -0
- package/src/index.js +31 -27
- package/src/jar-live.js +365 -0
- package/src/locales-patch.js +13 -10
- package/src/patch-guard.js +4 -91
- package/src/patch-model.js +4 -45
- package/src/report.js +51 -12
package/lib/client.js
CHANGED
|
@@ -91,6 +91,10 @@ window.__ModuleLoader__.load({
|
|
|
91
91
|
fixed: t$1("已写入:{changed}", "written: {changed}", "書き込み完了:{changed}", "기록됨: {changed}", "écrit : {changed}", "geschrieben: {changed}", "scritto: {changed}", "записано: {changed}", "escrito: {changed}"),
|
|
92
92
|
auditLine: t$1("上次修复:{at}(修复前 {before} → 现在 {after})", "last fix: {at} (was {before} → now {after})", "前回修復:{at}(修復前 {before} → 現在 {after})", "마지막 복구: {at}(복구 전 {before} → 현재 {after})", "dernière réparation : {at} (de {before} à {after})", "letzte Korrektur: {at} (vorher {before} → jetzt {after})", "ultima correzione: {at} (da {before} a {after})", "последнее исправление: {at} (было {before} → стало {after})", "última reparación: {at} (de {before} a {after})"),
|
|
93
93
|
auditLineNew: t$1("上次修复:{at}(此前无覆盖行 → 现在 {after})", "last fix: {at} (there was no override row before → now {after})", "前回修復:{at}(それまでカバー行無し → 現在 {after})", "마지막 복구: {at}(그전엔 덮어쓰기 행 없음 → 현재 {after})", "dernière réparation : {at} (aucune ligne de couverture avant → maintenant {after})", "letzte Korrektur: {at} (vorher keine Override-Zeile → jetzt {after})", "ultima correzione: {at} (prima nessuna riga di override → ora {after})", "последнее исправление: {at} (раньше строки переопределения не было → теперь {after})", "última reparación: {at} (antes no había fila de anulación → ahora {after})"),
|
|
94
|
+
cookieLive: t$1("cookie 库实时读数:{count} 条 dsh-auth-*(共 {total} 条),请求头约 {bytes} B / 上限 {max} B({pct}%),距 431 阈值还剩约 {remaining} 条", "live cookie reading: {count} dsh-auth-* rows ({total} total), request header ~{bytes} B of {max} B ({pct}%), roughly {remaining} more rows before 431", "cookie ライブ读数:dsh-auth-* {count} 件(合計 {total} 件)、リクエストヘッダ約 {bytes} B / 上限 {max} B({pct}%)、431 まであと約 {remaining} 件", "cookie 실시간 수치: dsh-auth-* {count}건(총 {total}건), 요청 헤더 약 {bytes}B / 상한 {max}B({pct}%), 431까지 약 {remaining}건 남음", "lecture en direct des cookies : {count} entrées dsh-auth-* ({total} au total), en-tête ~{bytes} B sur {max} B ({pct} %), environ {remaining} entrées avant 431", "Live-Ableseung der Cookies: {count} dsh-auth-* Einträge ({total} gesamt), Header ~{bytes} B von {max} B ({pct} %), noch ~{remaining} Einträge bis 431", "lettura live dei cookie: {count} voci dsh-auth-* ({total} totali), header ~{bytes} B su {max} B ({pct}%), ancora ~{remaining} voci prima di 431", "текущее чтение cookie: {count} записей dsh-auth-* (всего {total}), заголовок ~{bytes} Б из {max} Б ({pct}%), до 431 остаётся ~{remaining} записей", "lectura en vivo de cookies: {count} filas dsh-auth-* ({total} en total), cabecera ~{bytes} B de {max} B ({pct} %), quedan ~{remaining} filas para 431"),
|
|
95
|
+
cookieLiveSnapshot: t$1("cookie 库快照读数(借宿主句柄,非实时):{count} 条 dsh-auth-*(共 {total} 条),请求头约 {bytes} B / 上限 {max} B({pct}%),距 431 阈值还剩约 {remaining} 条", "cookie reading via a borrowed host handle (not live): {count} dsh-auth-* rows ({total} total), request header ~{bytes} B of {max} B ({pct}%), roughly {remaining} more rows before 431", "スナップショット读数(宿主のハンドル借用、非实时):dsh-auth-* {count} 件(合計 {total} 件)、ヘッダ約 {bytes} B / 上限 {max} B({pct}%)、431 まであと約 {remaining} 件", "스냅샷 수치(호스트 핸들 빌림, 비실시간): dsh-auth-* {count}건(총 {total}건), 헤더 약 {bytes}B / 상한 {max}B({pct}%), 431까지 약 {remaining}건", "lecture par instantané (poignée prêtée à l'hôte, non temps réel) : {count} entrées dsh-auth-* ({total} au total), en-tête ~{bytes} B sur {max} B ({pct} %), ~{remaining} entrées avant 431", "Schnappschuss-Ableseung (geliehener Host-Handle, nicht live): {count} dsh-auth-* Einträge ({total} gesamt), Header ~{bytes} B von {max} B ({pct} %), noch ~{remaining} Einträge bis 431", "lettura da istantanea (maniglia host prestata, non live): {count} voci dsh-auth-* ({total} totali), header ~{bytes} B su {max} B ({pct}%), ancora ~{remaining} voci prima di 431", "снимок (одалживаемый дескриптор хоста, не в реальном времени): {count} записей dsh-auth-* (всего {total}), заголовок ~{bytes} Б из {max} Б ({pct}%), до 431 остаётся ~{remaining} записей", "lectura por instantánea (asa del host prestada, no en vivo): {count} filas dsh-auth-* ({total} en total), cabecera ~{bytes} B de {max} B ({pct} %), quedan ~{remaining} filas para 431"),
|
|
96
|
+
cookieMissing: t$1("cookie 库现状:没在预期位置找到库(安装方式可能不同),可用 --db=<完整路径> 指定", "cookie store: no database found at the expected locations (the install may differ); pass --db=<full path>", "cookie 庫:期待する場所に見つかりません(インストール形態の違いかも)。--db=<完全パス> で指定可", "cookie 저장소: 예상 위치에서 파일을 찾지 못함(설치 형태 차이 가능) → --db=<전체 경로> 로 지정", "base de cookies : aucune base aux emplacements attendus (installation différente ?) ; utilisez --db=<chemin complet>", "Cookie-Speicher: keine Datenbank an den erwarteten Orten (ggf. andere Installation) — --db=<vollständiger Pfad> verwenden", "archivio cookie: nessun database nei percorsi attesi (installazione diversa?) ; usare --db=<percorso completo>", "хранилище cookie: база не найдена в ожидаемых местах (возможно, другая установка) — укажите --db=<полный путь>", "almacén de cookies: no se encontró la base en las rutas esperadas (instalación distinta) ; use --db=<ruta completa>"),
|
|
97
|
+
cookiePermission: t$1("cookie 库现状:当前用户读不了这个文件(权限/属主问题),不是客户端占用", "cookie store: the current user cannot read this file (permissions/owner), the client is not holding it", "cookie 庫:現ユーザーはこのファイルを読めません(権限/所有者の問題)で、クライアント占有ではない", "cookie 저장소: 현재 사용자 권한으로 읽을 수 없음(권한/소유자 문제), 클라이언트 점유 아님)", "base de cookies : l'utilisateur actuel ne peut pas lire ce fichier (permissions/propriétaire), ce n'est pas le client qui le retient", "Cookie-Speicher: dieser Benutzer kann die Datei nicht lesen (Rechte/Besitzer), nicht der Client hält sie", "archivio cookie: l'utente corrente non può leggere il file (permessi/proprietario), non lo trattiene il client", "хранилище cookie: текущий пользователь не может прочитать файл (права/владелец), это не блокировка клиентом", "almacén de cookies: el usuario actual no puede leer este archivo (permisos/propietario), no lo retiene el cliente"),
|
|
94
98
|
cookieBusy: t$1("cookie 库现状:客户端运行期读不到(被 Chromium 独占),条数需关闭客户端后跑 CLI", "cookie store: unreadable while the client runs (Chromium holds it exclusively); count needs the CLI with the client closed", "cookie 庫の現状:クライアント起動中は読めません(Chromium が排他保持)、件数は終了後に CLI で", "cookie 저장소: 클라이언트 실행 중 읽기 불가(Chromium 배타 점유), 수는 종료 후 CLI로", "base de cookies : illisible pendant que le client tourne (Chromium la retient) ; le nombre exige la CLI client fermé", "Cookie-Speicher: während des Client-Laufs nicht lesbar (Chromium hält ihn exklusiv); die Zahl braucht die CLI bei geschlossenem Client", "archivio cookie: illeggibile mentre il client è attivo (Chromium lo trattiene); il conteggio richiede la CLI a client chiuso", "хранилище cookie: недоступно для чтения при запущенном клиенте (Chromium держит эксклюзивно); число требует CLI при закрытом клиенте", "almacén de cookies: ilegible mientras el cliente corre (Chromium lo retiene); el conteo requiere la CLI con el cliente cerrado"),
|
|
95
99
|
noop: t$1("无需写入(已在目标档)", "nothing to write (already on target)", "書き込み不要(目標達成済み)", "기록 불필요(이미 목표)", "rien à écrire (déjà à la cible)", "nichts zu schreiben (bereits am Ziel)", "nulla da scrivere (già all'obiettivo)", "нечего писать (уже в цели)", "nada que escribir (ya en el objetivo)"),
|
|
96
100
|
blocked: t$1("判定为不可动作,未写入({codes})", "judged not actionable; nothing written ({codes})", "動作不可と判定、書き込みなし({codes})", "조치 불가로 판정, 기록 없음({codes})", "jugé non exécutable ; rien écrit ({codes})", "als nicht ausführbar eingestuft; nichts geschrieben ({codes})", "giudicato non eseguibile; nulla scritto ({codes})", "признано невыполнимым; ничего не записано ({codes})", "juzgado no accionable; nada escrito ({codes})"),
|
|
@@ -99,14 +103,8 @@ window.__ModuleLoader__.load({
|
|
|
99
103
|
noSnapshot: t$1("没有可回滚的快照(修复一次才会留一份)", "no snapshot to roll back to (one is kept on a successful fix)", "回滚用スナップショット無し(修復時に 1 件保存)", "롤백 스냅샷 없음(성공적 복구 시 1개 보관)", "aucun instantané à restaurer (un fix réussi en garde un)", "kein Snapshot zum Zurückrollen (ein erfolgreicher Fix hinterlässt einen)", "nessuno snapshot da ripristinare (un fix riuscito ne conserva uno)", "нет снимка для отката (успешное исправление сохраняет один)", "no hay instantánea a la que volver (una reparación correcta guarda una)"),
|
|
100
104
|
planFor: t$1("把下面这段手工放进 {file}(若根是 flow `[]`,要先删掉那一行):", "paste this block into {file} (if the root is a flow `[]`, delete that line first):", "以下のブロックを {file} に手動で置いてください(根が flow `[]` ならその行を削除):", "아래 블록을 {file}에 직접 넣으세요(루트가 flow `[]`면 그 줄을 먼저 삭제):", "collez ce bloc dans {file} (si la racine est un `[]` en flux, supprimez d'abord cette ligne) :", "fügen Sie diesen Block in {file} ein (falls die Wurzel ein Fluss-`[]` ist, erst diese Zeile löschen):", "incolla questo blocco in {file} (se la radice è un `[]` in forma flow, prima cancella quella riga):", "вставьте этот блок в {file} (если корень — поток `[]`, сначала удалите эту строку):", "pega este bloque en {file} (si la raíz es un `[]` en flujo, borra primero esa línea):"),
|
|
101
105
|
exprFrozenHint: t$1("要拿到跟随形态的粘贴块:把本插件设置里的 guardMode 切到 expression,再跑一次 patch plan", "to get a paste block in the following form: set guardMode to expression in this plugin's settings, then run patch plan again", "追随形态の貼り付け块が欲しい場合:本プラグイン設定の guardMode を expression に切り、patch plan を再実行", "추종 형태 블록을 받으려면: 이 플러그인 설정에서 guardMode를 expression으로 바꾸고 patch plan을 다시 실행", "pour obtenir un bloc au forme suiveuse : passez guardMode à expression dans les réglages de ce plugin, puis relancez patch plan", "für ein Block in Folgsamkeitsform: guardMode in den Einstellungen dieses Plugins auf expression setzen und patch plan erneut ausführen", "per ottenere un blocco in forma seguace: imposta guardMode su expression nelle impostazioni di questo plugin, poi riesegui patch plan", "чтобы получить блок в следящей форме: переведите guardMode в expression в настройках этого плагина и снова выполните patch plan", "para obtener un bloque en forma de seguimiento: pon guardMode en expression en los ajustes de este plugin y vuelve a ejecutar patch plan"),
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
portRestart: t$1("配置已写但监听仍在旧端口 → 下次启动生效", "config written, the live listener is still on the old port → takes effect at next launch", "設定は書き込みましたがまだ旧ポートで受信しています → 次回起動時に有効", "설정은 기록됐지만 아직 옛 포트에서 수신 중 → 다음 시작 때 적용", "config écrite, l'écoute est encore sur l'ancien port → effet au prochain lancement", "Konfiguration geschrieben, das Lauschen bleibt am alten Port → wirksam beim nächsten Start", "config scritta, l'ascolto resta sulla porta vecchia → effettivo al prossimo avvio", "конфигурация записана, но слушает старый порт → вступит в силу при следующем запуске", "config escrita, pero sigue escuchando el puerto viejo → efectivo en el próximo arranque"),
|
|
105
|
-
portUnknown: t$1("是否热生效无据(探针未能定论),新值会在下次启动生效", "whether it applied live is undetermined (the probe was inconclusive); the new value takes effect at next launch", "ホット反映されたかは判定不能(プローブが結論できず)。新値は次回起動時に有効", "열반영 여부는 판단 불가(프로브가 결론 못 냄), 새 값은 다음 시작 때 적용", "l'effet à chaud est indécidable (sonde non concluante) ; la nouvelle valeur s'applique au prochain lancement", "ob heiß angewendet ist unklar (Sonde nicht eindeutig); der neue Wert gilt beim nächsten Start", "se sia applicata a caldo è indecidibile (sonda inconcludente); il nuovo valore vale al prossimo avvio", "применено ли горячо — не определено (зонд не дал ответа); новое значение вступит в силу при следующем запуске", "si se aplicó en caliente es indecidible (la sonda no fue concluyente); el nuevo valor rige en el próximo arranque"),
|
|
106
|
-
portBusy: t$1("目标端口 {port} 在本机已被占用(探针看到有人监听),未写入——换一个端口再试", "the target port {port} is already occupied on this host (the probe saw a listener), nothing was written — pick another port", "対象ポート {port} はこのマシンで使用中(プローブが受信者を検知)。書き込みません — 別のポートで再試行", "대상 포트 {port}가 이 기기에서 사용 중(프로브가 수신자 감지) → 기록하지 않음, 다른 포트으로 다시 시도", "le port cible {port} est déjà occupé sur cette machine (la sonde a vu un écouteur), rien n'a été écrit — choisissez un autre port", "der Ziel-Port {port} ist auf diesem Rechner belegt (Sonde sah einen Lauscher), nichts geschrieben — anderen Port wählen", "la porta di destinazione {port} è già occupata su questa macchina (la sonda ha visto un ascoltatore), nulla scritto — scegli un'altra porta", "целевой порт {port} на этой машине уже занят (зонд увидел слушателя), ничего не записано — выберите другой порт", "el puerto de destino {port} ya está ocupado en esta máquina (la sonda vio un oyente), no se escribió nada — elija otro puerto"),
|
|
107
|
-
portInvalid: t$1("端口必须是 {minimum}-{maximum} 的整数,收到 {got};本插件不替你定默认端口", "the port must be an integer {minimum}-{maximum}, got {got}; this plugin does not pick a default port for you", "ポートは {minimum}-{maximum} の整数が必要、受信 {got};本プラグインは既定ポートを決めません", "포트는 {minimum}-{maximum} 정수여 함, 입력 {got}; 이 플러그인은 기본 포트를 정하지 않음", "le port doit être un entier {minimum}-{maximum}, reçu {got} ; ce plugin ne choisit pas de port par défaut", "der Port muss eine Ganzzahl {minimum}-{maximum} sein, erhalten {got}; dieses Plugin setzt keinen Standardport für Sie", "la porta deve essere un intero {minimum}-{maximum}, ricevuto {got}; questo plugin non sceglie una porta predefinita", "порт должен быть целым {minimum}-{maximum}, получено {got}; этот плагин не выбирает порт по умолчанию", "el puerto debe ser un entero {minimum}-{maximum}, se recibió {got}; este plugin no elige un puerto predeterminado"),
|
|
108
|
-
portSwitchWarn: t$1("⚠ 端口改完立即生效:旧端口的当前页面会失联,必须马上用新端口地址重新访问(或重启客户端),server 与 browser 的端口号要同步改", "⚠ the port takes effect immediately: this page on the old port will drop, so re-open it at the new port right away (or restart the client) — keep the server and browser ports in sync", "⚠ ポートは即座に有効化:旧ポートの現ページは切断されます。直ちに新ポート地址で開き直すかクライアントを再起動してください(server と browser のポートを揃える)", "⚠ 포트가 즉시 반영됨: 옛 포트의 현재 페이지가 끊깁니다. 새 포트 주소로 즉시 다시 열거나 클라이언트를 재시작하세요(server와 browser 포트 동기화)", "⚠ le port prend effet immédiatement : cette page sur l'ancien port se déconnecte, rouvrez-la tout de suite sur le nouveau port (ou redémarrez le client) — alignez les ports server et browser", "⚠ der Port wirkt sofort: diese Seite am alten Port trennt sich — öffnen Sie sie sogleich über den neuen Port (oder starten Sie den Client neu), server- und Browser-Port müssen übereinstimmen", "⚠ la porta ha effetto immediato: questa pagina sulla porta vecchia si disconnette; riapritela subito al nuovo port (o riavvia il client) — allinea le porte di server e browser", "⚠ порт применяется сразу: эта страница на старом порту отвалится — немедленно откройте по новому порту (или перезапустите клиент); порты server и browser должны совпадать", "⚠ el puerto surte efecto de inmediato: esta página en el puerto viejo se desconecta; ábrala de nuevo en el puerto nuevo (o reinicie el cliente) — alinee los puertos de server y navegador"),
|
|
109
|
-
webserverNote: t$1("webserver 行不被「修复」自动改写:端口属启动行为面,要改请用面板的「应用端口」(只写表达式形式,`--port` 仍优先)", "the webserver row is never auto-written by Fix: the port is a launch-behaviour decision - use the panel's Apply port instead (written as an expression, so `--port` still wins)", "webserver 行は「修復」で自動改写されません:ポートは起動挙動の話、パネルの「ポート適用」を使ってください(表达式形式のみ、`--port` が優先されます)", "webserver 행은 \"복구\"로 자동 기록되지 않음: 포트는 시작 동작 판단이니 패널의 \"포트 적용\"을 쓰세요(표현식 형태만 기록, `--port` 우선)", "la ligne webserver n'est jamais écrite par Réparer : le port relève du lancement, utilisez « Appliquer le port » du panneau (écrit en expression, `--port` gagne toujours)", "die webserver-Zeile wird durch Fixen nie automatisch geschrieben: der Port ist Startverhalten, nutzen Sie „Port anwenden\" im Panel (als Ausdruck geschrieben, `--port` bleibt oben)", "la riga webserver non è mai scritta da Correggi: la porta riguarda l'avvio, usa «Applica porta» nel pannello (scritta come espressione, `--port` continua a vincere)", "строка webserver не пишется кнопкой «Исправить»: порт — вопрос запуска, используйте «Применить порт» в панели (пишется выражением, `--port` по-прежнему важнее)", "la fila webserver nunca la escribe Reparar: el puerto concierne al arranque, usa «Aplicar puerto» en el panel (se escribe como expresión, `--port` sigue ganando)"),
|
|
106
|
+
targetDaysLine: t$1("目标 cookie 绝对寿命:{days} 天(「修复」就写这个值;它是防 431 真正有效的一项)", "target cookie lifetime: {days} day(s) — what Fix writes; this is the part that actually prevents 431", "目標 cookie 絶対寿命:{days} 日(「修復」が書く値。431 防止に本当に効くのはここ)", "목표 cookie 절대 수명: {days}일 — \"복구\"가 쓰는 값이며, 431 방지에 실제로 효력이 있는 항목", "durée cible des cookies : {days} jour(s) — valeur écrite par Réparer ; c'est ce qui empêche vraiment 431", "Ziel-Lebensdauer der Cookies: {days} Tag(e) — der von Fix geschriebene Wert; das ist der Teil, der 431 wirklich verhindert", "durata target dei cookie: {days} giorno/i — il valore scritto da Correggi; è la cosa che evita davvero 431", "целевой срок cookie: {days} дн. — значение, которое пишет «Исправить»; именно это реально предотвращает 431", "vida útil objetivo de las cookies: {days} día(s) — el valor que escribe Reparar; es la parte que de verdad evita 431"),
|
|
107
|
+
webserverNote: t$1("webserver 行只参与只读判定:本插件只改 cookie 有效期,端口属启动行为面,不由本工具改写", "the webserver row is read-only here: this plugin only changes the cookie lifetime - the port is a launch-behaviour decision we do not rewrite", "webserver 行は読み取り専用判定のみ:本プラグインは cookie 有効期だけ変更し、ポートは起動挙動の話で本ツールの対象外", "webserver 행은 읽기 전용 판정만: 이 플러그인은 cookie 유효기간만 변경하며 포트는 시작 동작 판단이라 본 도구가 바꾸지 않음", "la ligne webserver est en lecture seule ici : ce plugin ne change que la durée de vie des cookies - le port relève du lancement, nous ne le réécrivons pas", "die webserver-Zeile wird hier nur lesend geprüft: dieses Plugin ändert nur die Cookie-Lebensdauer — der Port ist Startverhalten, das wir nicht umschreiben", "la riga webserver qui è solo in lettura: questo plugin cambia soltanto la durata dei cookie - la porta riguarda l'avvio e non la riscriviamo", "строка webserver здесь только для чтения: этот плагин меняет лишь срок cookie — порт относится к запуску и нами не переписывается", "la fila webserver aquí es solo lectura: este plugin solo cambia la vida útil de las cookies - el puerto concierne al arranque y no lo reescribimos"),
|
|
110
108
|
nextFix: t$1("下一步:面板点「修复」,或执行 /cookie-cleaner patch fix", "next: press Fix in the panel, or run /cookie-cleaner patch fix", "次の一手:パネルの「修復」を押すか /cookie-cleaner patch fix を実行", "다음: 패널에서 \"복구\"를 누르거나 /cookie-cleaner patch fix 실행", "étape suivante : « Réparer » dans le panneau, ou /cookie-cleaner patch fix", "nächster Schritt: im Panel „Fixen“, oder /cookie-cleaner patch fix", "passo successivo: «Correggi» nel pannello, oppure /cookie-cleaner patch fix", "следующий шаг: «Исправить» в панели или /cookie-cleaner patch fix", "siguiente paso: «Reparar» en el panel, o /cookie-cleaner patch fix"),
|
|
111
109
|
noService: t$1("本机宿主没有 config-editor 服务(老线或未装配),体检无法在线进行", "this host has no config-editor service (older line or not assembled), so an online check is impossible", "この宿主に config-editor サービスが無いため(旧ライン/未装配)、オンライン検査は不可", "이 호스트에 config-editor 서비스가 없음(구 라인/미조립) → 온라인 점검 불가", "cet hôte n'a pas de service config-editor (ancienne ligne ou non assemblé), contrôle en ligne impossible", "dieser Host hat keinen config-editor-Dienst (ältere Zeile oder nicht montiert), Online-Prüfung unmöglich", "questo host non ha il servizio config-editor (linea vecchia o non assemblato), controllo online impossibile", "у этого хоста нет сервиса config-editor (старая линия или не собран), онлайн-проверка невозможна", "este host no tiene el servicio config-editor (línea antigua o no ensamblado), control en línea imposible"),
|
|
112
110
|
missingProfile: t$1("该 profile 不存在(目录里没有 cordis.patch.yml 且上级目录也不在)——无据可判,不是配置有问题", "that profile does not exist (no cordis.patch.yml and its parent directory is missing) — nothing to judge, not a config defect", "その profile は存在しません(cordis.patch.yml 無く、親ディレクトリも無い)——判定根拠無し、設定不備ではない", "해당 프로필이 존재하지 않습니다(cordis.patch.yml 없음, 상위 디렉터리도 없음) — 판단 근거 없음, 설정 결함이 아님", "ce profil n'existe pas (pas de cordis.patch.yml et le dossier parent manque) — rien à juger, pas un défaut de config", "dieses Profil existiert nicht (kein cordis.patch.yml, auch das Elternverzeichnis fehlt) — keine Grundlage, kein Konfigurationsfehler", "quel profilo non esiste (nessun cordis.patch.yml e manca la cartella superiore) — nulla da giudicare, non un difetto di config", "этот профиль не существует (нет cordis.patch.yml и отсутствует родительский каталог) — нечего судить, это не дефект конфигурации", "ese perfil no existe (no hay cordis.patch.yml y falta el directorio padre) — nada que juzgar, no es un defecto de configuración"),
|
|
@@ -145,10 +143,6 @@ window.__ModuleLoader__.load({
|
|
|
145
143
|
"action.check": t("体检", "Check", "点検", "점검", "Contrôler", "Prüfen", "Controlla", "Проверить", "Revisar"),
|
|
146
144
|
"action.fix": t("修复", "Fix", "修復", "복구", "Réparer", "Korrigieren", "Correggi", "Исправить", "Reparar"),
|
|
147
145
|
"action.revert": t("回滚", "Revert", "戻す", "되돌리기", "Annuler", "Rückgängig", "Ripristina", "Отменить", "Revertir"),
|
|
148
|
-
"action.port": t("应用端口", "Apply port", "ポート適用", "포트 적용", "Appliquer le port", "Port anwenden", "Applica porta", "Применить порт", "Aplicar puerto"),
|
|
149
|
-
"port.input": t("目标端口", "target port", "対象ポート", "대상 포트", "port cible", "Ziel-Port", "porta di destinazione", "целевой порт", "puerto de destino"),
|
|
150
|
-
"port.help": t("留空则不改;填一个 1-65535 的端口后点「应用端口」,只改 webserver 行的 port 表达式(`--port` 仍优先)", "leave empty to change nothing; type a port 1-65535 and press Apply port - only the webserver row's port expression is rewritten (`--port` still wins)", "空なら変更なし。1-65535 のポートを入れて「ポート適用」を押すと webserver 行の port 式のみ書き換わります(`--port` 優先)", "비워두면 변경 없음. 1-65535 포트를 넣고 \"포트 적용\"을 누르면 webserver 행의 port 표현식만 다시 씁니다(`--port` 우선)", "laissez vide pour ne rien changer ; saisissez un port 1-65535 puis « Appliquer le port » - seule l'expression du port de la ligne webserver est réécrite (`--port` gagne)", "leer lassen ändert nichts; Port 1-65535 eingeben und „Port anwenden“ - nur der port-Ausdruck der webserver-Zeile wird umgeschrieben (`--port` bleibt oben)", "lasciare vuoto per non cambiare nulla; inserire una porta 1-65535 e premere Applica porta - viene riscritta solo l'espressione port della riga webserver (`--port` vince)", "оставьте пустым чтобы не менять; введите порт 1-65535 и нажмите Применить порт — переписывается только выражение port строки webserver (`--port` важнее)", "deje vacío para no cambiar nada; escriba un puerto 1-65535 y pulse Aplicar puerto: solo se reescribe la expresión port de la fila webserver (`--port` gana)"),
|
|
151
|
-
"port.audit": t("上次端口:{at}({before} → 现在 {port})", "last port: {at} ({before} → now {port})", "前回のポート:{at}({before} → 現在 {port})", "마지막 포트: {at}({before} → 현재 {port})", "dernier port : {at} ({before} → maintenant {port})", "letzter Port: {at} ({before} → jetzt {port})", "ultima porta: {at} ({before} → ora {port})", "последний порт: {at} ({before} → теперь {port})", "último puerto: {at} ({before} → ahora {port})"),
|
|
152
146
|
"state.busy": t("进行中…", "working…", "処理中…", "처리 중…", "en cours…", "läuft…", "in corso…", "выполняется…", "en curso…"),
|
|
153
147
|
"state.failed": t("动作失败:{message}", "action failed: {message}", "アクション失敗:{message}", "동작 실패: {message}", "échec de l'action : {message}", "Aktion fehlgeschlagen: {message}", "azione fallita: {message}", "действие не удалось: {message}", "acción falló: {message}"),
|
|
154
148
|
"state.offline": t("宿主未提供 config-editor(老线或未装配),本面板无法在线体检/修复", "the host exposes no config-editor (older line or not assembled); this panel cannot check or fix online", "宿主に config-editor が無く(旧ライン/未装配)、本パネルではオンライン点検・修復不可", "호스트에 config-editor가 없음(구 라인/미조립) → 이 패널에서 온라인 점검·복구 불가", "l'hôte n'expose pas de config-editor (ancienne ligne ou non assemblé) ; ce panneau ne peut ni contrôler ni réparer", "der Host stellt keinen config-editor bereit (ältere Zeile oder nicht montiert); dieses Panel kann nicht online prüfen oder korrigieren", "l'host non espone config-editor (linea vecchia o non assemblato); questo pannello non può controllare né correggere online", "хост не даёт config-editor (старая линия или не собран); эта панель не может проверять или исправлять онлайн", "el host no expone config-editor (línea antigua o no ensamblado); este panel no puede revisar ni reparar en línea"),
|
|
@@ -193,7 +187,6 @@ window.__ModuleLoader__.load({
|
|
|
193
187
|
const routes = {
|
|
194
188
|
check: "/api/dsh-cookie-cleaner/patch/check",
|
|
195
189
|
fix: "/api/dsh-cookie-cleaner/patch/fix",
|
|
196
|
-
port: "/api/dsh-cookie-cleaner/patch/port",
|
|
197
190
|
revert: "/api/dsh-cookie-cleaner/patch/revert"
|
|
198
191
|
};
|
|
199
192
|
/** POST 一跳;网络/解析失败都归成结构化错误,不让卡片白屏。 */
|
|
@@ -266,11 +259,52 @@ window.__ModuleLoader__.load({
|
|
|
266
259
|
}, `${finding.code}-${String(index)}`))]
|
|
267
260
|
});
|
|
268
261
|
}
|
|
262
|
+
/**
|
|
263
|
+
* cookie 读数行。四档不得混用一句:
|
|
264
|
+
* - 普通只读打开成功 → 实时值(条数 / 百分比 / 余量),过半转告警色、达阈值转危险色;
|
|
265
|
+
* - 借宿主句柄拿的快照 → 同一组数字但明说「非实时」(说成实时就是谎报);
|
|
266
|
+
* - 读得到但无折算(旧宿主半)→ 只给条数,不编造百分比;
|
|
267
|
+
* - 读不到 → 按原因分档:占用 / 权限 / 没找到。把后两者说成“被 Chromium 占”是误引导。
|
|
268
|
+
*/
|
|
269
|
+
function CookieLine({ cookie, t }) {
|
|
270
|
+
if (cookie === void 0) return null;
|
|
271
|
+
const muted = {
|
|
272
|
+
fontSize: "0.85em",
|
|
273
|
+
color: "var(--dsw-color-muted)"
|
|
274
|
+
};
|
|
275
|
+
if (cookie.verdict === "skipped" || cookie.reason === "busy" || cookie.reason === "permission" || cookie.reason === "missing") {
|
|
276
|
+
const key = cookie.reason === "missing" ? "x.cookieMissing" : cookie.reason === "permission" ? "x.cookiePermission" : "x.cookieBusy";
|
|
277
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
278
|
+
style: muted,
|
|
279
|
+
children: t(key)
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
const occupancy = cookie.header;
|
|
283
|
+
if (occupancy === void 0) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
284
|
+
style: muted,
|
|
285
|
+
children: `${String(cookie.authCookies ?? "?")} dsh-auth-* / ${String(cookie.totalCookies ?? "?")} total`
|
|
286
|
+
});
|
|
287
|
+
const color = occupancy.over || occupancy.remaining <= 0 ? "var(--dsw-color-danger)" : occupancy.pct >= 50 ? "var(--dsw-color-warning)" : "var(--dsw-color-muted)";
|
|
288
|
+
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
289
|
+
style: {
|
|
290
|
+
fontSize: "0.85em",
|
|
291
|
+
color,
|
|
292
|
+
lineHeight: 1.5
|
|
293
|
+
},
|
|
294
|
+
children: render(t(cookie.snapshot === true ? "x.cookieLiveSnapshot" : "x.cookieLive"), {
|
|
295
|
+
count: String(cookie.authCookies ?? "?"),
|
|
296
|
+
total: String(cookie.totalCookies ?? "?"),
|
|
297
|
+
bytes: String(occupancy.bytes),
|
|
298
|
+
max: String(occupancy.maxHeaderBytes),
|
|
299
|
+
pct: String(occupancy.pct),
|
|
300
|
+
remaining: String(occupancy.remaining)
|
|
301
|
+
})
|
|
302
|
+
});
|
|
303
|
+
}
|
|
269
304
|
function PatchCard({ t }) {
|
|
270
305
|
const [state, setState] = react.useState(void 0);
|
|
271
306
|
const [busy, setBusy] = react.useState("");
|
|
272
307
|
const [note, setNote] = react.useState("");
|
|
273
|
-
const [portInput, setPortInput] = react.useState("");
|
|
274
308
|
const mounted = react.useRef(true);
|
|
275
309
|
react.useEffect(() => {
|
|
276
310
|
mounted.current = true;
|
|
@@ -286,17 +320,6 @@ window.__ModuleLoader__.load({
|
|
|
286
320
|
if (action === "check") {
|
|
287
321
|
const value = await postJson(routes.check, {});
|
|
288
322
|
if (mounted.current) setState(value);
|
|
289
|
-
} else if (action === "port") {
|
|
290
|
-
const value = await postJson(routes.port, { port: Number(portInput) });
|
|
291
|
-
const fail = (message) => render(t("state.failed"), { message });
|
|
292
|
-
const outcome = value.kind === "port-applied" ? `${render(t("x.portApplied"), {
|
|
293
|
-
port: String(value.port ?? portInput),
|
|
294
|
-
expr: value.expr ?? ""
|
|
295
|
-
})}\n` + t(value.hotApplied === true ? "x.portHot" : value.hotApplied === false ? "x.portRestart" : "x.portUnknown") + `\n${t("x.portSwitchWarn")}` : value.kind === "port-busy" ? render(t("x.portBusy"), { port: String(value.port ?? portInput) }) : value.kind === "invalid-port" ? t("x.portInvalid") : value.kind === "noop" ? t("fix.noop") : value.kind === "blocked" ? render(t("fix.blocked"), { codes: value.codes ?? [] }) : fail(value.message ?? value.kind);
|
|
296
|
-
if (!mounted.current) return;
|
|
297
|
-
setNote(outcome);
|
|
298
|
-
const after = value.result ?? await postJson(routes.check, {});
|
|
299
|
-
if (mounted.current) setState(after);
|
|
300
323
|
} else {
|
|
301
324
|
const value = await postJson(action === "fix" ? routes.fix : routes.revert, {});
|
|
302
325
|
const fail = (message) => render(t("state.failed"), { message });
|
|
@@ -314,12 +337,8 @@ window.__ModuleLoader__.load({
|
|
|
314
337
|
}
|
|
315
338
|
const offline = state?.reason === "no-config-editor";
|
|
316
339
|
const conn = state?.rows?.find((row) => row.rowId === "connection");
|
|
317
|
-
const web = state?.rows?.find((row) => row.rowId === "webserver");
|
|
318
340
|
const canFix = offline !== true && conn?.actionable === true;
|
|
319
341
|
const canRevert = offline !== true;
|
|
320
|
-
const portNumber = Number(portInput);
|
|
321
|
-
const portValid = /^\d+$/.test(portInput.trim()) && Number.isInteger(portNumber) && portNumber >= 1 && portNumber <= 65535;
|
|
322
|
-
const canPort = offline !== true && portValid && web?.blocked !== true;
|
|
323
342
|
const button = (action, disabled = false) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
324
343
|
type: "button",
|
|
325
344
|
disabled: busy !== "" || disabled,
|
|
@@ -332,7 +351,7 @@ window.__ModuleLoader__.load({
|
|
|
332
351
|
color: "var(--dsw-color-text)",
|
|
333
352
|
cursor: busy === "" && !disabled ? "pointer" : "default"
|
|
334
353
|
},
|
|
335
|
-
children: busy === action ? t("state.busy") : t(
|
|
354
|
+
children: busy === action ? t("state.busy") : t(`action.${action}`)
|
|
336
355
|
});
|
|
337
356
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
338
357
|
style: {
|
|
@@ -387,59 +406,16 @@ window.__ModuleLoader__.load({
|
|
|
387
406
|
},
|
|
388
407
|
children: t("note.webserver")
|
|
389
408
|
}) : null,
|
|
390
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
391
|
-
style: {
|
|
392
|
-
display: "flex",
|
|
393
|
-
gap: 6,
|
|
394
|
-
alignItems: "center",
|
|
395
|
-
flexWrap: "wrap",
|
|
396
|
-
marginTop: 4
|
|
397
|
-
},
|
|
398
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
399
|
-
type: "text",
|
|
400
|
-
inputMode: "numeric",
|
|
401
|
-
placeholder: t("port.input"),
|
|
402
|
-
"aria-label": t("port.input"),
|
|
403
|
-
value: portInput,
|
|
404
|
-
onChange: (event) => setPortInput(event.target.value),
|
|
405
|
-
style: {
|
|
406
|
-
width: 110,
|
|
407
|
-
padding: "5px 9px",
|
|
408
|
-
borderRadius: 6,
|
|
409
|
-
border: "1px solid var(--dsw-color-border)",
|
|
410
|
-
background: "var(--dsw-color-bg, var(--dsw-color-surface))",
|
|
411
|
-
color: "var(--dsw-color-text)",
|
|
412
|
-
fontFamily: "var(--dsw-font-mono, monospace)"
|
|
413
|
-
}
|
|
414
|
-
}), button("port", !canPort)]
|
|
415
|
-
}),
|
|
416
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
409
|
+
state?.targetDays !== void 0 ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
417
410
|
style: {
|
|
418
|
-
fontSize: "0.
|
|
419
|
-
color: "var(--dsw-color-
|
|
420
|
-
},
|
|
421
|
-
children: t("port.help")
|
|
422
|
-
}),
|
|
423
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
424
|
-
style: {
|
|
425
|
-
fontSize: "0.85em",
|
|
426
|
-
color: "var(--dsw-color-warning, var(--dsw-color-muted))",
|
|
427
|
-
lineHeight: 1.5
|
|
428
|
-
},
|
|
429
|
-
children: t("x.portSwitchWarn")
|
|
430
|
-
}),
|
|
431
|
-
state?.cookie && state.cookie.verdict !== "skipped" && state.cookie.reason !== "busy" && state.cookie.reason !== "permission" ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
432
|
-
style: {
|
|
433
|
-
fontSize: "0.85em",
|
|
434
|
-
color: "var(--dsw-color-muted)"
|
|
411
|
+
fontSize: "0.9em",
|
|
412
|
+
color: "var(--dsw-color-text)"
|
|
435
413
|
},
|
|
436
|
-
children:
|
|
437
|
-
}) :
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
},
|
|
442
|
-
children: t("x.cookieBusy")
|
|
414
|
+
children: render(t("x.targetDaysLine"), { days: String(state.targetDays) })
|
|
415
|
+
}) : null,
|
|
416
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(CookieLine, {
|
|
417
|
+
cookie: state?.cookie,
|
|
418
|
+
t
|
|
443
419
|
}),
|
|
444
420
|
state?.lastFix ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
445
421
|
style: {
|
|
@@ -455,17 +431,6 @@ window.__ModuleLoader__.load({
|
|
|
455
431
|
after: state.lastFix.targetDays ?? "?"
|
|
456
432
|
})
|
|
457
433
|
}) : null,
|
|
458
|
-
state?.lastPort ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
459
|
-
style: {
|
|
460
|
-
fontSize: "0.85em",
|
|
461
|
-
color: "var(--dsw-color-muted)"
|
|
462
|
-
},
|
|
463
|
-
children: render(t("port.audit"), {
|
|
464
|
-
at: state.lastPort.at ?? "?",
|
|
465
|
-
before: String(state.lastPort.before ?? "?"),
|
|
466
|
-
port: String(state.lastPort.port ?? "?")
|
|
467
|
-
})
|
|
468
|
-
}) : null,
|
|
469
434
|
state?.checkedAt ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
470
435
|
style: {
|
|
471
436
|
fontSize: "0.85em",
|