import { h, Component } from 'preact'; import WBTable from 'wb-table'; import makeArvadosRequest from 'make-arvados-request'; import arvadosTypeName from 'arvados-type-name'; import arvadosObjectName from 'arvados-object-name'; import urlForObject from 'url-for-object'; import wbFormatDate from 'wb-format-date'; import WBNameAndUuid from 'wb-name-and-uuid'; import WBAccordion from 'wb-accordion'; import WBJsonViewer from 'wb-json-viewer'; class WBContainerRequestFields extends Component { componentDidMount() { this.prepareRows(); } componentWillReceiveProps(nextProps) { this.props = nextProps; this.prepareRows(); } prepareRows() { let { uuid, app } = this.props; let { arvHost, arvToken } = app.state; let item; let prom = makeArvadosRequest(arvHost, arvToken, '/arvados/v1/container_requests/' + uuid); prom = prom.then(xhr => (item = xhr.response)); prom = prom.then(() => { let rows = [ [ 'Name', item.name ], [ 'Description', item.description || ({ String(item.description) }) ], [ 'Properties', ( ) ], [ 'State', item.state ], [ 'Requesting Container', ( ) ], [ 'Container', ( ) ], [ 'Container Count Max', item.container_count_max ], [ 'Mounts', ( { Object.keys(item.mounts).map(k => ( )) } ) ], [ 'Runtime Constraints', ( ) ], [ 'Scheduling Parameters', ( ) ], [ 'Container Image', ( ) ], [ 'Environment', ( ) ], [ 'Working Directory', item.cwd ], [ 'Command', ( ) ], [ 'Output Path', item.output_path ], [ 'Output Name', item.output_name ], [ 'Output TTL', item.output_ttl ], [ 'Priority', item.priority ], [ 'Expires At', wbFormatDate(item.expires_at) ], [ 'Use Existing', String(item.use_existing) ], [ 'Log', ( ) ], [ 'Output', ( ) ], [ 'Filters', ( item.filters ? () : ({ String(item.filters) }) ) ], [ 'Runtime Token', item.runtime_token || ({ String(item.runtime_token) }) ], [ 'Runtime User', ( ) ], [ 'Runtime Auth Scopes', ( item.runtime_auth_scopes ? ( ) : ( { String(item.runtime_auth_scopes) } ) ) ] ]; rows = rows.map(r => [r[0], r[1] ? r[1] : ({ String(r[1]) })]); this.setState({ 'rows': rows }); }); } render({}, { rows }) { return ( rows ? ( ) : (
Loading...
) ); } } export default WBContainerRequestFields;