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!
Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

wb-process-state-name.js 843B

123456789101112131415161718192021222324252627
  1. //
  2. // Copyright (C) Stanislaw Adaszewski, 2020
  3. // Contact: s.adaszewski@gmail.com
  4. // Website: https://adared.ch/wba
  5. // License: GNU Affero General Public License, Version 3
  6. //
  7. function wbProcessStateName(containerRequest, container) {
  8. const cr = containerRequest;
  9. const c = container;
  10. if (!c)
  11. return cr.state;
  12. if (cr.state !== 'Uncommitted' && cr.priority === 0)
  13. return 'Cancelled';
  14. if (cr.state === 'Uncommitted' || !cr.container_uuid || c.state === 'Queued' || c.state === 'Locked')
  15. return 'Pending';
  16. if (c.state === 'Running')
  17. return 'Running';
  18. if (c.state === 'Complete' && c.exit_code === 0)
  19. return 'Complete';
  20. if (c.state === 'Complete' && c.exit_code !== 0)
  21. return 'Failed';
  22. if (c.state === 'Cancelled')
  23. return 'Cancelled';
  24. }
  25. export default wbProcessStateName;