DONE: use flexible name for api call in frontend
This commit is contained in:
@@ -59,7 +59,7 @@
|
||||
|
||||
@if(Auth::user()->roles == 'ppc' || Auth::user()->roles == 'pc')
|
||||
<script>
|
||||
window.api = "{{ config('api.url') }}";
|
||||
window.api = "{{ api_url_for_browser() }}";
|
||||
window.kodcaw = "{{ Auth::user()->cawangan }}";
|
||||
window.apikey = "{{ env('PUSHER_APP_KEY') }}";
|
||||
</script>
|
||||
@@ -199,7 +199,7 @@
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
|
||||
|
||||
@include('layouts.partials.impersonation_nav')
|
||||
|
||||
@php $auth_user = Auth::user(); @endphp
|
||||
@if ($auth_user['roles'] == 'ppc' || $auth_user['roles'] == 'pc')
|
||||
@@ -381,6 +381,7 @@
|
||||
<a class="dropdown-item" href="{{ route('profile') }}">
|
||||
{{ __('Profile') }}
|
||||
</a>
|
||||
@if(!(Auth::check() && method_exists(Auth::user(), 'isImpersonated') && Auth::user()->isImpersonated()))
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
@@ -390,6 +391,7 @@
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@include('layouts.partials.impersonation_nav')
|
||||
<!-- <li class="nav-item dropdown" style="margin-right:10px;">
|
||||
<a id="navbarDropdown" class="nav-link " href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
<i id="bell" class="fa fa-bell"></i>
|
||||
@@ -143,6 +144,7 @@
|
||||
<a class="dropdown-item" href="{{ route('profile') }}">
|
||||
{{ __('Profile') }}
|
||||
</a>
|
||||
@if(!(Auth::check() && method_exists(Auth::user(), 'isImpersonated') && Auth::user()->isImpersonated()))
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
@@ -152,6 +154,7 @@
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -107,6 +107,7 @@
|
||||
|
||||
<!-- Right Side Of Navbar -->
|
||||
<ul class="navbar-nav ml-auto">
|
||||
@include('layouts.partials.impersonation_nav')
|
||||
<li class="nav-item dropdown" style="margin-right:10px;">
|
||||
<a id="navbarDropdown" class="nav-link " href="#" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" v-pre>
|
||||
<i id="bell" class="fa fa-bell"></i>
|
||||
@@ -233,6 +234,7 @@
|
||||
<a class="dropdown-item" href="{{ route('profile') }}">
|
||||
{{ __('Profile') }}
|
||||
</a>
|
||||
@if(!(Auth::check() && method_exists(Auth::user(), 'isImpersonated') && Auth::user()->isImpersonated()))
|
||||
<a class="dropdown-item" href="{{ route('logout') }}"
|
||||
onclick="event.preventDefault();
|
||||
document.getElementById('logout-form').submit();">
|
||||
@@ -242,6 +244,7 @@
|
||||
<form id="logout-form" action="{{ route('logout') }}" method="POST" class="d-none">
|
||||
@csrf
|
||||
</form>
|
||||
@endif
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
@if(Auth::check() && method_exists(Auth::user(), 'isImpersonated') && Auth::user()->isImpersonated())
|
||||
<li class="nav-item" style="margin-right:10px;">
|
||||
<form method="post" action="{{ route('impersonate.leave') }}" class="m-0">
|
||||
@csrf
|
||||
<button type="submit" class="btn btn-sm btn-warning" title="Stop impersonate">
|
||||
Keluar Penyamaran
|
||||
</button>
|
||||
</form>
|
||||
</li>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user