| @@ -26,30 +26,43 @@ class WBProcessListing extends Component { | |||||
| prepareRows(requests, containerLookup, ownerLookup, outputLookup) { | prepareRows(requests, containerLookup, ownerLookup, outputLookup) { | ||||
| const { renderRenameLink, renderDeleteButton } = this.props; | const { renderRenameLink, renderDeleteButton } = this.props; | ||||
| return requests.map(item => [ | |||||
| (<div> | |||||
| <div> | |||||
| <a href={ '/process/' + item['uuid'] }> | |||||
| { item['name'] } | |||||
| </a> { renderRenameLink(item, () => this.fetchItems()) } | |||||
| </div> | |||||
| <div>{ item['uuid'] }</div> | |||||
| </div>), | |||||
| ( <div> | |||||
| <div>{ item['state'] } /</div> | |||||
| <div>{ item.container_uuid ? | |||||
| item.container_uuid in containerLookup ? | |||||
| containerLookup[item.container_uuid].state : | |||||
| "Container Not Found" : | |||||
| <i>{ String(item.container_uuid) }</i> }</div> | |||||
| </div> ), | |||||
| ( <WBNameAndUuid uuid={ item['owner_uuid'] } lookup={ ownerLookup } /> ), | |||||
| wbFormatDate(item['created_at']), | |||||
| ( <WBNameAndUuid uuid={ item['output_uuid'] } lookup={ outputLookup } /> ), | |||||
| (<div> | |||||
| { renderDeleteButton(item, () => this.fetchItems()) } | |||||
| </div>) | |||||
| ]); | |||||
| return requests.map(item => { | |||||
| const container = item.container_uuid in containerLookup ? | |||||
| containerLookup[item.container_uuid] : null; | |||||
| const runtimeStatus = container ? container.runtime_status : null; | |||||
| const error = runtimeStatus ? runtimeStatus.error : null; | |||||
| const warning = runtimeStatus ? runtimeStatus.warning : null; | |||||
| return ( [ | |||||
| (<div> | |||||
| <div> | |||||
| <a href={ '/process/' + item['uuid'] }> | |||||
| { item['name'] } | |||||
| </a> { renderRenameLink(item, () => this.fetchItems()) } | |||||
| </div> | |||||
| <div>{ item['uuid'] }</div> | |||||
| </div>), | |||||
| ( <div> | |||||
| { item['state'] } / | |||||
| { item.container_uuid ? | |||||
| container ? | |||||
| container.state : | |||||
| "Container Not Found" : | |||||
| <i>{ String(item.container_uuid) }</i> } | |||||
| { !(error || warning) && container && container.state === 'Complete' ? " / Success" : null } | |||||
| { error ? [" / ", <a href={ '/container/' + container.uuid } | |||||
| title={ error }>E</a> ] : null } | |||||
| { warning ? [ " / ", <a href={ '/container/' + container.uuid } | |||||
| title={ warning }>W</a> ] : null } | |||||
| </div> ), | |||||
| ( <WBNameAndUuid uuid={ item['owner_uuid'] } lookup={ ownerLookup } /> ), | |||||
| wbFormatDate(item['created_at']), | |||||
| ( <WBNameAndUuid uuid={ item['output_uuid'] } lookup={ outputLookup } /> ), | |||||
| (<div> | |||||
| { renderDeleteButton(item, () => this.fetchItems()) } | |||||
| </div>) | |||||
| ] ); | |||||
| }); | |||||
| } | } | ||||
| fetchItems() { | fetchItems() { | ||||
| @@ -59,9 +72,10 @@ class WBProcessListing extends Component { | |||||
| requestingContainerUuid } = this.props; | requestingContainerUuid } = this.props; | ||||
| const filters = [ | const filters = [ | ||||
| [ 'state', 'in', requestStates.filter((_, idx) => reqStateMask[idx]) ], | |||||
| [ 'requesting_container_uuid', '=', requestingContainerUuid ] | [ 'requesting_container_uuid', '=', requestingContainerUuid ] | ||||
| ]; | ]; | ||||
| if (!reqStateMask.reduce((a, b) => a & b)) | |||||
| filters.push([ 'state', 'in', requestStates.filter((_, idx) => reqStateMask[idx]) ]); | |||||
| if (ownerUuid) | if (ownerUuid) | ||||
| filters.push([ 'owner_uuid', '=', ownerUuid ]); | filters.push([ 'owner_uuid', '=', ownerUuid ]); | ||||
| //if (requestingContainerUuid) | //if (requestingContainerUuid) | ||||