Update syslog display and backend (#9228)

* Update syslog display backend
select boxes now dynamically load instead of loading all on pageload
select and table ajax backends completely redone with Laravel (just syslog for now)
duplicate url creation to Url utility class for now (uses Device model instead of array)
build short hostname functionality into Device->displayName() helper

* Fix whitespace

* Some tidying up. Split out displayName() and shortDisplayName()

* Enable auto-sizing.
Fix small error in Url

* Eager load device
Use bootstrap theme for select2
This commit is contained in:
Tony Murray
2018-09-20 15:33:03 -05:00
committed by Neil Lathwood
parent c30d494505
commit 21ca8bf0b0
17 changed files with 915 additions and 160 deletions

View File

@@ -13,6 +13,7 @@
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use Carbon\Carbon;
use LibreNMS\Util\IPv4;
$factory->define(App\User::class, function (Faker\Generator $faker) {
@@ -82,3 +83,18 @@ $factory->define(\App\Models\Ipv4Network::class, function (Faker\Generator $fake
'ipv4_network' => $faker->ipv4 . '/' . $faker->numberBetween(0, 32),
];
});
$factory->define(\App\Models\Syslog::class, function (Faker\Generator $faker) {
$facilities = ['kern', 'user', 'mail', 'daemon', 'auth', 'syslog', 'lpr', 'news', 'uucp', 'cron', 'authpriv', 'ftp', 'ntp', 'security', 'console', 'solaris-cron', 'local0', 'local1', 'local2', 'local3', 'local4', 'local5', 'local6', 'local7'];
$levels = ['emerg', 'alert', 'crit', 'err', 'warning', 'notice', 'info', 'debug'];
return [
'facility' => $faker->randomElement($facilities),
'priority' => $faker->randomElement($levels),
'level' => $faker->randomElement($levels),
'tag' => $faker->asciify(str_repeat('*', $faker->numberBetween(0, 10))),
'timestamp' => Carbon::now(),
'program' => $faker->asciify(str_repeat('*', $faker->numberBetween(0, 32))),
'msg' => $faker->text(),
];
});