buang notifikasi pusher dalam page arcc

This commit is contained in:
BTMS2
2024-09-04 13:58:07 +08:00
parent dfae49f9d7
commit 392cf43713
2 changed files with 4 additions and 62 deletions
@@ -1,4 +1,4 @@
@extends('layouts.app_operasi')
@extends('layouts.app_callcenter')
@section('content')
<div class="container">
@@ -105,7 +105,7 @@
<!-- Right Side Of Navbar -->
<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>
<i id="bell" class="fa fa-bell"></i>
</a>
@@ -117,67 +117,9 @@
</a>
</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>