mirror of
https://github.com/pterodactyl/panel.git
synced 2024-11-23 09:32:29 +01:00
Prevent the irritating moment when you logout accidentally when trying to click Admin CP.
This commit is contained in:
parent
1c5f892049
commit
81d265db08
@ -79,7 +79,7 @@
|
||||
<li><a href="{{ route('index') }}" data-toggle="tooltip" data-placement="bottom" title="Exit Admin Control"><i class="fa fa-server"></i></a></li>
|
||||
</li>
|
||||
<li>
|
||||
<li><a href="{{ route('auth.logout') }}" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-power-off"></i></a></li>
|
||||
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="Logout"><i class="fa fa-power-off"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -191,6 +191,17 @@
|
||||
{!! Theme::js('vendor/select2/select2.full.min.js') !!}
|
||||
{!! Theme::js('js/admin/functions.js') !!}
|
||||
{!! Theme::js('js/autocomplete.js') !!}
|
||||
|
||||
@if(Auth::user()->isRootAdmin())
|
||||
<script>
|
||||
$('#logoutButton').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
if (confirm('Are you sure you want to logout?')) {
|
||||
window.location = $(this).attr('href');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
@show
|
||||
</body>
|
||||
</html>
|
||||
|
@ -83,7 +83,7 @@
|
||||
</li>
|
||||
@endif
|
||||
<li>
|
||||
<li><a href="{{ route('auth.logout') }}" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.logout') }}"><i class="fa fa-power-off"></i></a></li>
|
||||
<li><a href="{{ route('auth.logout') }}" id="logoutButton" data-toggle="tooltip" data-placement="bottom" title="{{ @trans('strings.logout') }}"><i class="fa fa-power-off"></i></a></li>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -283,6 +283,17 @@
|
||||
@if(config('pterodactyl.lang.in_context'))
|
||||
{!! Theme::js('vendor/phraseapp/phraseapp.js') !!}
|
||||
@endif
|
||||
|
||||
@if(Auth::user()->isRootAdmin())
|
||||
<script>
|
||||
$('#logoutButton').on('click', function (event) {
|
||||
event.preventDefault();
|
||||
if (confirm('Are you sure you want to logout?')) {
|
||||
window.location = $(this).attr('href');
|
||||
}
|
||||
});
|
||||
</script>
|
||||
@endif
|
||||
@show
|
||||
</body>
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user