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!
Selaa lähdekoodia

Started implementing WBProcessDashboard.

pull/1/head
Stanislaw Adaszewski 4 vuotta sitten
vanhempi
commit
f318afe8bf
1 muutettua tiedostoa jossa 56 lisäystä ja 0 poistoa
  1. +56
    -0
      frontend/src/js/component/wb-process-dashboard.js

+ 56
- 0
frontend/src/js/component/wb-process-dashboard.js Näytä tiedosto

@@ -0,0 +1,56 @@
import { h, Component } from 'preact';
import makeArvadosRequest from 'make-arvados-request';
function getAll(makeRequest) {
let prom = makeRequest(0);
prom = prom.then(xhr => {
const { items, limit, items_available } = xhr.response;
let res = [].concat(items);
let prom_1 = new Promise(accept => accept());
for (let ofs = limit; ofs < items_available; ofs += limit) {
prom_1 = prom_1.then(() => makeRequest(ofs));
prom_1 = prom_1.then(xhr_1 => {
res = res.concat(xhr_1.response.items);
});
}
prom_1 = prom_1.then(() => res);
return prom_1;
});
return prom;
}
class WBProcessDashboard extends Component {
fetchData() {
const { app, uuid } = this.props;
const { arvHost, arvToken } = app.state;
let prom = new Promise(accept => accept());
if (uuid) {
prom = prom.then(() => {
return makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/container_requests/' + encodeURIComponent(uuid));
});
prom = prom.then(xhr => {
const cr = xhr.response;
return makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/containers/' + encodeURIComponent(cr.container_uuid));
});
prom = prom.then(xhr => {
const c = xhr.response;
const filters = [ [ 'requesting_container_uuid', '=', c.uuid ] ];
return makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/container_requests?filters=' +
encodeURIComponent(JSON.stringify(filters)));
});
} else {
prom = prom.then(() => {
return makeArvadosRequest(arvHost, arvToken,
'/arvados/v1/container_requests');
});
}
}
render() {
}
}

Loading…
Peruuta
Tallenna