diff --git a/src/app/apis/connector/connector.service.ts b/src/app/apis/connector/connector.service.ts index a8bc6393..286eb053 100644 --- a/src/app/apis/connector/connector.service.ts +++ b/src/app/apis/connector/connector.service.ts @@ -215,6 +215,18 @@ export class ConnectorService extends BaseService { ); return this.httpGet(endpoint); } + + public getConnectorMetrics(baseHref: string, connectorType: string, connectorName: string): Promise { + this.logger?.info( + "[ConnectorService] Getting the Connector metrics:" + connectorName , + ); + const endpoint: string = this.endpoint( + "debezium/:connectorType/connectors/:connectorName/metrics", + baseHref, + { connectorType, connectorName }, + ); + return this.httpGet(endpoint); + } /** @@ -385,19 +397,19 @@ export class ConnectorService extends BaseService { /** * Get the available connector metrics for the supplied clusterId and connector name */ - public getConnectorMetrics( - clusterId: number, - connectorName: string - ): Promise { - this.logger?.info("[ConnectorService] Getting the connector metrics."); + // public getConnectorMetrics( + // clusterId: number, + // connectorName: string + // ): Promise { + // this.logger?.info("[ConnectorService] Getting the connector metrics."); - const endpoint: string = this.endpoint( - "/connectors/:clusterId/:connectorName/metrics", - "", - { clusterId, connectorName } - ); - return this.httpGet(endpoint); - } + // const endpoint: string = this.endpoint( + // "/connectors/:clusterId/:connectorName/metrics", + // "", + // { clusterId, connectorName } + // ); + // return this.httpGet(endpoint); + // } /** * Get the Connector config diff --git a/src/app/components/ConnectorStatusComponent.css b/src/app/components/ConnectorStatusComponent.css new file mode 100644 index 00000000..2dc1d714 --- /dev/null +++ b/src/app/components/ConnectorStatusComponent.css @@ -0,0 +1,4 @@ +.connector-status_task-status-text .pf-v5-c-helper-text__item{ + /* text-align: center; */ + display: grid !important; +} \ No newline at end of file diff --git a/src/app/components/ConnectorStatusComponent.tsx b/src/app/components/ConnectorStatusComponent.tsx index 243dc1b6..bd28858b 100644 --- a/src/app/components/ConnectorStatusComponent.tsx +++ b/src/app/components/ConnectorStatusComponent.tsx @@ -1,4 +1,5 @@ -import { Label } from "@patternfly/react-core"; +import { getTaskStatus } from "@app/utils"; +import { HelperText, HelperTextItem, Label } from "@patternfly/react-core"; import { CheckCircleIcon, ExclamationCircleIcon, @@ -6,40 +7,64 @@ import { PauseCircleIcon, } from "@patternfly/react-icons"; import React from "react"; +import './ConnectorStatusComponent.css' interface ConnectorStatusComponentProps { status: string; + task?: boolean; } +type variantType = + | "success" + | "warning" + | "error" + | "default" + | "indeterminate" + | undefined; + export const ConnectorStatusComponent: React.FC< ConnectorStatusComponentProps -> = ({ status }) => { +> = ({ status, task }) => { let labelColor = undefined; + let variant = undefined as variantType; let icon: React.ReactNode; switch (status) { case "RUNNING": labelColor = "green"; + variant = "success"; icon = ; break; case "STOPPED": labelColor = "orange"; + variant = "warning"; icon = ; break; case "PAUSED": + variant = "warning"; labelColor = "blue"; icon = ; break; case "FAILED": case "DESTROYED": labelColor = "red"; + variant = "error"; icon = ; break; default: labelColor = "blue"; + variant = "success"; break; } + if (task) + return ( + + + {status} + + + ); return (