buang notifikasi pusher dalam page arcc
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
@extends('layouts.app_operasi')
|
@extends('layouts.app_callcenter')
|
||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
|||||||
@@ -105,7 +105,7 @@
|
|||||||
|
|
||||||
<!-- Right Side Of Navbar -->
|
<!-- Right Side Of Navbar -->
|
||||||
<ul class="navbar-nav ml-auto">
|
<ul class="navbar-nav ml-auto">
|
||||||
<li class="nav-item dropdown" style="margin-right:10px;">
|
<!-- <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>
|
<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>
|
<i id="bell" class="fa fa-bell"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -117,67 +117,9 @@
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li> -->
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
var audio = new Audio("{{ asset('sound/3.wav') }}");
|
|
||||||
audio.muted = true;
|
|
||||||
|
|
||||||
// Enable pusher logging - don't include this in production
|
|
||||||
Pusher.logToConsole = false;
|
|
||||||
|
|
||||||
var pusher = new Pusher("{{ env('PUSHER_APP_KEY') }}", {
|
|
||||||
cluster: 'ap1',
|
|
||||||
encrypted: true
|
|
||||||
});
|
|
||||||
|
|
||||||
var channel = pusher.subscribe('operasi-notify');
|
|
||||||
channel.bind('operasi-event', function(data) {
|
|
||||||
let message = JSON.stringify(data);
|
|
||||||
|
|
||||||
$('#bell').css("color", "red");
|
|
||||||
$('#linkz').text(data.namateller + " Pohon Kelulusan");
|
|
||||||
$("#linkz").attr("href", "{{ url('kelulusan') }}");
|
|
||||||
|
|
||||||
if(window.location.pathname === '/operasi/kelulusan')
|
|
||||||
{
|
|
||||||
location.reload();
|
|
||||||
}else{
|
|
||||||
audio.play();
|
|
||||||
audio.muted = false;
|
|
||||||
var countlagu = 1;
|
|
||||||
audio.onended = function() {
|
|
||||||
if(countlagu <= 3){
|
|
||||||
countlagu++;
|
|
||||||
this.play();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
const Toast = Swal.mixin({
|
|
||||||
toast: true,
|
|
||||||
position: 'top-end',
|
|
||||||
showConfirmButton: false,
|
|
||||||
timer: 5000,
|
|
||||||
timerProgressBar: true,
|
|
||||||
didOpen: (toast) => {
|
|
||||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
|
||||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
Toast.fire({
|
|
||||||
icon: 'error',
|
|
||||||
title: 'Kelulusan Dipohon Sekarang!'
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
$("#navbarDropdown").click(function(){
|
|
||||||
$('#bell').css("color", "grey");
|
|
||||||
});
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user