addition of new dashboard

This commit is contained in:
2026-08-20 15:08:32 +00:00
parent 0622018d95
commit bf59249ed7
161 changed files with 13170 additions and 119 deletions

View File

@@ -0,0 +1,26 @@
// Minimal toast notifications — used to surface fetch/load errors instead of
// failing silently to the console.
function host() {
let el = document.getElementById('toast-host');
if (!el) {
el = document.createElement('div');
el.id = 'toast-host';
el.className = 'fixed bottom-4 right-4 z-[200] flex flex-col gap-2 pointer-events-none';
document.body.appendChild(el);
}
return el;
}
/**
* @param {string} message
* @param {'error'|'info'} [type]
*/
export function toast(message, type = 'error') {
const colors = type === 'error' ? 'border-error text-error' : 'border-surface-border text-on-surface';
const el = document.createElement('div');
el.className = `bg-surface-container-lowest border ${colors} rounded-lg shadow-lg px-md py-sm text-label-md font-label-md`;
el.textContent = message;
host().appendChild(el);
setTimeout(() => el.remove(), 4000);
}