2018-01-20 00:46:47 -08:00
|
|
|
import Route from '@ember/routing/route';
|
|
|
|
import $ from 'jquery';
|
2017-02-13 11:39:52 -08:00
|
|
|
|
|
|
|
const listUrl = '/api/v1/list/flows';
|
|
|
|
const flowsPageBaseURL = '/api/v1/flows?size=10&page=';
|
|
|
|
|
2018-01-20 00:46:47 -08:00
|
|
|
export default Route.extend({
|
2017-02-13 11:39:52 -08:00
|
|
|
// maintains backwards compatibility with legacy code
|
|
|
|
// TODO: [DSS-6122] refactor so this may not be required
|
|
|
|
controllerName: 'flows',
|
|
|
|
|
2018-01-20 00:46:47 -08:00
|
|
|
setupController: function(controller, model) {
|
2017-02-13 11:39:52 -08:00
|
|
|
const flowsPageURL = `${flowsPageBaseURL}${model.page}`;
|
2018-01-20 00:46:47 -08:00
|
|
|
const breadcrumbs = [{ title: 'FLOWS_ROOT', urn: '1' }];
|
2017-02-13 11:39:52 -08:00
|
|
|
currentTab = 'Flows';
|
|
|
|
|
|
|
|
this.controller.set('flowView', true);
|
|
|
|
this.controller.set('queryParams', null);
|
|
|
|
|
2018-01-20 00:46:47 -08:00
|
|
|
$.get(listUrl, function(data) {
|
|
|
|
if (data && data.status === 'ok') {
|
2017-02-13 11:39:52 -08:00
|
|
|
// renderFlowListView(data.nodes);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
updateActiveTab();
|
|
|
|
|
|
|
|
$.get(flowsPageURL, data => {
|
2018-01-20 00:46:47 -08:00
|
|
|
if (data && data.status === 'ok') {
|
2017-02-13 11:39:52 -08:00
|
|
|
this.controller.set('model', data);
|
|
|
|
this.controller.set('jobView', false);
|
|
|
|
this.controller.set('flowView', true);
|
|
|
|
this.controller.set('breadcrumbs', breadcrumbs);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
});
|