mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
webui: Added validation for Oxidized API URL config (#7978)
* Add http:// to oxidized URLs missing them. * Fixed typo. * Form validation instead of backend fix. * Don't update setting on invalid pattern.
This commit is contained in:
@ -1260,8 +1260,9 @@ function generate_dynamic_config_panel($title, $config_groups, $items = array(),
|
||||
if ($item['type'] == 'checkbox') {
|
||||
$output .= '<input id="' . $item['name'] . '" type="checkbox" name="global-config-check" ' . $config_groups[$item['name']]['config_checked'] . ' data-on-text="Yes" data-off-text="No" data-size="small" data-config_id="' . $config_groups[$item['name']]['config_id'] . '">';
|
||||
} elseif ($item['type'] == 'text') {
|
||||
$pattern = isset($item['pattern']) ? ' required pattern="' . $item['pattern'] . '"' : "";
|
||||
$output .= '
|
||||
<input id="' . $item['name'] . '" class="form-control" type="text" name="global-config-input" value="' . $config_groups[$item['name']]['config_value'] . '" data-config_id="' . $config_groups[$item['name']]['config_id'] . '">
|
||||
<input id="' . $item['name'] . '" class="form-control validation" type="text" name="global-config-input" value="' . $config_groups[$item['name']]['config_value'] . '" data-config_id="' . $config_groups[$item['name']]['config_id'] . '"' . $pattern . '>
|
||||
<span class="form-control-feedback"><i class="fa" aria-hidden="true"></i></span>
|
||||
';
|
||||
} elseif ($item['type'] == 'password') {
|
||||
|
Reference in New Issue
Block a user