Skip to content

Commit

Permalink
feat: show maintenance mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ah-rahimi committed Jul 22, 2024
1 parent 2a53bf3 commit 5abf979
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 5 deletions.
17 changes: 17 additions & 0 deletions config/panel.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,23 @@
],
],

/*
|--------------------------------------------------------------------------
| Show Maintenance Mode
|--------------------------------------------------------------------------
|
| This option defines the maintenance mode for panel.
| You can set show, message, and color.
| colors is From Color Enum.
|
*/

'maintenance' => [
'show' => false,
'message' => 'Maintenance Mode is active!',
'color' => Color::DANGER,
],

/*
|------------------------------- -------------------------------------------
| Panel Items
Expand Down
16 changes: 11 additions & 5 deletions resources/views/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,15 @@ class="fa-light fa-times"></i></button>
@endforeach
</div>
</div>
@if (auth()->check())
<div class="bottom-sidebar">
<hr>
<div class="bottom-sidebar mt-3">
@if ($config['maintenance']['show'] && app()->maintenanceMode()->active())
<div class="badge text-bg-{{ $config['maintenance']['color'] ?? 'danger' }} py-2 w-100 mb-2"
style="white-space: normal;">
{{ $config['maintenance']['message'] ?? 'Maintenance Mode is active!' }}
</div>
@endif
@if (auth()->check())
<hr class="mt-0">
@if (strtolower($config['logout']['method']) == 'post')
<button onclick="document.getElementById('logout-form').submit();"
class="nav-link d-flex align-items-center gap-2">
Expand All @@ -111,8 +117,8 @@ class="nav-link d-flex align-items-center gap-2">
</div>
</a>
@endif
</div>
@endif
@endif
</div>
</div>

<div class="content">
Expand Down

0 comments on commit 5abf979

Please sign in to comment.