|
123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- import { h, Component } from 'preact';
- import WBTable from 'wb-table';
- import WBBreadcrumbs from 'wb-breadcrumbs';
- import { WBManifestReader } from 'wb-collection-manifest';
- import makeArvadosRequest from 'make-arvados-request';
-
- class WBCollectionContent extends Component {
- constructor(...args) {
- super(...args);
- this.state.path = '.';
- this.state.rows = [];
- this.state.manifestReader = null;
- }
-
- componentDidMount() {
- let { arvHost, arvToken } = this.props.app.state;
- let { uuid } = this.props;
-
- let select = [ 'manifest_text' ];
- let prom = makeArvadosRequest(arvHost, arvToken,
- '/arvados/v1/collections/' + uuid +
- '?select=' + encodeURIComponent(JSON.stringify(select)));
- prom = prom.then(xhr => {
- this.state.manifestReader = new WBManifestReader(xhr.response.manifest_text);
- this.prepareRows();
- });
- }
-
- prepareRows() {
- this.setState({});
- }
-
- render({}, { rows }) {
- return (
- <div>
- <WBBreadcrumbs items={ [ 'a', 'b', 'c' ] } />
-
- <WBTable columns={ [ 'Name', 'Size', 'Actions' ] }
- rows={ rows } />
- </div>
- );
- }
- }
-
- export default WBCollectionContent;
|