Skip to content

Commit 5abf979

Browse files
committed
feat: show maintenance mode
1 parent 2a53bf3 commit 5abf979

File tree

2 files changed

+28
-5
lines changed

2 files changed

+28
-5
lines changed

config/panel.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,23 @@
8181
],
8282
],
8383

84+
/*
85+
|--------------------------------------------------------------------------
86+
| Show Maintenance Mode
87+
|--------------------------------------------------------------------------
88+
|
89+
| This option defines the maintenance mode for panel.
90+
| You can set show, message, and color.
91+
| colors is From Color Enum.
92+
|
93+
*/
94+
95+
'maintenance' => [
96+
'show' => false,
97+
'message' => 'Maintenance Mode is active!',
98+
'color' => Color::DANGER,
99+
],
100+
84101
/*
85102
|------------------------------- -------------------------------------------
86103
| Panel Items

resources/views/index.blade.php

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,15 @@ class="fa-light fa-times"></i></button>
8686
@endforeach
8787
</div>
8888
</div>
89-
@if (auth()->check())
90-
<div class="bottom-sidebar">
91-
<hr>
89+
<div class="bottom-sidebar mt-3">
90+
@if ($config['maintenance']['show'] && app()->maintenanceMode()->active())
91+
<div class="badge text-bg-{{ $config['maintenance']['color'] ?? 'danger' }} py-2 w-100 mb-2"
92+
style="white-space: normal;">
93+
{{ $config['maintenance']['message'] ?? 'Maintenance Mode is active!' }}
94+
</div>
95+
@endif
96+
@if (auth()->check())
97+
<hr class="mt-0">
9298
@if (strtolower($config['logout']['method']) == 'post')
9399
<button onclick="document.getElementById('logout-form').submit();"
94100
class="nav-link d-flex align-items-center gap-2">
@@ -111,8 +117,8 @@ class="nav-link d-flex align-items-center gap-2">
111117
</div>
112118
</a>
113119
@endif
114-
</div>
115-
@endif
120+
@endif
121+
</div>
116122
</div>
117123

118124
<div class="content">

0 commit comments

Comments
 (0)