diff --git a/web/public/javascripts/routers/flows.js b/web/public/javascripts/routers/flows.js index 9ee52dfbc3..109294162a 100644 --- a/web/public/javascripts/routers/flows.js +++ b/web/public/javascripts/routers/flows.js @@ -42,6 +42,43 @@ App.FlowsRoute = Ember.Route.extend({ } }); +App.FlowspageRoute = Ember.Route.extend({ + setupController: function(controller) { + currentTab = 'Flows'; + var listUrl = 'api/v1/list/flows'; + $.get(listUrl, function(data) { + if (data && data.status == "ok"){ + renderFlowListView(data.nodes); + } + }); + updateActiveTab(); + var url = 'api/v1/flows?size=10&page=1'; + var breadcrumbs = [{"title": 'FLOWS_ROOT', "urn": "page/1"}]; + $.get(url, function(data) { + if (data && data.status == "ok"){ + flowsController.set('model', data); + flowsController.set('projectView', true); + flowsController.set('flowView', false); + flowsController.set('breadcrumbs', breadcrumbs); + flowsController.set('urn', 'FLOWS_ROOT'); + flowsController.set('projectView', true); + flowsController.set('flowView', false); + flowsController.set('jobView', false); + } + }); + var watcherEndpoint = "/api/v1/urn/watch?urn=FLOWS_ROOT"; + $.get(watcherEndpoint, function(data){ + if(data.id && data.id !== 0) { + flowsController.set('urnWatched', true) + flowsController.set('urnWatchedId', data.id) + } else { + flowsController.set('urnWatched', false) + flowsController.set('urnWatchedId', 0) + } + }); + } +}); + App.PagedapplicationRoute = Ember.Route.extend({ setupController: function(controller, params, transition) { currentTab = 'Flows'; diff --git a/web/public/javascripts/routers/router.js b/web/public/javascripts/routers/router.js index c1734c8e06..5ceb0e03a5 100644 --- a/web/public/javascripts/routers/router.js +++ b/web/public/javascripts/routers/router.js @@ -219,7 +219,7 @@ function updateActiveTab() obj.removeClass("active"); } - if (currentTab == 'Metric') + if (currentTab == 'Metrics') { $('#menutabs a:eq(1)').tab("show"); $('#metriclink').addClass("active"); @@ -421,11 +421,16 @@ var scrollToTreeNode = function() { } $('.category-header a').click(function (e) { - if (currentTab == this.text) + var text = 'Datasets'; + if (this && this.children && this.children.length > 0 && this.children[0] && this.children[0].textContent) + { + text = this.children[0].textContent; + } + if (currentTab == text) return; - currentTab = this.text; + currentTab = text; updateActiveTab(); - if (this.text == 'Datasets') + if (text == 'Datasets') { var node = $("#tree2").fancytree("getActiveNode"); if (node) @@ -435,7 +440,7 @@ $('.category-header a').click(function (e) { } window.location = "#/datasets/page/1"; } - else if (this.text == 'Metric') + else if (text == 'Metrics') { var node = $("#tree1").fancytree("getActiveNode"); if (node) @@ -445,7 +450,7 @@ $('.category-header a').click(function (e) { } window.location = "#/metrics/page/1"; } - else if (this.text == 'Flows') + else if (text == 'Flows') { var node = $("#tree3").fancytree("getActiveNode"); if (node)