diff --git a/hivemq-edge/src/frontend/src/api/__generated__/index.ts b/hivemq-edge/src/frontend/src/api/__generated__/index.ts index 6ca98666f0..b64992927f 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/index.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/index.ts @@ -31,6 +31,7 @@ export type { Link } from './models/Link'; export type { LinkList } from './models/LinkList'; export { Listener } from './models/Listener'; export type { ListenerList } from './models/ListenerList'; +export { LocalBridgeSubscription } from './models/LocalBridgeSubscription'; export type { Metric } from './models/Metric'; export type { MetricList } from './models/MetricList'; export type { Module } from './models/Module'; @@ -70,6 +71,7 @@ export { $Link } from './schemas/$Link'; export { $LinkList } from './schemas/$LinkList'; export { $Listener } from './schemas/$Listener'; export { $ListenerList } from './schemas/$ListenerList'; +export { $LocalBridgeSubscription } from './schemas/$LocalBridgeSubscription'; export { $Metric } from './schemas/$Metric'; export { $MetricList } from './schemas/$MetricList'; export { $Module } from './schemas/$Module'; diff --git a/hivemq-edge/src/frontend/src/api/__generated__/models/Bridge.ts b/hivemq-edge/src/frontend/src/api/__generated__/models/Bridge.ts index 217e7d4f4b..fc43dd59c2 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/models/Bridge.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/models/Bridge.ts @@ -4,6 +4,7 @@ /* eslint-disable */ import type { BridgeSubscription } from './BridgeSubscription'; +import type { LocalBridgeSubscription } from './LocalBridgeSubscription'; import type { Status } from './Status'; import type { TlsConfiguration } from './TlsConfiguration'; @@ -31,7 +32,7 @@ export type Bridge = { /** * localSubscriptions associated with the bridge */ - localSubscriptions?: Array; + localSubscriptions?: Array; /** * Is loop prevention enabled on the connection */ diff --git a/hivemq-edge/src/frontend/src/api/__generated__/models/BridgeSubscription.ts b/hivemq-edge/src/frontend/src/api/__generated__/models/BridgeSubscription.ts index a68b44dbf8..6b57f333ad 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/models/BridgeSubscription.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/models/BridgeSubscription.ts @@ -6,7 +6,7 @@ import type { BridgeCustomUserProperty } from './BridgeCustomUserProperty'; /** - * localSubscriptions associated with the bridge + * remoteSubscriptions associated with the bridge */ export type BridgeSubscription = { /** @@ -17,10 +17,6 @@ export type BridgeSubscription = { * The destination topic for this filter set. */ destination: string; - /** - * The exclusion patterns - */ - excludes?: Array | null; /** * The filters for this subscription. */ diff --git a/hivemq-edge/src/frontend/src/api/__generated__/models/LocalBridgeSubscription.ts b/hivemq-edge/src/frontend/src/api/__generated__/models/LocalBridgeSubscription.ts new file mode 100644 index 0000000000..7870a2c09c --- /dev/null +++ b/hivemq-edge/src/frontend/src/api/__generated__/models/LocalBridgeSubscription.ts @@ -0,0 +1,51 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { BridgeCustomUserProperty } from './BridgeCustomUserProperty'; + +/** + * localSubscriptions associated with the bridge + */ +export type LocalBridgeSubscription = { + /** + * The customUserProperties for this subscription + */ + customUserProperties?: Array; + /** + * The destination topic for this filter set. + */ + destination: string; + /** + * The exclusion patterns + */ + excludes?: Array | null; + /** + * The filters for this subscription. + */ + filters: Array; + /** + * The maxQoS for this subscription. + */ + maxQoS: LocalBridgeSubscription.maxQoS; + /** + * The preserveRetain for this subscription + */ + preserveRetain?: boolean; +}; + +export namespace LocalBridgeSubscription { + + /** + * The maxQoS for this subscription. + */ + export enum maxQoS { + '_0' = 0, + '_1' = 1, + '_2' = 2, + } + + +} + diff --git a/hivemq-edge/src/frontend/src/api/__generated__/schemas/$Bridge.ts b/hivemq-edge/src/frontend/src/api/__generated__/schemas/$Bridge.ts index 3e38adc3a5..7c38e5a95d 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/schemas/$Bridge.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/schemas/$Bridge.ts @@ -42,7 +42,7 @@ export const $Bridge = { localSubscriptions: { type: 'array', contains: { - type: 'BridgeSubscription', + type: 'LocalBridgeSubscription', }, }, loopPreventionEnabled: { diff --git a/hivemq-edge/src/frontend/src/api/__generated__/schemas/$BridgeSubscription.ts b/hivemq-edge/src/frontend/src/api/__generated__/schemas/$BridgeSubscription.ts index b4144d2f72..9bc68fd6cc 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/schemas/$BridgeSubscription.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/schemas/$BridgeSubscription.ts @@ -3,7 +3,7 @@ /* tslint:disable */ /* eslint-disable */ export const $BridgeSubscription = { - description: `localSubscriptions associated with the bridge`, + description: `remoteSubscriptions associated with the bridge`, properties: { customUserProperties: { type: 'array', @@ -16,15 +16,6 @@ export const $BridgeSubscription = { description: `The destination topic for this filter set.`, isRequired: true, }, - excludes: { - type: 'array', - contains: { - type: 'string', - description: `The exclusion patterns`, - isNullable: true, - }, - isNullable: true, - }, filters: { type: 'array', contains: { diff --git a/hivemq-edge/src/frontend/src/api/__generated__/schemas/$LocalBridgeSubscription.ts b/hivemq-edge/src/frontend/src/api/__generated__/schemas/$LocalBridgeSubscription.ts new file mode 100644 index 0000000000..3b9adee137 --- /dev/null +++ b/hivemq-edge/src/frontend/src/api/__generated__/schemas/$LocalBridgeSubscription.ts @@ -0,0 +1,45 @@ +/* generated using openapi-typescript-codegen -- do no edit */ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ +export const $LocalBridgeSubscription = { + description: `localSubscriptions associated with the bridge`, + properties: { + customUserProperties: { + type: 'array', + contains: { + type: 'BridgeCustomUserProperty', + }, + }, + destination: { + type: 'string', + description: `The destination topic for this filter set.`, + isRequired: true, + }, + excludes: { + type: 'array', + contains: { + type: 'string', + description: `The exclusion patterns`, + isNullable: true, + }, + isNullable: true, + }, + filters: { + type: 'array', + contains: { + type: 'string', + description: `The filters for this subscription.`, + }, + isRequired: true, + }, + maxQoS: { + type: 'Enum', + isRequired: true, + }, + preserveRetain: { + type: 'boolean', + description: `The preserveRetain for this subscription`, + }, + }, +} as const; diff --git a/hivemq-edge/src/frontend/src/api/__generated__/services/BridgesService.ts b/hivemq-edge/src/frontend/src/api/__generated__/services/BridgesService.ts index c2ffd4d24d..e14ae7b6ad 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/services/BridgesService.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/services/BridgesService.ts @@ -53,7 +53,7 @@ export class BridgesService { * @returns StatusList The Connection Details Verification Result. * @throws ApiError */ - public status(): CancelablePromise { + public getBridgesStatus(): CancelablePromise { return this.httpRequest.request({ method: 'GET', url: '/api/v1/management/bridges/status', @@ -128,7 +128,7 @@ export class BridgesService { * @returns Status Success * @throws ApiError */ - public getStatus( + public getBridgeStatus( bridgeId: string, ): CancelablePromise { return this.httpRequest.request({ @@ -148,7 +148,7 @@ export class BridgesService { * @returns StatusTransitionResult Success * @throws ApiError */ - public changeStatus( + public transitionBridgeStatus( bridgeId: string, requestBody: StatusTransitionCommand, ): CancelablePromise { diff --git a/hivemq-edge/src/frontend/src/api/__generated__/services/ProtocolAdaptersService.ts b/hivemq-edge/src/frontend/src/api/__generated__/services/ProtocolAdaptersService.ts index 8a73c36ef3..be05970700 100644 --- a/hivemq-edge/src/frontend/src/api/__generated__/services/ProtocolAdaptersService.ts +++ b/hivemq-edge/src/frontend/src/api/__generated__/services/ProtocolAdaptersService.ts @@ -123,13 +123,13 @@ export class ProtocolAdaptersService { } /** - * Get the up to date status of a bridge - * Get the up to date status of a bridge. + * Get the up to date status of an adapter + * Get the up to date status an adapter. * @param adapterId The name of the adapter to query. * @returns Status Success * @throws ApiError */ - public getStatus1( + public getAdapterStatus( adapterId: string, ): CancelablePromise { return this.httpRequest.request({ @@ -149,7 +149,7 @@ export class ProtocolAdaptersService { * @returns StatusTransitionResult Success * @throws ApiError */ - public changeStatus1( + public transitionAdapterStatus( adapterId: string, requestBody: StatusTransitionCommand, ): CancelablePromise { @@ -193,7 +193,7 @@ export class ProtocolAdaptersService { * @returns StatusList The Connection Details Verification Result. * @throws ApiError */ - public status1(): CancelablePromise { + public getAdaptersStatus(): CancelablePromise { return this.httpRequest.request({ method: 'GET', url: '/api/v1/management/protocol-adapters/status', diff --git a/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetAdaptersStatus.tsx b/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetAdaptersStatus.tsx index a6f1376169..a5fcddb1f1 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetAdaptersStatus.tsx +++ b/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetAdaptersStatus.tsx @@ -9,7 +9,7 @@ export const useGetAdaptersStatus = () => { return useQuery( [QUERY_KEYS.ADAPTERS, QUERY_KEYS.CONNECTION_STATUS], async () => { - const item = await appClient.protocolAdapters.status1() + const item = await appClient.protocolAdapters.getAdaptersStatus() return item }, { diff --git a/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetBridgesStatus.tsx b/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetBridgesStatus.tsx index ea3219a5b4..83247b0272 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetBridgesStatus.tsx +++ b/hivemq-edge/src/frontend/src/api/hooks/useConnection/useGetBridgesStatus.tsx @@ -9,7 +9,7 @@ export const useGetBridgesStatus = () => { return useQuery( [QUERY_KEYS.BRIDGES, QUERY_KEYS.CONNECTION_STATUS], async () => { - const item = await appClient.bridges.status() + const item = await appClient.bridges.getBridgesStatus() return item }, { diff --git a/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useGetBridgeConnectionStatus.tsx b/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useGetBridgeConnectionStatus.tsx index a58b313b6f..f060c50878 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useGetBridgeConnectionStatus.tsx +++ b/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useGetBridgeConnectionStatus.tsx @@ -13,7 +13,7 @@ export const useGetBridgeConnectionStatus = (name: string | undefined) => { return useQuery( [QUERY_KEYS.BRIDGES, name, QUERY_KEYS.CONNECTION_STATUS], async () => { - const item = await appClient.bridges.getStatus(name as string) + const item = await appClient.bridges.getBridgeStatus(name as string) return item }, { diff --git a/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useSetConnectionStatus.tsx b/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useSetConnectionStatus.tsx index b08971dca9..d44767e531 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useSetConnectionStatus.tsx +++ b/hivemq-edge/src/frontend/src/api/hooks/useGetBridges/useSetConnectionStatus.tsx @@ -14,7 +14,7 @@ export const useSetConnectionStatus = () => { const queryClient = useQueryClient() const setConnectionStatus = ({ name, requestBody }: SetConnectionStatusProps) => { - return appClient.bridges.changeStatus(name, requestBody) + return appClient.bridges.transitionBridgeStatus(name, requestBody) } return useMutation(setConnectionStatus, { diff --git a/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/useSetConnectionStatus.tsx b/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/useSetConnectionStatus.tsx index f0ad9baada..9d616c1ac5 100644 --- a/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/useSetConnectionStatus.tsx +++ b/hivemq-edge/src/frontend/src/api/hooks/useProtocolAdapters/useSetConnectionStatus.tsx @@ -14,7 +14,7 @@ export const useSetConnectionStatus = () => { const queryClient = useQueryClient() const changeStatus = ({ adapterId, requestBody }: SetConnectionStatusProps) => { - return appClient.protocolAdapters.changeStatus1(adapterId, requestBody) + return appClient.protocolAdapters.transitionAdapterStatus(adapterId, requestBody) } return useMutation(changeStatus, { diff --git a/hivemq-edge/src/frontend/src/modules/Bridges/components/panels/SubscriptionsPanel.tsx b/hivemq-edge/src/frontend/src/modules/Bridges/components/panels/SubscriptionsPanel.tsx index 79747249a6..6f04a989f7 100644 --- a/hivemq-edge/src/frontend/src/modules/Bridges/components/panels/SubscriptionsPanel.tsx +++ b/hivemq-edge/src/frontend/src/modules/Bridges/components/panels/SubscriptionsPanel.tsx @@ -174,34 +174,38 @@ const SubscriptionsPanel: FC = ({ form, type }) => { /> - - {t('bridge.subscription.excludes')} - { - const { value, onChange, ...rest } = field - const formatValue = value?.map((e) => ({ value: e, label: e })) - return ( - onChange(values.map((item) => item.value))} - inputId={`${type}.${index}.excludes`} - // options={[{ value: 'ddfd', label: 'fgg' }]} - // menuIsOpen={false} - isClearable={true} - placeholder={'add topic'} - isMulti={true} - components={{ - DropdownIndicator: null, - }} - /> - ) - }} - control={form.control} - /> - {errors[type]?.[index]?.filters?.message} - + {type === 'localSubscriptions' && ( + + + {t('bridge.subscription.excludes')} + + { + const { value, onChange, ...rest } = field + const formatValue = value?.map((e) => ({ value: e, label: e })) + return ( + onChange(values.map((item) => item.value))} + inputId={`${type}.${index}.excludes`} + // options={[{ value: 'ddfd', label: 'fgg' }]} + // menuIsOpen={false} + isClearable={true} + placeholder={'add topic'} + isMulti={true} + components={{ + DropdownIndicator: null, + }} + /> + ) + }} + control={form.control} + /> + {errors[type]?.[index]?.filters?.message} + + )}