Fix snmp.timeout setting via Web UI (#13937)

Add Float type for global settings
This commit is contained in:
Tony Murray 2022-04-23 08:35:24 -05:00 committed by GitHub
parent 7764faebb5
commit 806e10ace1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 59 additions and 4 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,8 +1,8 @@
{
"/js/app.js": "/js/app.js?id=9a782f01e0fef69d02a2",
"/js/app.js": "/js/app.js?id=5ddec7f7302f146a8dcc",
"/js/manifest.js": "/js/manifest.js?id=2951ae529be231f05a93",
"/css/vendor.css": "/css/vendor.css?id=2568831af31dbfc3128a",
"/css/app.css": "/css/app.css?id=113371a4c292b55f1e9e",
"/css/app.css": "/css/app.css?id=bd093a6a2e2682bb59ef",
"/js/vendor.js": "/js/vendor.js?id=c5fd3d75a63757080dbb",
"/js/lang/de.js": "/js/lang/de.js?id=e2912d41c392d8bc4e2c",
"/js/lang/en.js": "/js/lang/en.js?id=7aed3226fceb16d522cd",

View File

@ -0,0 +1,54 @@
<!--
- FloatSetting.vue
-
- Description-
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <https://www.gnu.org/licenses/>.
-
- @package LibreNMS
- @link https://www.librenms.org
- @copyright 2019 Tony Murray
- @author Tony Murray <murraytony@gmail.com>
-->
<template>
<input type="number" class="form-control"
:name="name"
:value="value"
@input="$emit('input', parseNumber($event.target.value))"
:required="required"
:disabled="disabled"
>
</template>
<script>
import BaseSetting from "./BaseSetting";
export default {
name: "SettingFloat",
mixins: [BaseSetting],
methods: {
parseNumber(number) {
let value = parseFloat(number);
return isNaN(value) ? number : value;
}
}
}
</script>
<style scoped>
.form-control {
padding-right: 12px;
}
</style>

View File

@ -1596,6 +1596,7 @@ return [
'boolean' => ':value is not a valid boolean',
'color' => ':value is not a valid hex color code',
'email' => ':value is not a valid email',
'float' => ':value is not an float',
'integer' => ':value is not an integer',
'password' => 'The password is incorrect',
'select' => ':value is not an allowed value',