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