diff --git a/app/Composers/IndexComposer.php b/app/Composers/IndexComposer.php index 3fafd749..ff9a33f7 100644 --- a/app/Composers/IndexComposer.php +++ b/app/Composers/IndexComposer.php @@ -28,6 +28,7 @@ class IndexComposer $withData = [ 'systemStatus' => 'danger', 'systemMessage' => trans('cachet.service.bad'), + 'favicon' => 'favicon', ]; if (Component::notStatus(1)->count() === 0) { @@ -43,6 +44,13 @@ class IndexComposer } } + // Determine favicon to use + if (Component::where('status', 4)->count() > 0 || Incident::where('status', 2)->count() > 0) { + $withData['favicon'] = 'favicon-high-alert'; + } elseif (Component::whereIn('status', [2, 3])->count() > 0 || Incident::whereIn('status', [1, 3])->count() > 0) { + $withData['favicon'] = 'favicon-medium-alert'; + } + $view->with($withData); } } diff --git a/public/img/favicon-high-alert.ico b/public/img/favicon-high-alert.ico new file mode 100644 index 00000000..968e1f29 Binary files /dev/null and b/public/img/favicon-high-alert.ico differ diff --git a/public/img/favicon-high-alert.png b/public/img/favicon-high-alert.png new file mode 100644 index 00000000..1a1f405c Binary files /dev/null and b/public/img/favicon-high-alert.png differ diff --git a/public/img/favicon-medium-alert.ico b/public/img/favicon-medium-alert.ico new file mode 100644 index 00000000..90669b21 Binary files /dev/null and b/public/img/favicon-medium-alert.ico differ diff --git a/public/img/favicon-medium-alert.png b/public/img/favicon-medium-alert.png new file mode 100644 index 00000000..79c1e873 Binary files /dev/null and b/public/img/favicon-medium-alert.png differ diff --git a/resources/views/layout/master.blade.php b/resources/views/layout/master.blade.php index 21de846a..976d862b 100644 --- a/resources/views/layout/master.blade.php +++ b/resources/views/layout/master.blade.php @@ -19,8 +19,13 @@ - - + @if (isset($favicon)) + + + @else + + + @endif