|
1234567891011121314151617181920 |
- function wbProcessStateName(containerRequest, container) {
- const cr = containerRequest;
- const c = container;
- if (!c)
- return cr.state;
- if (cr.state !== 'Uncommitted' && cr.priority === 0)
- return 'Cancelled';
- if (cr.state === 'Uncommitted' || !cr.container_uuid || c.state === 'Queued' || c.state === 'Locked')
- return 'Pending';
- if (c.state === 'Running')
- return 'Running';
- if (c.state === 'Complete' && c.exit_code === 0)
- return 'Complete';
- if (c.state === 'Complete' && c.exit_code !== 0)
- return 'Failed';
- if (c.state === 'Cancelled')
- return 'Cancelled';
- }
-
- export default wbProcessStateName;
|