mirror of
https://github.com/open-metadata/OpenMetadata.git
synced 2025-08-04 23:28:16 +00:00
Make changes for live updates for collate AI agents
This commit is contained in:
parent
c5aecb30e0
commit
c23a19a262
@ -42,7 +42,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.collate-agent.ant-card.ant-card-bordered {
|
.collate-agent.ant-card.ant-card-bordered {
|
||||||
border-color: @blue-32;
|
border-color: @blue-39;
|
||||||
background-color: @blue-33;
|
background-color: @blue-33;
|
||||||
|
|
||||||
.agent-icon-container {
|
.agent-icon-container {
|
||||||
|
@ -11,7 +11,12 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
import { NO_RUNS_STATUS } from '../../constants/ServiceInsightsTab.constants';
|
||||||
import { App } from '../../generated/entity/applications/app';
|
import { App } from '../../generated/entity/applications/app';
|
||||||
|
import {
|
||||||
|
AppRunRecord,
|
||||||
|
Status,
|
||||||
|
} from '../../generated/entity/applications/appRunRecord';
|
||||||
import {
|
import {
|
||||||
IngestionPipeline,
|
IngestionPipeline,
|
||||||
PipelineState,
|
PipelineState,
|
||||||
@ -59,6 +64,12 @@ export interface AgentsLiveInfo
|
|||||||
status: PipelineState;
|
status: PipelineState;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface CollateAgentLiveInfo
|
||||||
|
extends Pick<AppRunRecord, 'appName' | 'appId' | 'timestamp'> {
|
||||||
|
displayName: string;
|
||||||
|
status: Status | typeof NO_RUNS_STATUS;
|
||||||
|
}
|
||||||
|
|
||||||
export interface TotalAssetsCount {
|
export interface TotalAssetsCount {
|
||||||
name: string;
|
name: string;
|
||||||
value: number;
|
value: number;
|
||||||
|
@ -240,7 +240,10 @@ const ServiceInsightsTab = ({
|
|||||||
);
|
);
|
||||||
|
|
||||||
setAgentsInfo(
|
setAgentsInfo(
|
||||||
getFormattedAgentsListFromAgentsLiveInfo(data.ingestionPipelineStatus)
|
getFormattedAgentsListFromAgentsLiveInfo(
|
||||||
|
data.ingestionPipelineStatus,
|
||||||
|
data.appStatus
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
setTotalAssetsCount(
|
setTotalAssetsCount(
|
||||||
|
@ -35,3 +35,4 @@ export const LIVE_CHARTS_LIST = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
export const SERVICE_INSIGHTS_WORKFLOW_DEFINITION_NAME = 'AutoPilotWorkflow';
|
export const SERVICE_INSIGHTS_WORKFLOW_DEFINITION_NAME = 'AutoPilotWorkflow';
|
||||||
|
export const NO_RUNS_STATUS = 'NO_RUNS';
|
||||||
|
@ -25,7 +25,10 @@ import { ReactComponent as ProfilerIcon } from '../assets/svg/ic-stack-search.sv
|
|||||||
|
|
||||||
import { groupBy, isEmpty, isUndefined, reduce } from 'lodash';
|
import { groupBy, isEmpty, isUndefined, reduce } from 'lodash';
|
||||||
import { AgentsInfo } from '../components/ServiceInsights/AgentsStatusWidget/AgentsStatusWidget.interface';
|
import { AgentsInfo } from '../components/ServiceInsights/AgentsStatusWidget/AgentsStatusWidget.interface';
|
||||||
import { AgentsLiveInfo } from '../components/ServiceInsights/ServiceInsightsTab.interface';
|
import {
|
||||||
|
AgentsLiveInfo,
|
||||||
|
CollateAgentLiveInfo,
|
||||||
|
} from '../components/ServiceInsights/ServiceInsightsTab.interface';
|
||||||
import {
|
import {
|
||||||
AUTOPILOT_AGENTS_ORDERED_LIST,
|
AUTOPILOT_AGENTS_ORDERED_LIST,
|
||||||
AUTOPILOT_AGENTS_STATUS_ORDERED_LIST,
|
AUTOPILOT_AGENTS_STATUS_ORDERED_LIST,
|
||||||
@ -35,6 +38,7 @@ import {
|
|||||||
COLLATE_DATA_QUALITY_APP_NAME,
|
COLLATE_DATA_QUALITY_APP_NAME,
|
||||||
COLLATE_DOCUMENTATION_APP_NAME,
|
COLLATE_DOCUMENTATION_APP_NAME,
|
||||||
} from '../constants/Applications.constant';
|
} from '../constants/Applications.constant';
|
||||||
|
import { NO_RUNS_STATUS } from '../constants/ServiceInsightsTab.constants';
|
||||||
import { AgentStatus } from '../enums/ServiceInsights.enum';
|
import { AgentStatus } from '../enums/ServiceInsights.enum';
|
||||||
import { App } from '../generated/entity/applications/app';
|
import { App } from '../generated/entity/applications/app';
|
||||||
import {
|
import {
|
||||||
@ -122,7 +126,7 @@ export const getAgentIconFromType = (agentType: string) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getAgentStatusLabelFromStatus = (
|
export const getAgentStatusLabelFromStatus = (
|
||||||
status?: PipelineState | Status
|
status?: PipelineState | Status | typeof NO_RUNS_STATUS
|
||||||
) => {
|
) => {
|
||||||
switch (status) {
|
switch (status) {
|
||||||
case PipelineState.Success:
|
case PipelineState.Success:
|
||||||
@ -141,6 +145,7 @@ export const getAgentStatusLabelFromStatus = (
|
|||||||
return AgentStatus.Running;
|
return AgentStatus.Running;
|
||||||
case PipelineState.Queued:
|
case PipelineState.Queued:
|
||||||
case Status.Pending:
|
case Status.Pending:
|
||||||
|
case NO_RUNS_STATUS:
|
||||||
default:
|
default:
|
||||||
return AgentStatus.Pending;
|
return AgentStatus.Pending;
|
||||||
}
|
}
|
||||||
@ -196,19 +201,47 @@ export const getFormattedAgentsList = (
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getFormattedAgentsListFromAgentsLiveInfo = (
|
export const getFormattedAgentsListFromAgentsLiveInfo = (
|
||||||
agentsLiveInfo: AgentsLiveInfo[]
|
agentsLiveInfo: AgentsLiveInfo[],
|
||||||
|
collateAIagentsLiveInfo: CollateAgentLiveInfo[]
|
||||||
): AgentsInfo[] => {
|
): AgentsInfo[] => {
|
||||||
const filteredAgentsList = agentsLiveInfo.filter(
|
const filteredAgentsList = agentsLiveInfo.filter(
|
||||||
(agent) => agent.provider === ProviderType.Automation
|
(agent) => agent.provider === ProviderType.Automation
|
||||||
);
|
);
|
||||||
|
|
||||||
return filteredAgentsList.map((agent) => ({
|
const formattedAgentsList = filteredAgentsList.map((agent) => ({
|
||||||
agentIcon: getAgentIconFromType(agent.pipelineType),
|
agentIcon: getAgentIconFromType(agent.pipelineType),
|
||||||
agentType: agent.pipelineType,
|
agentType: agent.pipelineType,
|
||||||
isCollateAgent: false,
|
isCollateAgent: false,
|
||||||
label: getAgentLabelFromType(agent.pipelineType),
|
label: getAgentLabelFromType(agent.pipelineType),
|
||||||
status: getAgentStatusLabelFromStatus(agent.status),
|
status: getAgentStatusLabelFromStatus(agent.status),
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
const collateAIagents = collateAIagentsLiveInfo.map((agent) => ({
|
||||||
|
agentIcon: getAgentIconFromType(agent.appName ?? ''),
|
||||||
|
agentType: agent.appName ?? '',
|
||||||
|
isCollateAgent: true,
|
||||||
|
label: getAgentLabelFromType(agent.appName ?? ''),
|
||||||
|
status: getAgentStatusLabelFromStatus(agent.status),
|
||||||
|
}));
|
||||||
|
|
||||||
|
const allAgentsList: AgentsInfo[] = [
|
||||||
|
...formattedAgentsList,
|
||||||
|
...collateAIagents,
|
||||||
|
];
|
||||||
|
|
||||||
|
const orderedAgentsList = reduce(
|
||||||
|
AUTOPILOT_AGENTS_ORDERED_LIST,
|
||||||
|
(acc, agentType) => {
|
||||||
|
const agent = allAgentsList.find(
|
||||||
|
(agent) => agent.agentType === agentType
|
||||||
|
);
|
||||||
|
|
||||||
|
return [...acc, ...(isUndefined(agent) ? [] : [agent])];
|
||||||
|
},
|
||||||
|
[] as AgentsInfo[]
|
||||||
|
);
|
||||||
|
|
||||||
|
return orderedAgentsList;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAgentStatusSummary = (agentsList: AgentsInfo[]) => {
|
export const getAgentStatusSummary = (agentsList: AgentsInfo[]) => {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user