Codebase review: stability, performance, usability, and i18n fixes
Stability: - Fix race condition: set _is_running before create_task in target processors - Await probe task after cancel in wled_target_processor - Replace raw fetch() with fetchWithAuth() across devices, kc-targets, pattern-templates - Add try/catch to showTestTemplateModal in streams.js - Wrap blocking I/O in asyncio.to_thread (picture_targets, system restore) - Fix dashboardStopAll to filter only running targets with ok guard Performance: - Vectorize fire effect spark loop with numpy in effect_stream - Vectorize FFT band binning with cumulative sum in analysis.py - Rewrite pixel_processor with vectorized numpy (accept ndarray or list) - Add httpx.AsyncClient connection pooling with lock in wled_provider - Optimize _send_pixels_http to avoid np.hstack allocation in wled_client - Mutate chart arrays in-place in dashboard, perf-charts, targets - Merge dashboard 2-batch fetch into single Promise.all - Hoist frame_time outside loop in mapped_stream Usability: - Fix health check interval load/save in device settings - Swap confirm modal button classes (No=secondary, Yes=danger) - Add aria-modal to audio/value source editors, fix close button aria-labels - Add modal footer close button to settings modal - Add dedicated calibration LED count validation error keys i18n: - Replace ~50 hardcoded English strings with t() calls across 12 JS files - Add 50 new keys to en.json, ru.json, zh.json - Localize inline toasts in index.html with window.t fallback - Add data-i18n to command palette footer - Add localization policy to CLAUDE.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -992,5 +992,54 @@
|
||||
"settings.saved_backups.download": "下载",
|
||||
"settings.saved_backups.delete": "删除",
|
||||
"settings.saved_backups.delete_confirm": "删除此备份文件?",
|
||||
"settings.saved_backups.delete_error": "删除备份失败"
|
||||
"settings.saved_backups.delete_error": "删除备份失败",
|
||||
"device.error.power_off_failed": "关闭设备失败",
|
||||
"device.removed": "设备已移除",
|
||||
"device.error.remove_failed": "移除设备失败",
|
||||
"device.error.settings_load_failed": "加载设备设置失败",
|
||||
"device.error.brightness": "更新亮度失败",
|
||||
"device.error.required": "请填写所有字段",
|
||||
"device.error.update": "更新设备失败",
|
||||
"device.error.save": "保存设置失败",
|
||||
"device_discovery.error.fill_all_fields": "请填写所有字段",
|
||||
"device_discovery.added": "设备添加成功",
|
||||
"device_discovery.error.add_failed": "添加设备失败",
|
||||
"calibration.error.load_failed": "加载校准失败",
|
||||
"calibration.error.css_load_failed": "加载色带源失败",
|
||||
"calibration.error.test_toggle_failed": "切换测试边缘失败",
|
||||
"calibration.saved": "校准已保存",
|
||||
"calibration.error.save_failed": "保存校准失败",
|
||||
"calibration.error.led_count_mismatch": "LED总数必须等于设备LED数量",
|
||||
"calibration.error.led_count_exceeded": "校准的LED超过了LED总数",
|
||||
"dashboard.error.profile_toggle_failed": "切换配置文件失败",
|
||||
"dashboard.error.start_failed": "启动处理失败",
|
||||
"dashboard.error.stop_failed": "停止处理失败",
|
||||
"dashboard.error.autostart_toggle_failed": "切换自动启动失败",
|
||||
"dashboard.error.stop_all": "停止所有目标失败",
|
||||
"target.error.editor_open_failed": "打开目标编辑器失败",
|
||||
"target.error.start_failed": "启动目标失败",
|
||||
"target.error.stop_failed": "停止目标失败",
|
||||
"target.error.clone_failed": "克隆目标失败",
|
||||
"target.error.autostart_toggle_failed": "切换自动启动失败",
|
||||
"target.error.delete_failed": "删除目标失败",
|
||||
"audio_source.error.load": "加载音频源失败",
|
||||
"audio_template.error.clone_failed": "克隆音频模板失败",
|
||||
"value_source.error.load": "加载数值源失败",
|
||||
"color_strip.error.editor_open_failed": "打开色带编辑器失败",
|
||||
"color_strip.error.clone_failed": "克隆色带源失败",
|
||||
"color_strip.error.delete_failed": "删除色带源失败",
|
||||
"pattern.error.editor_open_failed": "打开图案模板编辑器失败",
|
||||
"pattern.error.clone_failed": "克隆图案模板失败",
|
||||
"pattern.error.delete_failed": "删除图案模板失败",
|
||||
"pattern.error.capture_bg_failed": "捕获背景失败",
|
||||
"stream.error.clone_picture_failed": "克隆图片源失败",
|
||||
"stream.error.clone_capture_failed": "克隆捕获模板失败",
|
||||
"stream.error.clone_pp_failed": "克隆后处理模板失败",
|
||||
"kc_target.error.editor_open_failed": "打开关键颜色编辑器失败",
|
||||
"kc_target.error.clone_failed": "克隆关键颜色目标失败",
|
||||
"kc_target.error.delete_failed": "删除关键颜色目标失败",
|
||||
"theme.switched.dark": "已切换到深色主题",
|
||||
"theme.switched.light": "已切换到浅色主题",
|
||||
"accent.color.updated": "强调色已更新",
|
||||
"search.footer": "↑↓ 导航 · Enter 选择 · Esc 关闭"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user