supervisor step3
This commit is contained in:
27
supervisor/html/js/vi
Normal file
27
supervisor/html/js/vi
Normal file
@ -0,0 +1,27 @@
|
||||
// js/services/NotificationService.js
|
||||
export class NotificationService {
|
||||
constructor() {
|
||||
this.toastElement = document.getElementById('toast');
|
||||
}
|
||||
|
||||
showMessage(message, type = 'info') {
|
||||
this.toastElement.textContent = message;
|
||||
this.toastElement.className = `fixed bottom-4 right-4 px-6 py-3 rounded shadow-lg ${
|
||||
type === 'error' ? 'bg-red-500' : 'bg-green-500'
|
||||
} text-white`;
|
||||
|
||||
this.toastElement.classList.remove('hidden');
|
||||
|
||||
setTimeout(() => {
|
||||
this.toastElement.classList.add('hidden');
|
||||
}, 3000);
|
||||
}
|
||||
|
||||
showError(message) {
|
||||
this.showMessage(message, 'error');
|
||||
}
|
||||
|
||||
showSuccess(message) {
|
||||
this.showMessage(message, 'success');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user