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
View File
@@ -299,6 +299,8 @@ def device_edit(device_id):
device.location = request.form.get('location', '').strip() or None
device.card_presence = request.form.get('card_presence', 'enable')
device.description = request.form.get('notes', '').strip() or None
custom_url = request.form.get('custom_chrome_url', '').strip()
device.custom_chrome_url = custom_url if custom_url else None
device.config_updated_at = datetime.utcnow()
device.info_reviewed_at = datetime.utcnow()
flash('Device updated.', 'success')