feat: асинхронное обновление списков в LuCI (fix XHR timeout) и форматированный config.json

- backend: добавлены команды list_update_async и list_update_status с отслеживанием шагов в /var/run/tachyon/list-update.status
- ui: кнопка ручного обновления списков теперь запускает операцию в фоне, показывает модалку с индикатором и опрашивает статус (устранен таймаут LuCI XHR в 30 сек)
- json: sing-box config.json теперь форматируется с отступами в 2 пробела (sprintf '%.2J') для удобства чтения
- tests: обновлены тесты и добавлены проверки для list-update-status (122/122 passed)
This commit is contained in:
Dushnilin
2026-09-06 17:55:40 +03:00
parent 2fd8c2dca3
commit 625715fed0
10 changed files with 256 additions and 17 deletions
+2 -2
View File
@@ -117,10 +117,10 @@ function ensure_parent_dir(path) {
return ensure_dir(parent_dir(path));
}
function atomic_write_json_file(path, value) {
function atomic_write_json_file(path, value, indent) {
if (!ensure_parent_dir(path))
return false;
return write_json_file(path, value);
return write_json_file(path, value, indent != null ? indent : 2);
}
function fixture_section_list(type_name) {
+1 -1
View File
@@ -787,7 +787,7 @@ function patch_dns_config(state_path) {
let temp_config = temp_path();
if (backup_path == "" || temp_config == "" ||
fs.writefile(backup_path, fs.readfile(config_path)) == null ||
!common.write_json_file(temp_config, config)) {
!common.write_json_file(temp_config, config, 2)) {
remove_files([ backup_path, temp_config ]);
exit(1);
}