diff --git a/packages/ui/src/demo-mocks/network/queries/get-queues.ts b/packages/ui/src/demo-mocks/network/queries/get-queues.ts index 4892502..d26df4c 100644 --- a/packages/ui/src/demo-mocks/network/queries/get-queues.ts +++ b/packages/ui/src/demo-mocks/network/queries/get-queues.ts @@ -1,10 +1,12 @@ -import type { GetQueuesQuery } from '@/typings/gql'; +import { QueueProvider } from '@/typings/gql'; import { networkMockData } from '../data'; +import type { GetQueuesQuery } from '@/typings/gql'; export const getQueuesMock = (): Promise => { return Promise.resolve({ queues: networkMockData.queues.map((queue) => ({ id: queue.id, + provider: QueueProvider.Bull, name: queue.name, isPaused: queue.isPaused, keyPrefix: queue.keyPrefix, diff --git a/packages/ui/src/network/queries/get-queues.ts b/packages/ui/src/network/queries/get-queues.ts index e85b535..378be64 100644 --- a/packages/ui/src/network/queries/get-queues.ts +++ b/packages/ui/src/network/queries/get-queues.ts @@ -1,6 +1,6 @@ import { gqlClient } from '@/network/gql-client'; -import type { GetQueuesQuery } from '@/typings/gql'; import { gql } from 'graphql-request'; +import type { GetQueuesQuery } from '@/typings/gql'; export const getQueues = (): Promise => gqlClient.request( @@ -8,6 +8,7 @@ export const getQueues = (): Promise => query GetQueues { queues { id + provider readonly name keyPrefix diff --git a/packages/ui/src/screens/jobs/QueueActions/index.tsx b/packages/ui/src/screens/jobs/QueueActions/index.tsx index 28e7c96..3b2a103 100644 --- a/packages/ui/src/screens/jobs/QueueActions/index.tsx +++ b/packages/ui/src/screens/jobs/QueueActions/index.tsx @@ -7,7 +7,7 @@ import { useNetwork } from '@/hooks/use-network'; import AddIcon from '@mui/icons-material/Add'; import { useAbstractMutation } from '@/hooks/use-abstract-mutation'; import { useRemoveJobsModalStore } from '@/stores/remove-jobs-modal'; -import { JobStatusClean } from '@/typings/gql'; +import { JobStatusClean, QueueProvider } from '@/typings/gql'; import Menu from '@mui/material/Menu'; import MenuItem from '@mui/material/MenuItem'; import IconButton from '@mui/material/IconButton'; @@ -167,7 +167,8 @@ export default function QueueActions() { dataSearch, }); }} - size="large"> + size="large" + > @@ -176,7 +177,8 @@ export default function QueueActions() { disabled={isReadonly} aria-controls="more-queue-actions-menu" aria-haspopup="true" - size="large"> + size="large" + > )} - - Remove jobs by pattern - + {queueData?.provider === QueueProvider.Bull && ( + + Remove jobs by pattern + + )} {isQueuePaused ? ( resumeMutation.mutate(sharedMutationArg)}> Resume diff --git a/packages/ui/src/typings/gql.ts b/packages/ui/src/typings/gql.ts index fa0b6ba..0ffa6ad 100644 --- a/packages/ui/src/typings/gql.ts +++ b/packages/ui/src/typings/gql.ts @@ -262,6 +262,7 @@ export type QueryJobArgs = { export type Queue = { id: Scalars['String']; + provider: QueueProvider; name: Scalars['String']; readonly?: Maybe; keyPrefix?: Maybe; @@ -303,6 +304,11 @@ export type QueueMetrics = { processingTimeMax?: Maybe; }; +export enum QueueProvider { + Bull = 'bull', + Bullmq = 'bullmq' +} + export type RedisInfo = { redis_version: Scalars['String']; used_memory: Scalars['String']; @@ -548,7 +554,7 @@ export type GetQueuesQueryVariables = Exact<{ [key: string]: never; }>; export type GetQueuesQuery = { queues?: Maybe + Pick & { jobsCounts: Pick } )>> };