security/netbird: fix selectpicker and unbreak migration

The auth key may be required but not giving a default for obvious
reasons just makes it end up without a required value anyway until
user contact.

This can probably be made more robust in the future, but requires
a bit of thought on what we validate/enforce here anyway like an
"enbable" checkbox being checked requires filling this value, but
it's also not on the same page or model even making constraints
tricky.
This commit is contained in:
Franco Fichtner
2025-09-19 13:52:44 +02:00
parent 59762b0466
commit 25b4d65957
2 changed files with 3 additions and 4 deletions
@@ -8,7 +8,7 @@
<Default>https://api.netbird.io:443</Default>
</managementUrl>
<setupKey type="TextField">
<Required>Y</Required>
<!-- XXX fails migration for obvious reasons <Required>Y</Required> -->
<Mask>/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i</Mask>
<ValidationMessage>Please specify a valid setup key.</ValidationMessage>
</setupKey>
@@ -29,9 +29,8 @@
<script>
$(document).ready(() => {
mapDataToFormUI({
'frmSettings': "/api/netbird/settings/get"
}).done(() => {
mapDataToFormUI({'frmSettings': '/api/netbird/settings/get'}).done(() => {
$('.selectpicker').selectpicker('refresh');
updateServiceControlUI('netbird');
});