YARN-5912. Fix breadcrumb issues for various pages in new YARN UI. Contributed by Akhil P B.

This commit is contained in:
Sunil G 2017-02-14 22:29:21 +05:30
parent b9f8491252
commit 1fa084c425
15 changed files with 91 additions and 16 deletions

View File

@ -27,7 +27,7 @@ export default Ember.Controller.extend({
routeName: 'application' routeName: 'application'
},{ },{
text: "Applications", text: "Applications",
routeName: 'yarn-apps' routeName: 'yarn-apps.apps'
}, { }, {
text: `App [${appId}]`, text: `App [${appId}]`,
routeName: 'yarn-app', routeName: 'yarn-app',

View File

@ -27,7 +27,7 @@ export default Ember.Controller.extend({
routeName: 'application' routeName: 'application'
},{ },{
text: "Applications", text: "Applications",
routeName: 'yarn-apps' routeName: 'yarn-apps.apps'
}, { }, {
text: `App [${appId}]`, text: `App [${appId}]`,
routeName: 'yarn-app', routeName: 'yarn-app',

View File

@ -27,7 +27,7 @@ export default Ember.Controller.extend({
routeName: 'application' routeName: 'application'
},{ },{
text: "Applications", text: "Applications",
routeName: 'yarn-apps' routeName: 'yarn-apps.apps'
}, { }, {
text: `App [${appId}]`, text: `App [${appId}]`,
routeName: 'yarn-app', routeName: 'yarn-app',

View File

@ -25,7 +25,7 @@ export default Ember.Controller.extend({
routeName: 'application' routeName: 'application'
}, { }, {
text: "Applications", text: "Applications",
routeName: 'yarn-apps', routeName: 'yarn-apps.apps',
}] }]
}); });

View File

@ -26,12 +26,15 @@ export default Ember.Controller.extend({
return [{ return [{
text: "Home", text: "Home",
routeName: 'application' routeName: 'application'
}, {
text: "Nodes",
routeName: 'yarn-nodes.table'
}, { }, {
text: `Node [ ${nodeInfo.id} ]`, text: `Node [ ${nodeInfo.id} ]`,
href: `/#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`, href: `#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`,
}, { }, {
text: `Container [ ${containerInfo.id} ]`, text: `Container [ ${containerInfo.id} ]`,
href: `/#/yarn-node-container/${nodeInfo.id}/${nodeInfo.addr}/${containerInfo.id}`, href: `#/yarn-node-container/${nodeInfo.id}/${nodeInfo.addr}/${containerInfo.id}`,
}, { }, {
text: "Log", text: "Log",
}]; }];

View File

@ -26,10 +26,13 @@ export default Ember.Controller.extend({
text: "Home", text: "Home",
routeName: 'application' routeName: 'application'
}, { }, {
text: `Node [ ${nodeInfo.id} ]`, text: "Nodes",
href: `/#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`, routeName: 'yarn-nodes.table'
}, { }, {
text: "Application", text: `Node [ ${nodeInfo.id} ]`,
href: `#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`,
}, {
text: `Application [ ${nodeInfo.appId} ]`,
}]; }];
}) })

View File

@ -30,7 +30,7 @@ export default Ember.Controller.extend({
routeName: 'yarn-nodes.table' routeName: 'yarn-nodes.table'
}, { }, {
text: `Node [ ${nodeInfo.id} ]`, text: `Node [ ${nodeInfo.id} ]`,
href: `/#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`, href: `#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`
}, { }, {
text: "Applications", text: "Applications",
}]; }];

View File

@ -0,0 +1,39 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import Ember from 'ember';
export default Ember.Controller.extend({
breadcrumbs: Ember.computed("model.nodeInfo", function () {
var nodeInfo = this.get("model.nodeInfo");
return [{
text: "Home",
routeName: 'application'
},{
text: "Nodes",
routeName: 'yarn-nodes.table'
}, {
text: `Node [ ${nodeInfo.id} ]`,
href: `#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`
}, {
text: `Container [ ${nodeInfo.containerId} ]`
}];
})
});

View File

@ -30,7 +30,7 @@ export default Ember.Controller.extend({
routeName: 'yarn-nodes.table' routeName: 'yarn-nodes.table'
}, { }, {
text: `Node [ ${nodeInfo.id} ]`, text: `Node [ ${nodeInfo.id} ]`,
href: `/#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`, href: `#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`
}, { }, {
text: "Containers", text: "Containers",
}]; }];

View File

@ -30,7 +30,7 @@ export default Ember.Controller.extend({
routeName: 'yarn-nodes.table' routeName: 'yarn-nodes.table'
}, { }, {
text: `Node [ ${nodeInfo.id} ]`, text: `Node [ ${nodeInfo.id} ]`,
href: `/#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`, href: `#/yarn-node/${nodeInfo.id}/${nodeInfo.addr}`,
}]; }];
}) })

View File

@ -25,7 +25,7 @@ export default Ember.Controller.extend({
routeName: 'application' routeName: 'application'
}, { }, {
text: "Applications", text: "Applications",
routeName: 'yarn-apps', routeName: 'yarn-apps.apps',
}, { }, {
text: "Long Running Services", text: "Long Running Services",
routeName: 'yarn-services', routeName: 'yarn-services',

View File

@ -54,7 +54,7 @@ export default DS.Model.extend({
applicationExpiryTime: DS.attr('string'), applicationExpiryTime: DS.attr('string'),
isFailed: function() { isFailed: function() {
return this.get('finalStatus') == "FAILED"; return this.get('finalStatus') === "FAILED";
}.property("finalStatus"), }.property("finalStatus"),
validatedFinishedTs: function() { validatedFinishedTs: function() {

View File

@ -25,7 +25,7 @@ export default AbstractRoute.extend({
return Ember.RSVP.hash({ return Ember.RSVP.hash({
nodeApp: this.store.queryRecord('yarn-node-app', nodeApp: this.store.queryRecord('yarn-node-app',
{ nodeAddr : param.node_addr, appId: param.app_id }), { nodeAddr : param.node_addr, appId: param.app_id }),
nodeInfo: { id: param.node_id, addr: param.node_addr } nodeInfo: { id: param.node_id, addr: param.node_addr, appId: param.app_id }
}); });
}, },

View File

@ -26,7 +26,7 @@ export default AbstractRoute.extend({
return Ember.RSVP.hash({ return Ember.RSVP.hash({
nodeContainer: this.store.queryRecord('yarn-node-container', nodeContainer: this.store.queryRecord('yarn-node-container',
{ nodeHttpAddr: param.node_addr, containerId: param.container_id }), { nodeHttpAddr: param.node_addr, containerId: param.container_id }),
nodeInfo: { id: param.node_id, addr: param.node_addr } nodeInfo: { id: param.node_id, addr: param.node_addr, containerId: param.container_id }
}); });
}, },

View File

@ -0,0 +1,30 @@
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { moduleFor, test } from 'ember-qunit';
moduleFor('controller:yarn-node-container', 'Unit | Controller | yarn node container', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
});