From 3a7455b6a19541937b4ac51845b96c9f57c70ed7 Mon Sep 17 00:00:00 2001 From: "marco.mruz" Date: Wed, 15 May 2024 14:30:01 +0200 Subject: [PATCH 1/2] add new model/version column to devices table --- .../src/__generated__/graphql.ts | 54 ++++++++++++++++++- .../src/pages/device-list/device-list.tsx | 3 ++ .../src/pages/device-list/device-table.tsx | 21 +++++++- 3 files changed, 75 insertions(+), 3 deletions(-) diff --git a/packages/frinx-inventory-client/src/__generated__/graphql.ts b/packages/frinx-inventory-client/src/__generated__/graphql.ts index 5403baba4..5c25e0cae 100644 --- a/packages/frinx-inventory-client/src/__generated__/graphql.ts +++ b/packages/frinx-inventory-client/src/__generated__/graphql.ts @@ -649,6 +649,7 @@ export type Device = Node & { name: Scalars['String']['output']; port: Maybe; serviceState: DeviceServiceState; + software: Maybe; source: DeviceSource; updatedAt: Scalars['String']['output']; vendor: Maybe; @@ -677,6 +678,11 @@ export type DeviceEdge = { node: Device; }; +export type DeviceListUsage = { + __typename?: 'DeviceListUsage'; + devicesUsage: Array>; +}; + export type DeviceOrderByInput = { direction: SortDirection; sortKey: SortDeviceBy; @@ -697,6 +703,19 @@ export type DeviceSource = | 'IMPORTED' | 'MANUAL'; +export type DeviceUsage = { + __typename?: 'DeviceUsage'; + cpuLoad: Scalars['Float']['output']; + memoryLoad: Scalars['Float']['output']; +}; + +export type DevicesUsage = { + __typename?: 'DevicesUsage'; + cpuLoad: Scalars['Float']['output']; + deviceName: Scalars['String']['output']; + memoryLoad: Scalars['Float']['output']; +}; + export type DiffData = { __typename?: 'DiffData'; data: Scalars['String']['output']; @@ -1045,6 +1064,12 @@ export type NetTopology = { nodes: Array; }; +export type NetTopologyVersionData = { + __typename?: 'NetTopologyVersionData'; + edges: Array; + nodes: Array; +}; + export type Node = { id: Scalars['ID']['output']; }; @@ -2292,6 +2317,7 @@ export type ConductorMutation = { deleteWorkflowDefinition: DeleteWorkflowDefinitionPayload; editEventHandler: EditEventHandlerPayload; executeWorkflowByName: Maybe; + exportWorkflowDefinition: Maybe; /** Lists workflows for the given correlation id list */ getWorkflows: Maybe; /** Log Task Execution Details */ @@ -2417,6 +2443,12 @@ export type ConductorMutationExecuteWorkflowByNameArgs = { }; +export type ConductorMutationExportWorkflowDefinitionArgs = { + name: Scalars['String']['input']; + version?: InputMaybe; +}; + + export type ConductorMutationGetWorkflowsArgs = { includeClosed?: InputMaybe; includeTasks?: InputMaybe; @@ -3145,6 +3177,7 @@ export type DeviceInventoryQuery = { labels: LabelConnection; locations: LocationConnection; netTopology: Maybe; + netTopologyVersionData: NetTopologyVersionData; node: Maybe; phyTopologyVersionData: PhyTopologyVersionData; ptpDiffSynce: PtpDiffSynce; @@ -3220,6 +3253,11 @@ export type DeviceInventoryQueryLocationsArgs = { }; +export type DeviceInventoryQueryNetTopologyVersionDataArgs = { + version: Scalars['String']['input']; +}; + + export type DeviceInventoryQueryNodeArgs = { id: Scalars['ID']['input']; }; @@ -3286,10 +3324,24 @@ export type DeviceInventoryQueryZonesArgs = { export type DeviceInventorySubscription = { __typename?: 'deviceInventorySubscription'; + deviceUsage: Maybe; + devicesUsage: Maybe; uniconfigShell: Maybe; }; +export type DeviceInventorySubscriptionDeviceUsageArgs = { + deviceName: Scalars['String']['input']; + refreshEverySec?: InputMaybe; +}; + + +export type DeviceInventorySubscriptionDevicesUsageArgs = { + deviceNames: Array; + refreshEverySec?: InputMaybe; +}; + + export type DeviceInventorySubscriptionUniconfigShellArgs = { input?: InputMaybe; sessionId: Scalars['String']['input']; @@ -3913,7 +3965,7 @@ export type DevicesQueryVariables = Exact<{ }>; -export type DevicesQuery = { __typename?: 'Query', deviceInventory: { __typename?: 'deviceInventoryQuery', devices: { __typename?: 'DeviceConnection', edges: Array<{ __typename?: 'DeviceEdge', node: { __typename?: 'Device', id: string, name: string, createdAt: string, isInstalled: boolean, serviceState: DeviceServiceState, zone: { __typename?: 'Zone', id: string, name: string } } }>, pageInfo: { __typename?: 'PageInfo', startCursor: string | null, endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean } } } }; +export type DevicesQuery = { __typename?: 'Query', deviceInventory: { __typename?: 'deviceInventoryQuery', devices: { __typename?: 'DeviceConnection', edges: Array<{ __typename?: 'DeviceEdge', node: { __typename?: 'Device', id: string, name: string, createdAt: string, isInstalled: boolean, serviceState: DeviceServiceState, version: string | null, model: string | null, software: string | null, zone: { __typename?: 'Zone', id: string, name: string } } }>, pageInfo: { __typename?: 'PageInfo', startCursor: string | null, endCursor: string | null, hasNextPage: boolean, hasPreviousPage: boolean } } } }; export type InstallDeviceMutationVariables = Exact<{ id: Scalars['String']['input']; diff --git a/packages/frinx-inventory-client/src/pages/device-list/device-list.tsx b/packages/frinx-inventory-client/src/pages/device-list/device-list.tsx index 03585d189..67dcc63cf 100644 --- a/packages/frinx-inventory-client/src/pages/device-list/device-list.tsx +++ b/packages/frinx-inventory-client/src/pages/device-list/device-list.tsx @@ -79,6 +79,9 @@ const DEVICES_QUERY = gql` createdAt isInstalled serviceState + version + model + software zone { id name diff --git a/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx b/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx index a63bb051a..c469d59f4 100644 --- a/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx +++ b/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx @@ -71,6 +71,9 @@ const DeviceTable: VoidFunctionComponent = ({ )} + + Model/Version + = ({ /> - - {device.name} + + + {device.name} + + {device.model == null && device.software == null && device.software == null && ( + + + + + + )} + + + + + {device.model ?? device.software ?? '?'} / {device.version ?? '?'} From 9c27377a51d26e3fa49dcd2ea426b3cc9ef94759 Mon Sep 17 00:00:00 2001 From: "marco.mruz" Date: Wed, 15 May 2024 14:54:17 +0200 Subject: [PATCH 2/2] grayish unknown device names --- .../src/pages/device-list/device-table.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx b/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx index c469d59f4..75fd64be5 100644 --- a/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx +++ b/packages/frinx-inventory-client/src/pages/device-list/device-table.tsx @@ -114,6 +114,7 @@ const DeviceTable: VoidFunctionComponent = ({ const { isInstalled } = device; const localDate = getLocalDateFromUTC(device.createdAt); const isLoading = installLoadingMap[device.id] ?? false; + const isUnknown = device.model == null && device.software == null && device.version == null; return ( @@ -126,10 +127,15 @@ const DeviceTable: VoidFunctionComponent = ({ - + {device.name} - {device.model == null && device.software == null && device.software == null && ( + {isUnknown && (