2019-01-14 07:44:23 -05:00
|
|
|
<?php
|
|
|
|
|
2020-11-03 17:18:31 +01:00
|
|
|
namespace Database\Seeders;
|
|
|
|
|
2019-01-14 07:44:23 -05:00
|
|
|
use Illuminate\Database\Seeder;
|
2020-11-03 17:18:31 +01:00
|
|
|
use Illuminate\Support\Facades\DB;
|
2019-01-14 07:44:23 -05:00
|
|
|
|
|
|
|
class DefaultWidgetSeeder extends Seeder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function run()
|
|
|
|
{
|
2019-01-17 12:33:42 -06:00
|
|
|
$widgets = [
|
2019-01-14 07:44:23 -05:00
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Availability map',
|
|
|
|
'widget' => 'availability-map',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Device summary horizontal',
|
|
|
|
'widget' => 'device-summary-horiz',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Alerts',
|
|
|
|
'widget' => 'alerts',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Device summary vertical',
|
|
|
|
'widget' => 'device-summary-vert',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Globe map',
|
|
|
|
'widget' => 'globe',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Syslog',
|
|
|
|
'widget' => 'syslog',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Eventlog',
|
|
|
|
'widget' => 'eventlog',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'World map',
|
|
|
|
'widget' => 'worldmap',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Graylog',
|
|
|
|
'widget' => 'graylog',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Graph',
|
|
|
|
'widget' => 'generic-graph',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Top Devices',
|
|
|
|
'widget' => 'top-devices',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Top Interfaces',
|
|
|
|
'widget' => 'top-interfaces',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Notes',
|
|
|
|
'widget' => 'notes',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'External Images',
|
|
|
|
'widget' => 'generic-image',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Component Status',
|
|
|
|
'widget' => 'component-status',
|
|
|
|
'base_dimensions' => '6,3',
|
2019-01-14 07:44:23 -05:00
|
|
|
],
|
2020-01-23 15:16:30 +01:00
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Alert History Stats',
|
|
|
|
'widget' => 'alertlog-stats',
|
|
|
|
'base_dimensions' => '6,3',
|
2020-01-23 15:16:30 +01:00
|
|
|
],
|
2019-01-14 07:44:23 -05:00
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Server Stats',
|
|
|
|
'widget' => 'server-stats',
|
|
|
|
'base_dimensions' => '6,3',
|
2020-01-23 12:27:57 +01:00
|
|
|
],
|
|
|
|
[
|
2020-09-21 15:59:34 +02:00
|
|
|
'widget_title' => 'Alert History',
|
|
|
|
'widget' => 'alertlog',
|
|
|
|
'base_dimensions' => '6,3',
|
2020-09-21 14:54:51 +02:00
|
|
|
],
|
2021-05-31 19:40:45 +02:00
|
|
|
[
|
|
|
|
'widget_title' => 'Top Errors',
|
|
|
|
'widget' => 'top-errors',
|
|
|
|
'base_dimensions' => '6,3',
|
|
|
|
],
|
2019-01-17 12:33:42 -06:00
|
|
|
];
|
|
|
|
|
|
|
|
$existing = DB::table('widgets')->pluck('widget');
|
|
|
|
|
2020-11-03 17:18:31 +01:00
|
|
|
DB::table('widgets')->insert(array_filter($widgets, function ($entry) use ($existing) {
|
2020-09-21 14:54:51 +02:00
|
|
|
return ! $existing->contains($entry['widget']);
|
2019-01-17 12:33:42 -06:00
|
|
|
}));
|
2019-01-14 07:44:23 -05:00
|
|
|
}
|
|
|
|
}
|