Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions console-extensions.json
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,24 @@
}
}
},
{
"type": "console.page/resource/details",
"flags": {
"required": [
"APPLICATION"
]
},
"properties": {
"model": {
"group": "argoproj.io",
"kind": "Application",
"version": "v1alpha1"
},
"component": {
"$codeRef": "ApplicationDetails"
}
}
},
{
"type": "console.page/resource/list",
"flags": {
Expand Down
1 change: 1 addition & 0 deletions plugin-metadata.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const metadata: ConsolePluginBuildMetadata = {
"gitopsFlags": "./components/utils/flags",
"topology": "./components/topology",
ApplicationList: "./gitops/components/application/ApplicationListTab.tsx",
ApplicationDetails: "./gitops/components/application/ApplicationNavPage.tsx",
ApplicationSetList: "./gitops/components/application/ApplicationSetListTab.tsx",
yamlApplicationTemplates: "./gitops/components/application/templates/index.ts"
}
Expand Down
14 changes: 9 additions & 5 deletions src/gitops/Revision/Revision.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,22 @@ interface RevisionProps {
repoURL: string;
revision: string;
helm: boolean;
revisionExtra?: string;
}

const Revision: React.FC<RevisionProps> = ({ repoURL, revision, helm }) => {
const Revision: React.FC<RevisionProps> = ({ repoURL, revision, helm, revisionExtra }) => {
if (revision) {
return (
<>
{!helm && (
<ExternalLink href={createRevisionURL(repoURL, revision)}>
({revision.substring(0, 7) || ''})
</ExternalLink>
<span>
<ExternalLink href={createRevisionURL(repoURL, revision)}>
({revision.substring(0, 7) || ''})
</ExternalLink>
{revisionExtra && revisionExtra}
</span>
)}
{helm && <span>{revision}</span>}
{helm && <span>({revision.substring(0, 7) || ''})</span>}
</>
);
} else {
Expand Down
48 changes: 48 additions & 0 deletions src/gitops/Statuses/HealthStatus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,11 @@ import {
HealthProgressingIcon,
HealthSuspendedIcon,
HealthUnknownIcon,
SpinningIcon,
} from 'src/gitops/utils/components/Icons/Icons';
import { HealthStatus as HS } from 'src/gitops/utils/constants';

import { COLORS } from '@gitops/components/shared/colors';
import { Button, Popover } from '@patternfly/react-core';

interface HealthProps {
Expand Down Expand Up @@ -64,4 +66,50 @@ const HealthStatus: React.FC<HealthProps> = ({ status, message }) => {
return <div>{showStatus}</div>;
};

export type HealthStatusCode =
| 'Unknown'
| 'Progressing'
| 'Healthy'
| 'Suspended'
| 'Degraded'
| 'Missing';

export interface HealthStatusModel {
status: HealthStatusCode;
message: string;
}

export const HealthStatusIcon = ({ status }: { status: HealthStatusCode }) => {
let color = COLORS.health.unknown;
let icon = 'fa-question-circle';

switch (status) {
case HS.HEALTHY:
color = COLORS.health.healthy;
icon = 'fa-heart';
break;
case HS.SUSPENDED:
color = COLORS.health.suspended;
icon = 'fa-pause-circle';
break;
case HS.DEGRADED:
color = COLORS.health.degraded;
icon = 'fa-heart-broken';
break;
case HS.PROGRESSING:
color = COLORS.health.progressing;
icon = `fa fa-circle-notch fa-spin`;
break;
case HS.MISSING:
color = COLORS.health.missing;
icon = 'fa-ghost';
break;
}
return icon.includes('fa-spin') ? (
<SpinningIcon color={color} title={status} />
) : (
<i title={status} className={'fa ' + icon + ' utils-health-status-icon'} style={{ color }} />
);
};

export default HealthStatus;
Loading