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.

1.3 KB
Raw Blame
import { WebhookConfig, type WebhookConfigProps } from '@/components/Alerts/WebhookConfig';
import { SettingsPanel } from '@/components/shared/SettingsPanel';
import type { Webhook } from '@/api/notifications';
import {
  getAlertWebhooksSectionDescription,
  getAlertWebhooksSectionTitle,
} from '@/utils/alertWebhookPresentation';

interface AlertWebhookDestinationsSectionProps {
  webhooks: Webhook[];
  addWebhook: WebhookConfigProps['onAdd'];
  updateWebhook: WebhookConfigProps['onUpdate'];
  deleteWebhook: WebhookConfigProps['onDelete'];
  testWebhook: (webhookId: string, webhookData?: Omit<Webhook, 'id'>) => void;
  testingWebhook: string | null;
}

export function AlertWebhookDestinationsSection(props: AlertWebhookDestinationsSectionProps) {
  return (
    <SettingsPanel
      title={getAlertWebhooksSectionTitle()}
      description={getAlertWebhooksSectionDescription()}
      action={
        <span class="whitespace-nowrap text-xs text-muted">{props.webhooks.length} configured</span>
      }
      class="min-w-0"
      bodyClass="space-y-4"
    >
      <WebhookConfig
        webhooks={props.webhooks}
        onAdd={props.addWebhook}
        onUpdate={props.updateWebhook}
        onDelete={props.deleteWebhook}
        onTest={props.testWebhook}
        testing={props.testingWebhook}
      />
    </SettingsPanel>
  );
}