New device:add code (#13842)

* New device:add code
pre-requisite for updating other code paths
includes option to set display name
separate validation code from device creation

* remove duplicate community and v3 creds

* style fixes

* some lint fixes

* fix phpstan

* Exception cleanup
improved messages and translations

* port association mode to enum
well, pseudo enum

* defaults and cleanups

* fixed/improved validation messages

* fix tests

* fix stupid ide refactor mistake

* lint fixes
This commit is contained in:
Tony Murray
2022-03-12 16:14:32 -06:00
committed by GitHub
parent 6d3bf03074
commit 1bfd411995
27 changed files with 803 additions and 389 deletions

View File

@@ -3,6 +3,7 @@
// Build SNMP Cache Array
use Illuminate\Support\Str;
use LibreNMS\Config;
use LibreNMS\Enum\PortAssociationMode;
use LibreNMS\RRD\RrdDefinition;
use LibreNMS\Util\Debug;
use LibreNMS\Util\Number;
@@ -460,7 +461,7 @@ d_echo($port_stats);
// compatibility reasons.
$port_association_mode = Config::get('default_port_association_mode');
if ($device['port_association_mode']) {
$port_association_mode = get_port_assoc_mode_name($device['port_association_mode']);
$port_association_mode = PortAssociationMode::getName($device['port_association_mode']);
}
$ports_found = [];