瀏覽代碼

feat(alarm): alarm configuration

lind 3 年之前
父節點
當前提交
4d5483a910
共有 2 個文件被更改,包括 9 次插入0 次删除
  1. 8 0
      src/pages/rule-engine/Alarm/Config/index.tsx
  2. 1 0
      src/pages/rule-engine/Alarm/Config/typing.d.ts

+ 8 - 0
src/pages/rule-engine/Alarm/Config/index.tsx

@@ -207,6 +207,7 @@ const Config = () => {
             const resp = await service.getDataExchange('consume');
             if (resp.status === 200) {
               f.setInitialValues(resp.result?.config.config);
+              f.setValuesIn('id', resp.result?.id);
             }
           });
         },
@@ -222,6 +223,7 @@ const Config = () => {
             const resp = await service.getDataExchange('producer');
             if (resp.status === 200) {
               f.setInitialValues(resp.result?.config.config);
+              f.setValuesIn('id', resp.result?.id);
             }
           });
         },
@@ -282,6 +284,10 @@ const Config = () => {
   const ioSchema: ISchema = {
     type: 'object',
     properties: {
+      id: {
+        'x-component': 'Input',
+        'x-hidden': true,
+      },
       kafka: {
         title: 'kafka地址',
         type: 'string',
@@ -351,6 +357,7 @@ const Config = () => {
       config: {
         config: inputConfig,
       },
+      id: inputConfig.id,
       sourceType: 'kafka',
       exchangeType: 'producer',
     });
@@ -359,6 +366,7 @@ const Config = () => {
         sourceType: 'kafka',
         config: outputConfig,
       },
+      id: outputConfig.id,
       sourceType: 'kafka',
       exchangeType: 'consume',
     });

+ 1 - 0
src/pages/rule-engine/Alarm/Config/typing.d.ts

@@ -6,6 +6,7 @@ type LevelItem = {
 };
 
 type IOConfigItem = {
+  id?: string;
   address: string;
   topic: string;
   username: string;