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.

19 lines
610B

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