@@ -23,9 +23,14 @@ interface K8sNotification {
23
23
24
24
const ToastNotifications = ( ) => {
25
25
useEffect ( ( ) => {
26
- console . log ( '[Toast] 🚀 Component mounted, attempting WebSocket connection...' ) ;
27
- console . log ( '[Toast] 🔗 Connecting to:' , import . meta. env . VITE_API_URL || 'http://localhost:3000' ) ;
28
-
26
+ console . log (
27
+ '[Toast] 🚀 Component mounted, attempting WebSocket connection...' ,
28
+ ) ;
29
+ console . log (
30
+ '[Toast] 🔗 Connecting to:' ,
31
+ import . meta. env . VITE_API_URL || 'http://localhost:3000' ,
32
+ ) ;
33
+
29
34
// Connect to WebSocket server with more options
30
35
const socket = io ( import . meta. env . VITE_API_URL || 'http://localhost:3000' , {
31
36
reconnection : true ,
@@ -45,7 +50,10 @@ const ToastNotifications = () => {
45
50
} ) ;
46
51
47
52
socket . on ( 'disconnect' , ( reason ) => {
48
- console . log ( '[Toast] ❌ Disconnected from WebSocket server. Reason:' , reason ) ;
53
+ console . log (
54
+ '[Toast] ❌ Disconnected from WebSocket server. Reason:' ,
55
+ reason ,
56
+ ) ;
49
57
toast . warning ( 'Disconnected from monitoring server' ) ;
50
58
} ) ;
51
59
@@ -63,13 +71,17 @@ const ToastNotifications = () => {
63
71
title : notification . title ,
64
72
severity : notification . metadata . severity ,
65
73
namespace : notification . metadata . namespace ,
66
- pod : notification . metadata . pod
74
+ pod : notification . metadata . pod ,
67
75
} ) ;
68
76
69
77
// Create toast message
70
78
const message = `${ notification . title } \n${ notification . metadata . namespace } /${ notification . metadata . pod } \n${ notification . message } ` ;
71
-
72
- console . log ( '[Toast] 🍞 Showing toast for:' , notification . type , notification . metadata . severity ) ;
79
+
80
+ console . log (
81
+ '[Toast] 🍞 Showing toast for:' ,
82
+ notification . type ,
83
+ notification . metadata . severity ,
84
+ ) ;
73
85
74
86
// Show toast based on type and severity
75
87
switch ( notification . type ) {
@@ -98,7 +110,10 @@ const ToastNotifications = () => {
98
110
toast . info ( message , { duration : 5000 } ) ;
99
111
break ;
100
112
default :
101
- console . log ( '[Toast] ❓ Unknown notification type:' , notification . type ) ;
113
+ console . log (
114
+ '[Toast] ❓ Unknown notification type:' ,
115
+ notification . type ,
116
+ ) ;
102
117
toast . info ( message , { duration : 5000 } ) ;
103
118
}
104
119
} ) ;
@@ -113,9 +128,9 @@ const ToastNotifications = () => {
113
128
console . log ( '[Toast] 🧪 Connection status check:' ) ;
114
129
console . log ( '[Toast] 🔌 Connected:' , socket . connected ) ;
115
130
console . log ( '[Toast] 🆔 Socket ID:' , socket . id ) ;
116
-
131
+
117
132
// Test toast to make sure Sonner is working
118
- toast . info ( 'Toast component loaded and ready!' ) ;
133
+ toast . info ( 'Coffybara loaded and ready!' ) ;
119
134
} , 2000 ) ;
120
135
121
136
// Cleanup on unmount
0 commit comments