mirror of
https://github.com/ansible/awx.git
synced 2026-04-14 06:29:25 -02:30
Update status label to reflect instance node states.
This commit is contained in:
@@ -22,6 +22,13 @@ const colors = {
|
|||||||
disabled: gray,
|
disabled: gray,
|
||||||
canceled: orange,
|
canceled: orange,
|
||||||
changed: orange,
|
changed: orange,
|
||||||
|
/* Instance statuses */
|
||||||
|
ready: green,
|
||||||
|
installed: blue,
|
||||||
|
provisioning: gray,
|
||||||
|
deprovisioning: gray,
|
||||||
|
'provision-fail': red,
|
||||||
|
'deprovision-fail': red,
|
||||||
};
|
};
|
||||||
|
|
||||||
function StatusIcon({ status, ...props }) {
|
function StatusIcon({ status, ...props }) {
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import {
|
|||||||
ClockIcon,
|
ClockIcon,
|
||||||
MinusCircleIcon,
|
MinusCircleIcon,
|
||||||
InfoCircleIcon,
|
InfoCircleIcon,
|
||||||
|
PlusCircleIcon,
|
||||||
} from '@patternfly/react-icons';
|
} from '@patternfly/react-icons';
|
||||||
|
|
||||||
const Spin = keyframes`
|
const Spin = keyframes`
|
||||||
@@ -40,5 +41,12 @@ const icons = {
|
|||||||
skipped: MinusCircleIcon,
|
skipped: MinusCircleIcon,
|
||||||
canceled: ExclamationTriangleIcon,
|
canceled: ExclamationTriangleIcon,
|
||||||
changed: ExclamationTriangleIcon,
|
changed: ExclamationTriangleIcon,
|
||||||
|
/* Instance statuses */
|
||||||
|
ready: CheckCircleIcon,
|
||||||
|
installed: ClockIcon,
|
||||||
|
provisioning: PlusCircleIcon,
|
||||||
|
deprovisioning: MinusCircleIcon,
|
||||||
|
'provision-fail': ExclamationCircleIcon,
|
||||||
|
'deprovision-fail': ExclamationCircleIcon,
|
||||||
};
|
};
|
||||||
export default icons;
|
export default icons;
|
||||||
|
|||||||
@@ -24,6 +24,13 @@ const colors = {
|
|||||||
disabled: 'grey',
|
disabled: 'grey',
|
||||||
canceled: 'orange',
|
canceled: 'orange',
|
||||||
changed: 'orange',
|
changed: 'orange',
|
||||||
|
/* Instance statuses */
|
||||||
|
ready: 'green',
|
||||||
|
installed: 'blue',
|
||||||
|
provisioning: 'gray',
|
||||||
|
deprovisioning: 'gray',
|
||||||
|
'provision-fail': 'red',
|
||||||
|
'deprovision-fail': 'red',
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function StatusLabel({ status, tooltipContent = '', children }) {
|
export default function StatusLabel({ status, tooltipContent = '', children }) {
|
||||||
@@ -45,6 +52,13 @@ export default function StatusLabel({ status, tooltipContent = '', children }) {
|
|||||||
disabled: t`Disabled`,
|
disabled: t`Disabled`,
|
||||||
canceled: t`Canceled`,
|
canceled: t`Canceled`,
|
||||||
changed: t`Changed`,
|
changed: t`Changed`,
|
||||||
|
/* Instance statuses */
|
||||||
|
ready: t`Ready`,
|
||||||
|
installed: t`Installed`,
|
||||||
|
provisioning: t`Provisioning`,
|
||||||
|
deprovisioning: t`Deprovisioning`,
|
||||||
|
'provision-fail': t`Provisioning fail`,
|
||||||
|
'deprovision-fail': t`Deprovisioning fail`,
|
||||||
};
|
};
|
||||||
const label = upperCaseStatus[status] || status;
|
const label = upperCaseStatus[status] || status;
|
||||||
const color = colors[status] || 'grey';
|
const color = colors[status] || 'grey';
|
||||||
@@ -88,5 +102,11 @@ StatusLabel.propTypes = {
|
|||||||
'disabled',
|
'disabled',
|
||||||
'canceled',
|
'canceled',
|
||||||
'changed',
|
'changed',
|
||||||
|
'ready',
|
||||||
|
'installed',
|
||||||
|
'provisioning',
|
||||||
|
'deprovisioning',
|
||||||
|
'provision-fail',
|
||||||
|
'deprovision-fail',
|
||||||
]).isRequired,
|
]).isRequired,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ function InstanceListItem({
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StatusLabel status={instance.errors ? 'error' : 'healthy'} />
|
<StatusLabel status={instance.node_state} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Td>
|
</Td>
|
||||||
<Td dataLabel={t`Node Type`}>{instance.node_type}</Td>
|
<Td dataLabel={t`Node Type`}>{instance.node_type}</Td>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@ function InstanceListItem({
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StatusLabel status={instance.errors ? 'error' : 'healthy'} />
|
<StatusLabel status={instance.node_state} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Td>
|
</Td>
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ function InstancePeerListItem({
|
|||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<StatusLabel status={peerInstance.errors ? 'error' : 'healthy'} />
|
<StatusLabel status={peerInstance.node_state} />
|
||||||
</Tooltip>
|
</Tooltip>
|
||||||
</Td>
|
</Td>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user