IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an email to s dot adaszewski at gmail dot com. User accounts are meant only to report issues and/or generate pull requests. This is a purpose-specific Git hosting for ADARED projects. Thank you for your understanding!
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
659B

  1. function wbProcessStateName(containerRequest, container) {
  2. const cr = containerRequest;
  3. const c = container;
  4. if (!c)
  5. return cr.state;
  6. if (cr.state !== 'Uncommitted' && cr.priority === 0)
  7. return 'Cancelled';
  8. if (cr.state === 'Uncommitted' || !cr.container_uuid || c.state === 'Queued' || c.state === 'Locked')
  9. return 'Pending';
  10. if (c.state === 'Running')
  11. return 'Running';
  12. if (c.state === 'Complete' && c.exit_code === 0)
  13. return 'Complete';
  14. if (c.state === 'Complete' && c.exit_code !== 0)
  15. return 'Failed';
  16. if (c.state === 'Cancelled')
  17. return 'Cancelled';
  18. }
  19. export default wbProcessStateName;