diff --git a/config.go b/config.go index 4a9eafa2..ce7d14cc 100644 --- a/config.go +++ b/config.go @@ -291,6 +291,9 @@ func LoadConfig() { loadedConfig.KeyboardLayout = "en-US" } + // Until rolling logs land, do not persist verbose levels across reboots. + loadedConfig.DefaultLogLevel = "WARN" + // Migrate old default EDID (Toshiba TSB, no CEA extension) to new JetKVM v1 EDID const oldDefaultEDID = "00ffffffffffff0052620188008888881c150103800000780a0dc9a05747982712484c00000001010101010101010101010101010101023a801871382d40582c4500c48e2100001e011d007251d01e206e285500c48e2100001e000000fc00543734392d6648443732300a20000000fd00147801ff1d000a202020202020017b" if loadedConfig.EdidString == "" || loadedConfig.EdidString == oldDefaultEDID { diff --git a/ui/e2e/log-level.spec.ts b/ui/e2e/log-level.spec.ts index 8eb050f2..65dc1758 100644 --- a/ui/e2e/log-level.spec.ts +++ b/ui/e2e/log-level.spec.ts @@ -5,6 +5,8 @@ import { waitForWebRTCReady, dismissSessionTakeoverDialog, callJsonRpc, + reconnectAfterReboot, + rebootDeviceViaSSH, sshExec, } from "./helpers"; @@ -82,4 +84,38 @@ test.describe("Log level filtering", () => { await callJsonRpc(page, "setDefaultLogLevel", { level: originalLevel }).catch(() => {}); } }); + + test("reverts INFO to WARN after reboot", async ({ page }) => { + test.setTimeout(90_000); + + await page.goto("/"); + await page.waitForLoadState("networkidle"); + await ensureLocalAuthMode(page, { mode: "noPassword" }); + await dismissSessionTakeoverDialog(page); + await waitForWebRTCReady(page); + + const originalLevel = (await callJsonRpc(page, "getDefaultLogLevel")) as LogLevel; + + try { + await callJsonRpc(page, "setDefaultLogLevel", { level: "INFO" }); + await expect + .poll(() => callJsonRpc(page, "getDefaultLogLevel"), { + message: "Waiting for default log level to be INFO after setDefaultLogLevel", + intervals: [200, 500, 1000], + }) + .toBe("INFO"); + + await rebootDeviceViaSSH(); + await reconnectAfterReboot(page, 3000, 20); + + await expect + .poll(() => callJsonRpc(page, "getDefaultLogLevel"), { + message: "Waiting for default log level to revert to WARN after reboot", + intervals: [200, 500, 1000], + }) + .toBe("WARN"); + } finally { + await callJsonRpc(page, "setDefaultLogLevel", { level: originalLevel }).catch(() => {}); + } + }); }); diff --git a/ui/localization/messages/cy.json b/ui/localization/messages/cy.json index df7f93b1..60608f84 100644 --- a/ui/localization/messages/cy.json +++ b/ui/localization/messages/cy.json @@ -113,7 +113,7 @@ "advanced_success_loopback_enabled": "Modd loopback yn unig wedi'i alluogi. Ailgychwynnwch eich dyfais i'w gymhwyso.", "advanced_success_update_ssh_key": "Allwedd SSH wedi'i diweddaru'n llwyddiannus", "advanced_title": "Uwch", - "advanced_troubleshooting_log_level_description": "Addaswch fanylion log ar gyfer diagnosteg. Gall lefelau uwch effeithio ar berfformiad", + "advanced_troubleshooting_log_level_description": "Addaswch fanylder log ar gyfer diagnosteg. Bydd yn ailosod i Rhybudd ar ôl ailgychwyn", "advanced_troubleshooting_log_level_title": "Lefel log", "advanced_troubleshooting_mode_description": "Offer diagnostig a rheolaethau ychwanegol ar gyfer datrys problemau a dibenion datblygu", "advanced_troubleshooting_mode_title": "Modd Datrys Problemau", diff --git a/ui/localization/messages/da.json b/ui/localization/messages/da.json index 5c472cb8..53734301 100644 --- a/ui/localization/messages/da.json +++ b/ui/localization/messages/da.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Konfigurationen er nulstillet til standard", "advanced_success_update_ssh_key": "SSH-nøglen er blevet opdateret", "advanced_title": "Avanceret", - "advanced_troubleshooting_log_level_description": "Juster logdetaljer til fejlsøgning. Højere niveauer kan påvirke ydeevnen", + "advanced_troubleshooting_log_level_description": "Juster logdetaljer til fejlsøgning. Nulstilles til Advarsel ved genstart", "advanced_troubleshooting_log_level_title": "Logniveau", "advanced_troubleshooting_mode_description": "Diagnostiske værktøjer og yderligere kontroller til fejlfinding og udviklingsformål", "advanced_troubleshooting_mode_title": "Fejlfindingstilstand", diff --git a/ui/localization/messages/de.json b/ui/localization/messages/de.json index 386f149c..8c69023a 100644 --- a/ui/localization/messages/de.json +++ b/ui/localization/messages/de.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Konfiguration erfolgreich auf Standard zurückgesetzt", "advanced_success_update_ssh_key": "SSH-Schlüssel erfolgreich aktualisiert", "advanced_title": "Erweitert", - "advanced_troubleshooting_log_level_description": "Protokolldetails für die Diagnose anpassen. Höhere Stufen können die Leistung beeinträchtigen", + "advanced_troubleshooting_log_level_description": "Protokolldetail für Diagnosen anpassen. Wird beim Neustart auf Warnung zurückgesetzt", "advanced_troubleshooting_log_level_title": "Protokollebene", "advanced_troubleshooting_mode_description": "Diagnosetools und zusätzliche Steuerelemente für Fehlerbehebungs- und Entwicklungszwecke", "advanced_troubleshooting_mode_title": "Fehlerbehebungsmodus", diff --git a/ui/localization/messages/en.json b/ui/localization/messages/en.json index 5088c245..219bbd3c 100644 --- a/ui/localization/messages/en.json +++ b/ui/localization/messages/en.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Configuration reset to default successfully", "advanced_success_update_ssh_key": "SSH key updated successfully", "advanced_title": "Advanced", - "advanced_troubleshooting_log_level_description": "Adjust log detail for diagnostics. Higher levels may impact performance", + "advanced_troubleshooting_log_level_description": "Adjust log detail for diagnostics. Reverts to Warning after reboot", "advanced_troubleshooting_log_level_title": "Log Level", "advanced_troubleshooting_mode_description": "Diagnostic tools and additional controls for troubleshooting and development purposes", "advanced_troubleshooting_mode_title": "Troubleshooting Mode", diff --git a/ui/localization/messages/es.json b/ui/localization/messages/es.json index ae43a5a9..01bbbff1 100644 --- a/ui/localization/messages/es.json +++ b/ui/localization/messages/es.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "La configuración se restableció a los valores predeterminados correctamente", "advanced_success_update_ssh_key": "Clave SSH actualizada exitosamente", "advanced_title": "Avanzado", - "advanced_troubleshooting_log_level_description": "Ajuste el detalle del registro para diagnósticos. Los niveles altos pueden afectar el rendimiento", + "advanced_troubleshooting_log_level_description": "Ajuste el nivel de detalle del registro para diagnósticos. Vuelve a Advertencia al reiniciar", "advanced_troubleshooting_log_level_title": "Nivel de registro", "advanced_troubleshooting_mode_description": "Herramientas de diagnóstico y controles adicionales para resolución de problemas y fines de desarrollo", "advanced_troubleshooting_mode_title": "Modo de solución de problemas", diff --git a/ui/localization/messages/fr.json b/ui/localization/messages/fr.json index d06827fe..58f9bdbc 100644 --- a/ui/localization/messages/fr.json +++ b/ui/localization/messages/fr.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "La configuration par défaut a été réinitialisée avec succès", "advanced_success_update_ssh_key": "Clé SSH mise à jour avec succès", "advanced_title": "Avancé", - "advanced_troubleshooting_log_level_description": "Ajustez le détail des journaux pour le diagnostic. Les niveaux élevés peuvent affecter les performances", + "advanced_troubleshooting_log_level_description": "Ajustez le niveau de détail des journaux pour le diagnostic. Revient à Avertissement au redémarrage", "advanced_troubleshooting_log_level_title": "Niveau de journalisation", "advanced_troubleshooting_mode_description": "Outils de diagnostic et contrôles supplémentaires à des fins de dépannage et de développement", "advanced_troubleshooting_mode_title": "Mode de dépannage", diff --git a/ui/localization/messages/it.json b/ui/localization/messages/it.json index f5c0e4e6..9cd3363e 100644 --- a/ui/localization/messages/it.json +++ b/ui/localization/messages/it.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Configurazione ripristinata ai valori predefiniti con successo", "advanced_success_update_ssh_key": "Chiave SSH aggiornata correttamente", "advanced_title": "Avanzato", - "advanced_troubleshooting_log_level_description": "Regola il dettaglio dei log per la diagnostica. Livelli più alti possono influire sulle prestazioni", + "advanced_troubleshooting_log_level_description": "Regola il livello di dettaglio dei log per la diagnostica. Torna su Avviso al riavvio", "advanced_troubleshooting_log_level_title": "Livello di log", "advanced_troubleshooting_mode_description": "Strumenti diagnostici e controlli aggiuntivi per la risoluzione dei problemi e lo sviluppo", "advanced_troubleshooting_mode_title": "Modalità di risoluzione dei problemi", diff --git a/ui/localization/messages/ja.json b/ui/localization/messages/ja.json index cda5f9c9..3bd4f3b2 100644 --- a/ui/localization/messages/ja.json +++ b/ui/localization/messages/ja.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "設定が正常にデフォルトにリセットされました", "advanced_success_update_ssh_key": "SSHキーが正常に更新されました", "advanced_title": "詳細設定", - "advanced_troubleshooting_log_level_description": "診断用にログの詳細度を調整します。レベルが高いほどパフォーマンスに影響する場合があります", + "advanced_troubleshooting_log_level_description": "診断用にログの詳細度を調整します。再起動すると「警告」に戻ります", "advanced_troubleshooting_log_level_title": "ログレベル", "advanced_troubleshooting_mode_description": "トラブルシューティングおよび開発目的の診断ツールと追加コントロール", "advanced_troubleshooting_mode_title": "トラブルシューティングモード", diff --git a/ui/localization/messages/nb.json b/ui/localization/messages/nb.json index 54188150..f08ced34 100644 --- a/ui/localization/messages/nb.json +++ b/ui/localization/messages/nb.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Konfigurasjonen ble tilbakestilt til standard", "advanced_success_update_ssh_key": "SSH-nøkkelen er oppdatert", "advanced_title": "Avansert", - "advanced_troubleshooting_log_level_description": "Juster loggdetaljer for feilsøking. Høyere nivåer kan påvirke ytelsen", + "advanced_troubleshooting_log_level_description": "Juster loggdetaljer for feilsøking. Tilbakestilles til Advarsel ved omstart", "advanced_troubleshooting_log_level_title": "Loggnivå", "advanced_troubleshooting_mode_description": "Diagnostiske verktøy og tilleggskontroller for feilsøking og utviklingsformål", "advanced_troubleshooting_mode_title": "Feilsøkingsverktøy", diff --git a/ui/localization/messages/pt.json b/ui/localization/messages/pt.json index 161647af..33da87a0 100644 --- a/ui/localization/messages/pt.json +++ b/ui/localization/messages/pt.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Configuração redefinida para o padrão com sucesso", "advanced_success_update_ssh_key": "Chave SSH atualizada com sucesso", "advanced_title": "Avançado", - "advanced_troubleshooting_log_level_description": "Ajuste o detalhe dos registos para diagnóstico. Níveis mais elevados podem afetar o desempenho", + "advanced_troubleshooting_log_level_description": "Ajuste o detalhe dos registos para diagnóstico. Repõe Aviso ao reiniciar", "advanced_troubleshooting_log_level_title": "Nível de registo", "advanced_troubleshooting_mode_description": "Ferramentas de diagnóstico e controles adicionais para solução de problemas e fins de desenvolvimento", "advanced_troubleshooting_mode_title": "Modo de Solução de Problemas", diff --git a/ui/localization/messages/ru.json b/ui/localization/messages/ru.json index 017b90fb..4582ce6c 100644 --- a/ui/localization/messages/ru.json +++ b/ui/localization/messages/ru.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Конфигурация успешно сброшена по умолчанию", "advanced_success_update_ssh_key": "SSH-ключ успешно обновлён", "advanced_title": "Дополнительно", - "advanced_troubleshooting_log_level_description": "Настройте детализацию журналов для диагностики. Высокие уровни могут повлиять на производительность", + "advanced_troubleshooting_log_level_description": "Настройте детализацию логов для диагностики. После перезагрузки сбрасывается на «Предупреждение»", "advanced_troubleshooting_log_level_title": "Уровень журналирования", "advanced_troubleshooting_mode_description": "Диагностические инструменты и дополнительные элементы управления для устранения неполадок и разработки", "advanced_troubleshooting_mode_title": "Режим устранения неполадок", diff --git a/ui/localization/messages/sv.json b/ui/localization/messages/sv.json index 4cf3597d..ddd9d3db 100644 --- a/ui/localization/messages/sv.json +++ b/ui/localization/messages/sv.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "Konfigurationen återställdes till standardinställningarna", "advanced_success_update_ssh_key": "SSH-nyckeln har uppdaterats", "advanced_title": "Avancerat", - "advanced_troubleshooting_log_level_description": "Justera loggdetaljer för felsökning. Högre nivåer kan påverka prestandan", + "advanced_troubleshooting_log_level_description": "Justera loggnivån för felsökning. Återställs till Varning vid omstart", "advanced_troubleshooting_log_level_title": "Loggnivå", "advanced_troubleshooting_mode_description": "Diagnostikverktyg och ytterligare kontroller för felsökning och utvecklingsändamål", "advanced_troubleshooting_mode_title": "Felsökningsläge", diff --git a/ui/localization/messages/zh-tw.json b/ui/localization/messages/zh-tw.json index 94baa932..c16e6c72 100644 --- a/ui/localization/messages/zh-tw.json +++ b/ui/localization/messages/zh-tw.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "設定已成功重設為預設值", "advanced_success_update_ssh_key": "SSH 金鑰更新成功", "advanced_title": "進階", - "advanced_troubleshooting_log_level_description": "調整日誌詳細程度以便診斷。較高級別可能影響效能", + "advanced_troubleshooting_log_level_description": "調整日誌詳細程度以便診斷。重新啟動後會重設為「警告」", "advanced_troubleshooting_log_level_title": "日誌級別", "advanced_troubleshooting_mode_description": "用於故障排除和開發目的的診斷工具及額外控制項", "advanced_troubleshooting_mode_title": "故障排除模式", diff --git a/ui/localization/messages/zh.json b/ui/localization/messages/zh.json index 703ffefe..1095a795 100644 --- a/ui/localization/messages/zh.json +++ b/ui/localization/messages/zh.json @@ -118,7 +118,7 @@ "advanced_success_reset_config": "配置已成功恢复为默认设置。", "advanced_success_update_ssh_key": "SSH 密钥更新成功。", "advanced_title": "高级设置", - "advanced_troubleshooting_log_level_description": "调整日志详细程度以便诊断。较高级别可能影响性能", + "advanced_troubleshooting_log_level_description": "调整日志详细程度以便诊断。重启后重置为“警告”", "advanced_troubleshooting_log_level_title": "日志级别", "advanced_troubleshooting_mode_description": "用于故障排查和开发的诊断工具及额外控制选项。", "advanced_troubleshooting_mode_title": "故障排查模式", diff --git a/ui/package.json b/ui/package.json index 174dfe07..b2b8506e 100644 --- a/ui/package.json +++ b/ui/package.json @@ -92,7 +92,7 @@ }, "lint-staged": { "*.{ts,tsx}": "oxlint --fix --deny-warnings", - "*.{ts,tsx,js,jsx,json,css,md}": "oxfmt", + "*.{ts,tsx,js,jsx,css,md}": "oxfmt", "localization/messages/*.json": "npm run i18n:resort" }, "engines": { diff --git a/ui/tools/resort_messages.py b/ui/tools/resort_messages.py index 627bfc1c..9d573cb6 100644 --- a/ui/tools/resort_messages.py +++ b/ui/tools/resort_messages.py @@ -7,20 +7,32 @@ def main(): p = argparse.ArgumentParser( description="Sort translations keys in message *.json files" ) + p.add_argument( + "files", nargs="*", help="specific message JSON files to sort" + ) p.add_argument( "--path", default="./localization/messages/", help="path to messages *.json" ) args = p.parse_args() - messages_path = Path(args.path) - if not messages_path.is_dir(): - print(f"message path is not a directory: {messages_path}") - raise SystemExit(2) + if args.files: + files = [Path(file) for file in args.files] + missing = [file for file in files if not file.is_file()] + if missing: + print("message file(s) not found:") + for file in missing: + print(f" - {file}") + raise SystemExit(2) + else: + messages_path = Path(args.path) + if not messages_path.is_dir(): + print(f"message path is not a directory: {messages_path}") + raise SystemExit(2) - files = list(messages_path.glob("*.json")) - if len(files) == 0: - print(f"no message files (*.json) found in: {messages_path}") - raise SystemExit(3) + files = list(messages_path.glob("*.json")) + if len(files) == 0: + print(f"no message files (*.json) found in: {messages_path}") + raise SystemExit(3) for f in files: print(f"Processing {f.name} ...") @@ -43,7 +55,10 @@ def main(): json.dumps(out, ensure_ascii=False, indent=4) + "\n", encoding="utf-8" ) - print(f"Processed {len(files)} files in {messages_path}") + if args.files: + print(f"Processed {len(files)} files") + else: + print(f"Processed {len(files)} files in {messages_path}") if __name__ == "__main__": main()