diff --git a/src/hooks/Flow/useFlowNode.ts b/src/hooks/Flow/useFlowNode.ts index d287d1de8..396f8f2fa 100644 --- a/src/hooks/Flow/useFlowNode.ts +++ b/src/hooks/Flow/useFlowNode.ts @@ -63,6 +63,9 @@ export const SinkType = { Elasticsearch: BridgeType.Elasticsearch, SysKeeperForwarder: BridgeType.SysKeeperForwarder, S3: BridgeType.S3, + AzureBlobStorage: BridgeType.AzureBlobStorage, + Couchbase: BridgeType.Couchbase, + Datalayers: BridgeType.Datalayers, RePub: 'republish', Console: 'console', } diff --git a/src/hooks/Flow/useNodeDrawer.ts b/src/hooks/Flow/useNodeDrawer.ts index 123a5c5c8..2b55bb8da 100644 --- a/src/hooks/Flow/useNodeDrawer.ts +++ b/src/hooks/Flow/useNodeDrawer.ts @@ -65,6 +65,7 @@ export default (): { [SinkType.Console]: ConsoleForm, [SinkType.MQTTBroker]: UsingSchemaBridgeConfig, [SinkType.InfluxDB]: BridgeInfluxdbConfig, + [SinkType.Datalayers]: BridgeInfluxdbConfig, } const getFormComponent = (type: string) => { if (!type) { diff --git a/src/hooks/Flow/useNodeForm.ts b/src/hooks/Flow/useNodeForm.ts index 3a0b894e5..0c744cdaf 100644 --- a/src/hooks/Flow/useNodeForm.ts +++ b/src/hooks/Flow/useNodeForm.ts @@ -76,7 +76,7 @@ export default (): { isUsingSchemaBridgeType: (type: string) => boolean checkFormIsEmpty: (type: string, form: Record) => boolean } => { - const { createRawInfluxDBForm } = useBridgeFormCreator() + const { createRawInfluxDBForm, createRawDataLayersForm } = useBridgeFormCreator() /** * If you are using a schema bridge, create an empty object directly */ @@ -96,6 +96,7 @@ export default (): { [SinkType.Console]: createConsoleForm, [SinkType.GCP]: () => ({ role: Role.Producer }), [SinkType.InfluxDB]: createRawInfluxDBForm, + [SinkType.Datalayers]: createRawDataLayersForm, [SinkType.Pulsar]: emptyCreator, } const getFormDataByType = (type: string) => { diff --git a/src/hooks/Rule/bridge/useBridgeFormCreator.ts b/src/hooks/Rule/bridge/useBridgeFormCreator.ts index 9e863d41d..9765012d1 100644 --- a/src/hooks/Rule/bridge/useBridgeFormCreator.ts +++ b/src/hooks/Rule/bridge/useBridgeFormCreator.ts @@ -11,6 +11,7 @@ import { export default (): { createRawMQTTForm: (direction?: BridgeDirection) => any createRawInfluxDBForm: () => OtherBridge + createRawDataLayersForm: () => OtherBridge } => { const { createDefaultResourceOptsForm } = useResourceOpt() const { createSSLForm } = useSSL() @@ -76,8 +77,14 @@ export default (): { }), }) + const createRawDataLayersForm = () => ({ + ...createRawInfluxDBForm(), + type: BridgeType.Datalayers, + }) + return { createRawMQTTForm, createRawInfluxDBForm, + createRawDataLayersForm, } } diff --git a/src/hooks/Rule/bridge/useBridgeTypeValue.ts b/src/hooks/Rule/bridge/useBridgeTypeValue.ts index dc3ee6a96..8754352ca 100644 --- a/src/hooks/Rule/bridge/useBridgeTypeValue.ts +++ b/src/hooks/Rule/bridge/useBridgeTypeValue.ts @@ -39,8 +39,10 @@ const bridgesOrder = [ BridgeType.Elasticsearch, BridgeType.S3, BridgeType.AzureBlobStorage, + BridgeType.Couchbase, BridgeType.SysKeeperProxy, BridgeType.SysKeeperForwarder, + BridgeType.Datalayers, ] export const bridgeOrderIndex: Record = bridgesOrder.reduce( (obj, type, index) => ({ ...obj, [type]: index }), diff --git a/src/views/Flow/components/NodeDrawer.vue b/src/views/Flow/components/NodeDrawer.vue index 4708f3d49..81a7f10be 100644 --- a/src/views/Flow/components/NodeDrawer.vue +++ b/src/views/Flow/components/NodeDrawer.vue @@ -251,6 +251,7 @@ const formComponentPropsMap: ComputedRef> [ProcessingType.Function]: { sourceNodes: addedSourceNodes.value }, [SinkType.RePub]: { isUsingInFlow: true }, [SinkType.InfluxDB]: { ...bridgeFormProps, labelWidth: '152px' }, + [SinkType.Datalayers]: { ...bridgeFormProps, labelWidth: '152px' }, })) const getFormComponentProps = (type: string) => { const ret = formComponentPropsMap.value[type] diff --git a/src/views/RuleEngine/Bridge/BridgeCreate.vue b/src/views/RuleEngine/Bridge/BridgeCreate.vue index 997cab9ab..28212a0e5 100644 --- a/src/views/RuleEngine/Bridge/BridgeCreate.vue +++ b/src/views/RuleEngine/Bridge/BridgeCreate.vue @@ -103,6 +103,7 @@ v-if="[BridgeType.InfluxDB, BridgeType.Datalayers].includes(chosenBridgeType)" v-model="bridgeData" ref="formCom" + :type="chosenBridgeType" /> { + if (props.type === BridgeType.Datalayers) { + return createRawDataLayersForm() + } + return createRawInfluxDBForm() +} const formData: Ref = ref(createDefaultValue()) const formCom = ref()