浏览代码

feat(webhooks): wire domain-scoped webhook overrides in detail tab

Replace the domain detail Webhooks placeholder with the shared
Webhooks panel scoped by domainId and override help.

AI-Co-Authored-By: Grok
chendeben 1 月之前
父节点
当前提交
cbe8dd617a
共有 1 个文件被更改,包括 6 次插入10 次删除
  1. 6 10
      src/pages/Domains/DomainDetail.tsx

+ 6 - 10
src/pages/Domains/DomainDetail.tsx

@@ -37,6 +37,7 @@ import type {
   SmtpCredential,
   SmtpRelay
 } from '../../frontend/types';
+import Webhooks from '../Webhooks';
 
 interface DomainDetailProps {
   domain: Domain;
@@ -157,7 +158,11 @@ export default function DomainDetail({
           },
           { key: 'logs', label: 'Sending Logs', children: <SendingLogsTab events={domainEvents} /> },
           { key: 'guide', label: 'Integration Guide', children: <IntegrationGuideTab domain={domain} config={config} apiTokens={apiTokens} /> },
-          { key: 'webhooks', label: 'Webhooks', children: <Placeholder title="Webhooks" /> }
+          {
+            key: 'webhooks',
+            label: 'Webhooks',
+            children: <Webhooks domainId={domain.id} domains={[domain]} onCopy={onCopy} />
+          }
         ]}
       />
       <Modal title={t('domainDetail.editTitle')} open={editOpen} onCancel={() => setEditOpen(false)} onOk={saveEdit} confirmLoading={actionLoading}>
@@ -425,15 +430,6 @@ function IntegrationGuideTab({
   );
 }
 
-function Placeholder({ title }: { title: string }) {
-  const { t } = useI18n();
-  return (
-    <SectionCard>
-      <EmptyState description={`${title} ${t('domainDetail.placeholder')}`} />
-    </SectionCard>
-  );
-}
-
 function orderedRecords(records: DnsRecord[]) {
   return getVisibleDnsRecords(records);
 }