From 6f7b37a7308bbdd839a1c2d56c15fef0a0d43224 Mon Sep 17 00:00:00 2001 From: Eder Soares Date: Tue, 26 Dec 2023 14:51:32 -0300 Subject: [PATCH] Remove broadcast --- ieducar/intranet/scripts/notifications.js | 38 ----------------------- laravel-echo-server.json.example | 34 -------------------- resources/views/layout/default.blade.php | 4 --- 3 files changed, 76 deletions(-) delete mode 100644 laravel-echo-server.json.example diff --git a/ieducar/intranet/scripts/notifications.js b/ieducar/intranet/scripts/notifications.js index 831c2480e8..c04edb702c 100644 --- a/ieducar/intranet/scripts/notifications.js +++ b/ieducar/intranet/scripts/notifications.js @@ -1,41 +1,3 @@ -function startListenChannel(notificationsChannel) { - window.Echo.channel(notificationsChannel).listen('NotificationEvent', (e) => { - let notification = e.notification; - let url = e.url; - let unread = notification.read_at == null; - let className = unread ? 'unread' : 'read'; - let dateObj = new Date(notification.created_at); - let dateString = dateObj.toLocaleString('pt-BR'); - - $j('.dropdown-content-notifications .notifications-bar').after(` - -

` + notification.text + `

-

` + dateString + `

-
`); - - $j('.notification-balloon').show(); - - let notifications = []; - - $j.each($j('.dropdown-content-notifications').find('a'),function(index, value){ - notifications.push($j(value).data('id')); - }); - - if (notifications.length > 5) { - let keyRemove = notifications.length - 2; - $j(".dropdown-content-notifications a[data-id='" + notifications[keyRemove] + "']").remove(); - } - updateNotReadCount(); - }); - updateNotReadCount(); -} - -function updateNotReadCount() { - $j.get("/notificacoes/quantidade-nao-lidas", function (data) { - $j('.btn-mark-all-read .not-read-count').text(data); - }); -}; - function getNotifications() { $j.get("/notificacoes/retorna-notificacoes-usuario", function (data) { $j.each(data, function( index, value ) { diff --git a/laravel-echo-server.json.example b/laravel-echo-server.json.example deleted file mode 100644 index 26c9358836..0000000000 --- a/laravel-echo-server.json.example +++ /dev/null @@ -1,34 +0,0 @@ -{ - "authHost": "http://localhost", - "authEndpoint": "/broadcasting/auth", - "clients": [], - "database": "redis", - "databaseConfig": { - "redis": { - "host": "localhost" - }, - "sqlite": { - "databasePath": "/database/laravel-echo-server.sqlite" - } - }, - "devMode": true, - "host": null, - "port": "6001", - "protocol": "http", - "socketio": {}, - "secureOptions": 67108864, - "sslCertPath": "", - "sslKeyPath": "", - "sslCertChainPath": "", - "sslPassphrase": "", - "subscribers": { - "http": true, - "redis": true - }, - "apiOriginAllow": { - "allowCors": false, - "allowOrigin": "", - "allowMethods": "", - "allowHeaders": "" - } -} diff --git a/resources/views/layout/default.blade.php b/resources/views/layout/default.blade.php index e788f9113c..baad9827cd 100644 --- a/resources/views/layout/default.blade.php +++ b/resources/views/layout/default.blade.php @@ -249,10 +249,6 @@ function goOrClose(url) { @include('layout.vue')