mirror of
https://github.com/swissmakers/fail2ban-ui.git
synced 2026-04-19 06:53:14 +02:00
Make toast notifications duration setable in function
This commit is contained in:
@@ -15,7 +15,7 @@ function showLoading(show) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Show toast notification
|
// Show toast notification
|
||||||
function showToast(message, type) {
|
function showToast(message, type, duration) {
|
||||||
var container = document.getElementById('toast-container');
|
var container = document.getElementById('toast-container');
|
||||||
if (!container || !message) return;
|
if (!container || !message) return;
|
||||||
|
|
||||||
@@ -38,7 +38,7 @@ function showToast(message, type) {
|
|||||||
setTimeout(function() {
|
setTimeout(function() {
|
||||||
toast.remove();
|
toast.remove();
|
||||||
}, 300);
|
}, 300);
|
||||||
}, 5000);
|
}, duration || 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show toast for ban event
|
// Show toast for ban event
|
||||||
|
|||||||
Reference in New Issue
Block a user