Merge pull request #1621 from CachetHQ/truncate-incident-templates
Truncate incident templates
This commit is contained in:
@@ -13,6 +13,7 @@ namespace CachetHQ\Cachet\Composers;
|
||||
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use CachetHQ\Cachet\Models\Subscriber;
|
||||
use Illuminate\Contracts\View\View;
|
||||
|
||||
@@ -28,6 +29,7 @@ class DashboardComposer
|
||||
public function compose(View $view)
|
||||
{
|
||||
$view->withIncidentCount(Incident::notScheduled()->count());
|
||||
$view->withIncidentTemplateCount(IncidentTemplate::count());
|
||||
$view->withComponentCount(Component::all()->count());
|
||||
$view->withSubscriberCount(Subscriber::isVerified()->count());
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ namespace CachetHQ\Cachet\Console\Commands;
|
||||
use CachetHQ\Cachet\Models\Component;
|
||||
use CachetHQ\Cachet\Models\ComponentGroup;
|
||||
use CachetHQ\Cachet\Models\Incident;
|
||||
use CachetHQ\Cachet\Models\IncidentTemplate;
|
||||
use CachetHQ\Cachet\Models\Metric;
|
||||
use CachetHQ\Cachet\Models\MetricPoint;
|
||||
use CachetHQ\Cachet\Models\Setting;
|
||||
@@ -62,6 +63,7 @@ class DemoSeederCommand extends Command
|
||||
$this->seedComponentGroups();
|
||||
$this->seedComponents();
|
||||
$this->seedIncidents();
|
||||
$this->seedIncidentTemplates();
|
||||
$this->seedMetricPoints();
|
||||
$this->seedMetrics();
|
||||
$this->seedSettings();
|
||||
@@ -207,6 +209,16 @@ class DemoSeederCommand extends Command
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the incident templates table.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
protected function seedIncidentTemplates()
|
||||
{
|
||||
IncidentTemplate::truncate();
|
||||
}
|
||||
|
||||
/**
|
||||
* Seed the metric points table.
|
||||
*
|
||||
|
||||
@@ -33,6 +33,7 @@
|
||||
<a href="{{ route('dashboard.templates.index') }}">
|
||||
<i class="ion ion-ios-paper-outline"></i>
|
||||
<span>{{ trans('dashboard.incidents.incident-templates') }}</span>
|
||||
<span class="label label-info">{{ $incident_template_count }}</span>
|
||||
</a>
|
||||
</li>
|
||||
<li {!! set_active('dashboard/components*') !!}>
|
||||
|
||||
Reference in New Issue
Block a user