YARN-5019. [YARN-3368] Change urls in new YARN ui from camel casing to hyphens. (Sunil G via wangda)

This commit is contained in:
Wangda Tan 2016-05-09 11:29:59 -07:00
parent dea4a296e5
commit 2c4f164e16
28 changed files with 66 additions and 66 deletions

View File

@ -126,7 +126,7 @@ export default Ember.Component.extend({
.attr("transform", function(d) { return "translate(" + source.y0 + "," + source.x0 + ")"; })
.on("click", function(d,i){
if (d.queueData.get("name") != this.get("selected")) {
document.location.href = "yarnQueue/" + d.queueData.get("name");
document.location.href = "yarn-queue/" + d.queueData.get("name");
}
}.bind(this));
// .on("click", click);
@ -176,7 +176,7 @@ export default Ember.Component.extend({
.attr("r", 20)
.attr("href",
function(d) {
return "yarnQueues/" + d.queueData.get("name");
return "yarn-queues/" + d.queueData.get("name");
})
.style("stroke", function(d) {
if (d.queueData.get("name") == this.get("selected")) {

View File

@ -29,25 +29,25 @@ export default Ember.Controller.extend({
outputMainMenu: function(){
var path = this.get('currentPath');
var html = '<li';
if (path == 'yarnQueue') {
if (path == 'yarn-queue') {
html = html + ' class="active"';
}
html = html + '><a href="yarnQueue/root">Queues<span class="sr-only">' +
html = html + '><a href="yarn-queue/root">Queues<span class="sr-only">' +
'(current)</span></a></li><li';
if (path.lastIndexOf('yarnApp', 0) == 0) {
if (path.lastIndexOf('yarn-app', 0) == 0) {
html = html + ' class="active"';
}
html = html + '><a href="yarnApps">Applications<span class="sr-only">' +
html = html + '><a href="yarn-apps">Applications<span class="sr-only">' +
'(current)</span></a></li><li';
if (path == 'clusterOverview') {
if (path == 'cluster-overview') {
html = html + ' class="active"';
}
html = html + '><a href="clusterOverview">Cluster Overview<span class=' +
html = html + '><a href="cluster-overview">Cluster Overview<span class=' +
'"sr-only">(current)</span></a></li><li';
if (path.lastIndexOf('yarnNode', 0) == 0) {
if (path.lastIndexOf('yarn-node', 0) == 0) {
html = html + ' class="active"';
}
html = html + '><a href="yarnNodes">Nodes<span class="sr-only">' +
html = html + '><a href="yarn-nodes">Nodes<span class="sr-only">' +
'(current)</span></a></li>';
return Ember.String.htmlSafe(html);
}.property('currentPath')

View File

@ -36,7 +36,7 @@ export default Ember.Helper.helper(function(params,hash) {
var html = '<td>';
var logFilesCommaSeparated = "";
for (var i = 0; i < logFilesLen; i++) {
html = html + '<a href="yarnContainerLog/' + nodeId + '/' +
html = html + '<a href="yarn-container-log/' + nodeId + '/' +
nodeAddr + '/' + containerId + '/' + logFiles[i] + '">' + logFiles[i] +
'</a>';
if (i != logFilesLen - 1) {

View File

@ -29,7 +29,7 @@ export default Ember.Helper.helper(function(params,hash) {
if (nodeState == "SHUTDOWN" || nodeState == "LOST") {
html = html + nodeHTTPAddress;
} else {
html = html + '<a href="yarnNode/' + nodeId + "/" + nodeHTTPAddress + '">' +
html = html + '<a href="yarn-node/' + nodeId + "/" + nodeHTTPAddress + '">' +
nodeHTTPAddress + '</a>';
}
html = html + '</td>';

View File

@ -47,20 +47,20 @@ export default Ember.Helper.helper(function(params,hash) {
'<div class="panel-heading"><h4>Node Manager<br>(' + normalizedNodeId + ')</h4></div>'+
'<div class="panel-body"><ul class="nav nav-pills nav-stacked" id="stacked-menu">' +
'<ul class="nav nav-pills nav-stacked collapse in"><li';
if (hash.path == 'yarnNode') {
if (hash.path == 'yarn-node') {
html = html + ' class="active"';
}
html = html + '><a href="yarnNode/' + hash.nodeId + '/' + hash.nodeAddr +
html = html + '><a href="yarn-node/' + hash.nodeId + '/' + hash.nodeAddr +
'">Node Information</a></li><li';
if (hash.path == 'yarnNodeApps') {
if (hash.path == 'yarn-node-apps') {
html = html + ' class="active"';
}
html = html + '><a href="yarnNodeApps/' + hash.nodeId + '/' + hash.nodeAddr +
html = html + '><a href="yarn-node-apps/' + hash.nodeId + '/' + hash.nodeAddr +
'">List of Applications</a></li><li';
if (hash.path == 'yarnNodeContainers') {
if (hash.path == 'yarn-node-containers') {
html = html + ' class="active"';
}
html = html + '><a href="yarnNodeContainers/' +hash.nodeId + '/' + hash.nodeAddr +
html = html + '><a href="yarn-node-containers/' +hash.nodeId + '/' + hash.nodeAddr +
'">List of Containers</a></li></ul></ul></div>';
return Ember.String.htmlSafe(html);
});

View File

@ -57,6 +57,6 @@ export default DS.Model.extend({
}.property(),
link: function() {
return "/yarnAppAttempt/" + this.get("id");
return "/yarn-app-attempt/" + this.get("id");
}.property(),
});

View File

@ -24,22 +24,22 @@ var Router = Ember.Router.extend({
});
Router.map(function() {
this.route('yarnApps');
this.route('yarnNodes');
this.route('yarnNode', { path: '/yarnNode/:node_id/:node_addr' });
this.route('yarnNodeApps', { path: '/yarnNodeApps/:node_id/:node_addr' });
this.route('yarnNodeApp',
{ path: '/yarnNodeApp/:node_id/:node_addr/:app_id' });
this.route('yarnNodeContainers',
{ path: '/yarnNodeContainers/:node_id/:node_addr' });
this.route('yarnNodeContainer',
{ path: '/yarnNodeContainer/:node_id/:node_addr/:container_id' });
this.route('yarnContainerLog', { path:
'/yarnContainerLog/:node_id/:node_addr/:container_id/:filename' });
this.route('yarnQueue', { path: '/yarnQueue/:queue_name' });
this.route('clusterOverview');
this.route('yarnApp', { path: '/yarnApp/:app_id' });
this.route('yarnAppAttempt', { path: '/yarnAppAttempt/:app_attempt_id'});
this.route('yarn-apps');
this.route('yarn-nodes');
this.route('yarn-node', { path: '/yarn-node/:node_id/:node_addr' });
this.route('yarn-node-apps', { path: '/yarn-node-apps/:node_id/:node_addr' });
this.route('yarn-node-app',
{ path: '/yarn-node-app/:node_id/:node_addr/:app_id' });
this.route('yarn-node-containers',
{ path: '/yarn-node-containers/:node_id/:node_addr' });
this.route('yarn-node-container',
{ path: '/yarn-node-container/:node_id/:node_addr/:container_id' });
this.route('yarn-container-log', { path:
'/yarn-container-log/:node_id/:node_addr/:container_id/:filename' });
this.route('yarn-queue', { path: '/yarn-queue/:queue_name' });
this.route('cluster-overview');
this.route('yarn-app', { path: '/yarn-app/:app_id' });
this.route('yarn-app-attempt', { path: '/yarn-app-attempt/:app_attempt_id'});
this.route('error');
this.route('notfound', { path: '*:' });
});

View File

@ -23,7 +23,7 @@ export default Ember.Route.extend({
* Redirect root URL to cluster overview page.
*/
beforeModel: function() {
this.replaceWith('clusterOverview');
this.replaceWith('cluster-overview');
}
});

View File

@ -21,15 +21,15 @@ import Ember from 'ember';
export default Ember.Route.extend({
model(param) {
return Ember.RSVP.hash({
attempt: this.store.findRecord('yarnAppAttempt', param.app_attempt_id),
attempt: this.store.findRecord('yarn-app-attempt', param.app_attempt_id),
rmContainers: this.store.query('yarnContainer',
rmContainers: this.store.query('yarn-container',
{
app_attempt_id: param.app_attempt_id,
is_rm: true
}),
tsContainers: this.store.query('yarnContainer',
tsContainers: this.store.query('yarn-container',
{
app_attempt_id: param.app_attempt_id,
is_rm: false

View File

@ -21,8 +21,8 @@ import Ember from 'ember';
export default Ember.Route.extend({
model(param) {
return Ember.RSVP.hash({
app: this.store.find('yarnApp', param.app_id),
attempts: this.store.query('yarnAppAttempt', { appId: param.app_id})
app: this.store.find('yarn-app', param.app_id),
attempts: this.store.query('yarn-app-attempt', { appId: param.app_id})
});
}
});

View File

@ -20,7 +20,7 @@ import Ember from 'ember';
export default Ember.Route.extend({
model() {
var apps = this.store.findAll('yarnApp');
var apps = this.store.findAll('yarn-app');
return apps;
}
});

View File

@ -24,7 +24,7 @@ export default Ember.Route.extend({
var id = param.node_addr + Constants.PARAM_SEPARATOR + param.container_id +
Constants.PARAM_SEPARATOR + param.filename;
return Ember.RSVP.hash({
containerLog: this.store.findRecord('yarnContainerLog', id),
containerLog: this.store.findRecord('yarn-container-log', id),
nodeInfo: { id: param.node_id, addr: param.node_addr }
}).then(function(hash) {
// Just return as its success.

View File

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

View File

@ -22,7 +22,7 @@ export default Ember.Route.extend({
model(param) {
// Get all apps running on a specific node. Node is contacted by using node_addr.
return Ember.RSVP.hash({
apps: this.store.query('yarnNodeApp', { nodeAddr: param.node_addr }),
apps: this.store.query('yarn-node-app', { nodeAddr: param.node_addr }),
nodeInfo: { id: param.node_id, addr: param.node_addr }
});
}

View File

@ -22,7 +22,7 @@ export default Ember.Route.extend({
model(param) {
// Get a specific container running on a specific node.
return Ember.RSVP.hash({
nodeContainer: this.store.queryRecord('yarnNodeContainer',
nodeContainer: this.store.queryRecord('yarn-node-container',
{ nodeHttpAddr: param.node_addr, containerId: param.container_id }),
nodeInfo: { id: param.node_id, addr: param.node_addr }
});

View File

@ -21,7 +21,7 @@ export default Ember.Route.extend({
model(param) {
// Get all containers running on specific node.
return Ember.RSVP.hash({
containers: this.store.query('yarnNodeContainer', { nodeHttpAddr: param.node_addr }),
containers: this.store.query('yarn-node-container', { nodeHttpAddr: param.node_addr }),
nodeInfo: { id: param.node_id, addr: param.node_addr }
});
}

View File

@ -22,8 +22,8 @@ export default Ember.Route.extend({
model(param) {
// Fetches data from both NM and RM. RM is queried to get node usage info.
return Ember.RSVP.hash({
node: this.store.findRecord('yarnNode', param.node_addr),
rmNode: this.store.findRecord('yarnRmNode', param.node_id)
node: this.store.findRecord('yarn-node', param.node_addr),
rmNode: this.store.findRecord('yarn-rm-node', param.node_id)
});
}
});

View File

@ -20,6 +20,6 @@ import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.store.findAll('yarnRmNode');
return this.store.findAll('yarn-rm-node');
}
});

View File

@ -22,15 +22,15 @@ export default Ember.Route.extend({
model(param) {
return Ember.RSVP.hash({
selected : param.queue_name,
queues: this.store.findAll('yarnQueue'),
queues: this.store.findAll('yarn-queue'),
selectedQueue : undefined,
apps: undefined, // apps of selected queue
});
},
afterModel(model) {
model.selectedQueue = this.store.peekRecord('yarnQueue', model.selected);
model.apps = this.store.findAll('yarnApp');
model.selectedQueue = this.store.peekRecord('yarn-queue', model.selected);
model.apps = this.store.findAll('yarn-app');
model.apps.forEach(function(o) {
console.log(o);
})

View File

@ -18,6 +18,6 @@
export default Ember.Route.extend({
beforeModel() {
this.transitionTo('yarnQueues.root');
this.transitionTo('yarn-queues.root');
}
});

View File

@ -20,6 +20,6 @@ import Ember from 'ember';
export default Ember.Route.extend({
model() {
return this.store.findAll('yarnQueue');
return this.store.findAll('yarn-queue');
},
});

View File

@ -36,7 +36,7 @@
{{#if arr}}
{{#each arr as |app|}}
<tr>
<td><a href="yarnApp/{{app.id}}">{{app.id}}</a></td>
<td><a href="yarn-app/{{app.id}}">{{app.id}}</a></td>
<td>{{app.appName}}</td>
<td>{{app.user}}</td>
<td>{{app.queue}}</td>
@ -57,7 +57,7 @@
{{/each}}
{{else}}
<tr>
<td><a href="yarnApp/{{app.id}}">{{app.id}}</a></td>
<td><a href="yarn-app/{{app.id}}">{{app.id}}</a></td>
<td>{{app.appName}}</td>
<td>{{app.user}}</td>
<td>{{app.queue}}</td>

View File

@ -17,7 +17,7 @@
--}}
<div class="col-md-12 container-fluid">
{{node-menu path="yarnContainerLog" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
{{node-menu path="yarn-container-log" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
<div class="col-md-10">
<div class="panel panel-default">
<div class="panel-heading">

View File

@ -18,7 +18,7 @@
<div class="col-md-12 container-fluid">
<div class="row">
{{node-menu path="yarnNodeApp" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
{{node-menu path="yarn-node-app" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
<div class="col-md-10 container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><b>Application Information</b></div>
@ -48,7 +48,7 @@
<tbody>
{{#each model.nodeApp.containers as |container|}}
<tr>
<td><a href="yarnNodeContainer/{{model.nodeInfo.id}}/{{model.nodeInfo.addr}}/{{container}}">{{container}}</a></td>
<td><a href="yarn-node-container/{{model.nodeInfo.id}}/{{model.nodeInfo.addr}}/{{container}}">{{container}}</a></td>
</tr>
{{/each}}
</tbody>

View File

@ -18,7 +18,7 @@
<div class="col-md-12 container-fluid">
<div class="row">
{{node-menu path="yarnNodeApps" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
{{node-menu path="yarn-node-apps" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
<div class="col-md-10 container-fluid">
<table id="node-apps-table" class="display table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
@ -35,7 +35,7 @@
<tr><td colspan="3" align="center">No apps found on this node</td></tr>
{{else}}
<tr>
<td><a href="yarnNodeApp/{{model.nodeInfo.id}}/{{model.nodeInfo.addr}}/{{app.appId}}">{{app.appId}}</a></td>
<td><a href="yarn-node-app/{{model.nodeInfo.id}}/{{model.nodeInfo.addr}}/{{app.appId}}">{{app.appId}}</a></td>
<td><span class={{app.appStateStyle}}>{{app.state}}</span></td>
<td>{{app.user}}</td>
</tr>

View File

@ -18,7 +18,7 @@
<div class="col-md-12 container-fluid">
<div class="row">
{{node-menu path="yarnNodeContainer" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
{{node-menu path="yarn-node-container" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
<div class="col-md-10 container-fluid">
<div class="panel panel-default">
<div class="panel-heading"><b>Container Information</b></div>

View File

@ -18,7 +18,7 @@
<div class="col-md-12 container-fluid">
<div class="row">
{{node-menu path="yarnNodeContainers" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
{{node-menu path="yarn-node-containers" nodeAddr=model.nodeInfo.addr nodeId=model.nodeInfo.id}}
<div class="col-md-10 container-fluid">
<table id="node-containers-table" class="display table table-striped table-bordered" cellspacing="0" width="100%">
<thead>
@ -36,7 +36,7 @@
<tr><td colspan="4" align="center">No containers found on this node</td></tr>
{{else}}
<tr>
<td><a href="yarnNodeContainer/{{model.nodeInfo.id}}/{{model.nodeInfo.addr}}/{{container.containerId}}">{{container.containerId}}</a></td>
<td><a href="yarn-node-container/{{model.nodeInfo.id}}/{{model.nodeInfo.addr}}/{{container.containerId}}">{{container.containerId}}</a></td>
<td><span class={{container.containerStateStyle}}>{{container.state}}</span></td>
<td>{{container.user}}</td>
<td>

View File

@ -18,7 +18,7 @@
<div class="col-md-12 container-fluid">
<div class="row">
{{node-menu path="yarnNode" nodeId=model.rmNode.id nodeAddr=model.node.id}}
{{node-menu path="yarn-node" nodeId=model.rmNode.id nodeAddr=model.node.id}}
<div class="col-md-10 container-fluid">
<div class="panel panel-default">
<div class="panel-heading">Node Information</div>