1
1
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:
Dane Everitt 2017-06-18 20:47:34 -05:00
parent 1c5f892049
commit 81d265db08
No known key found for this signature in database
GPG Key ID: EEA66103B3D71F53
2 changed files with 24 additions and 2 deletions

View File

@ -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>

View File

@ -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>