Skip to content

armgit / Pulse

Public Imported from GitHub
0

Real-time monitoring dashboard for Proxmox VE, PBS, Docker, Kubernetes, TrueNAS and vSphere. Self-hosted, with alerts for failed backups, full disks, unhealthy containers and offline nodes.

784 B
Raw Blame
import { showToast } from '@/utils/toast';

const DEFAULT_DURATIONS: Record<'success' | 'error' | 'info', number> = {
  success: 5000,
  error: 10000,
  info: 5000,
};

export const notificationStore = {
  success: (message: string, duration: number = DEFAULT_DURATIONS.success) => {
    return showToast('success', message, undefined, duration);
  },

  error: (message: string, duration: number = DEFAULT_DURATIONS.error) => {
    return showToast('error', message, undefined, duration);
  },

  info: (message: string, duration: number = DEFAULT_DURATIONS.info) => {
    return showToast('info', message, undefined, duration);
  },

  warning: (message: string, duration: number = DEFAULT_DURATIONS.info) => {
    return showToast('warning', message, undefined, duration);
  },
};