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.

89 lines
2.6KB

  1. import { h, Component } from 'preact';
  2. import WBNavbarCommon from 'wb-navbar-common';
  3. import WBArvadosCrumbs from 'wb-arvados-crumbs';
  4. import makeArvadosRequest from 'make-arvados-request';
  5. import WBCommonFields from 'wb-common-fields';
  6. import WBContainerRequestFields from 'wb-container-request-fields';
  7. import WBProcessListing from 'wb-process-listing';
  8. import WBProcessDashboard from 'wb-process-dashboard';
  9. class WBProcessView extends Component {
  10. constructor(...args) {
  11. super(...args);
  12. this.state.objectUrls = [];
  13. }
  14. getUrl(props) {
  15. const page = ('page' in props ? props.page : this.props.page);
  16. return ('/process/' + this.props.uuid +
  17. (page ? '/' + page : ''));
  18. }
  19. fetchData() {
  20. let { arvHost, arvToken } = this.props.app.state;
  21. let prom = makeArvadosRequest(arvHost, arvToken,
  22. '/arvados/v1/container_requests/' + this.props.uuid);
  23. let req;
  24. let cont;
  25. prom = prom.then(xhr => {
  26. req = xhr.response;
  27. if (req.container_uuid) {
  28. let prom_1 = makeArvadosRequest(arvHost, arvToken,
  29. '/arvados/v1/containers/' + req.container_uuid);
  30. prom_1 = prom_1.then(xhr => (cont = xhr.response));
  31. return prom_1;
  32. }
  33. });
  34. prom = prom.then(() => {
  35. this.setState({
  36. 'request': req,
  37. 'container': cont
  38. });
  39. });
  40. }
  41. componentDidMount() {
  42. this.fetchData();
  43. }
  44. componentWillReceiveProps(nextProps) {
  45. this.props = nextProps;
  46. this.setState({ 'objectUrls': [], 'request': null, 'container': null });
  47. this.fetchData();
  48. }
  49. render({ app, uuid, page }, { container }) {
  50. return (
  51. <div>
  52. <WBNavbarCommon app={ app } />
  53. <WBArvadosCrumbs app={ app } uuid={ uuid } />
  54. <div class="my-2">
  55. This is the process view for { uuid }
  56. </div>
  57. <h2>Children Dashboard</h2>
  58. <WBProcessDashboard app={ app } parentProcessUuid={ uuid } lazy={ true } />
  59. <h2>Common Fields</h2>
  60. <WBCommonFields app={ app } uuid={ uuid } />
  61. <h2>Container Request Fields</h2>
  62. <WBContainerRequestFields app={ app } uuid={ uuid } />
  63. <h2>Children</h2>
  64. <WBProcessListing app={ app }
  65. appState={ app.state }
  66. requestingContainerUuid={ container ? container.uuid : null }
  67. waitForNextProps={ !container }
  68. itemsPerPage="20"
  69. activePage={ Number(page || 0) }
  70. getPageUrl={ page => this.getUrl({ page }) } />
  71. </div>
  72. );
  73. }
  74. }
  75. export default WBProcessView;