feat: add per-device custom Chrome production URL override

- Device model: add custom_chrome_url nullable column
- API: GET /api/wmt/config/<mac> returns device custom_chrome_url when set,
  falls back to WMTGlobalConfig.chrome_url for all other devices
- Web: device_edit POST saves/clears custom_chrome_url from form
- Template: wmt/device_form.html adds Chrome URL override section with
  clear status indicator (using global vs custom URL)
- DB: ALTER TABLE devices ADD COLUMN custom_chrome_url VARCHAR(500) applied
This commit is contained in:
ske087
2026-05-25 16:23:29 +03:00
parent e38bf07ef2
commit c1255bdb81
4 changed files with 33 additions and 2 deletions
+2 -2
View File
@@ -98,8 +98,8 @@ def get_device_config(mac_address):
_, device_ts, latest_ts = _latest_config_ts(session, mac)
payload = {
# Global settings
'chrome_url': global_cfg.chrome_url,
# Global settings (device custom_chrome_url overrides global chrome_url if set)
'chrome_url': (device.custom_chrome_url if device and device.custom_chrome_url else global_cfg.chrome_url),
'chrome_local_url': global_cfg.chrome_local_url or '',
'chrome_insecure_origin': global_cfg.chrome_insecure_origin,
'card_api_base_url': global_cfg.card_api_base_url,