From 03511fdaf8b72a0135a8d12542838bacbfa19f39 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Tue, 28 Feb 2017 13:49:19 +0530 Subject: [PATCH] YARN-5335. Use em-table in app/nodes pages for new YARN UI. Contributed by Sunil G. --- .../src/main/webapp/app/adapters/yarn-app.js | 4 +- .../app/components/app-usage-donut-chart.js | 1 - .../main/webapp/app/components/donut-chart.js | 1 - .../app/controllers/app-table-columns.js | 98 ++++++++++++++++ .../webapp/app/controllers/yarn-apps/apps.js | 25 ++++ .../app/controllers/yarn-apps/services.js | 25 ++++ .../main/webapp/app/controllers/yarn-node.js | 3 +- .../app/controllers/yarn-nodes/table.js | 109 ++++++++++++++++++ .../webapp/app/controllers/yarn-queue/apps.js | 31 +++++ .../main/webapp/app/models/yarn-rm-node.js | 8 ++ .../src/main/webapp/app/routes/yarn-apps.js | 2 - .../main/webapp/app/routes/yarn-apps/apps.js | 9 ++ .../webapp/app/routes/yarn-apps/services.js | 11 ++ .../src/main/webapp/app/routes/yarn-queue.js | 4 +- .../src/main/webapp/app/routes/yarn-queues.js | 3 +- .../main/webapp/app/serializers/yarn-app.js | 3 +- .../webapp/app/templates/yarn-apps/apps.hbs | 13 ++- .../app/templates/yarn-apps/services.hbs | 4 +- .../webapp/app/templates/yarn-nodes/table.hbs | 42 +------ .../webapp/app/templates/yarn-queue/apps.hbs | 3 +- .../src/main/webapp/package.json | 9 +- .../controllers/app-table-columns-test.js | 30 +++++ .../unit/controllers/yarn-apps/apps-test.js | 30 +++++ .../controllers/yarn-apps/services-test.js | 30 +++++ .../unit/controllers/yarn-nodes/table-test.js | 30 +++++ .../unit/controllers/yarn-queue/apps-test.js | 30 +++++ 26 files changed, 492 insertions(+), 66 deletions(-) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js index b34c606f06a..fc52f7cb819 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/adapters/yarn-app.js @@ -25,9 +25,7 @@ export default AbstractAdapter.extend({ urlForQuery(query/*, modelName*/) { var url = this._buildURL(); - if (query.state) { - url = url + '/apps/?state=' + query.state; - } + url = url + '/apps'; return url; }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js index 274c219bca8..c72d93451ef 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-usage-donut-chart.js @@ -36,7 +36,6 @@ export default BaseUsageDonutChart.extend({ value: v.toFixed(2) }); - console.log(v); avail = avail - v; } }.bind(this)); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js index e5699b47c05..82d2d467a19 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/donut-chart.js @@ -54,7 +54,6 @@ export default BaseChartComponent.extend({ // 50 is for title var outerRadius = (h - 50 - 2 * layout.margin) / 2; var innerRadius = outerRadius * 0.618; - console.log("inner:" + innerRadius + " outer:" + outerRadius); var arc = d3.svg.arc() .innerRadius(innerRadius) diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js new file mode 100644 index 00000000000..53a6439987f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/app-table-columns.js @@ -0,0 +1,98 @@ +/** + * 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'; +import ColumnDef from 'em-table/utils/column-definition'; + +export default Ember.Controller.extend({ + columns: function() { + var colums = []; + colums.push({ + id: 'appId', + headerTitle: 'Application ID', + contentPath: 'id', + cellComponentName: 'em-table-linked-cell', + getCellContent: function(row) { +   return { +     displayText: row.id, +     routeName: 'yarn-app', +     id: row.id + }; + }, + minWidth: "250px" + }, { + id: 'appType', + headerTitle: 'Application Type', + contentPath: 'applicationType', + }, { + id: 'appName', + headerTitle: 'Application Name', + contentPath: 'appName', + }, { + id: 'appUsr', + headerTitle: 'User', + contentPath: 'user', + minWidth: "50px" + }, { + id: 'queue', + headerTitle: 'Queue', + contentPath: 'queue', + }, { + id: 'state', + headerTitle: 'State', + contentPath: 'state', + cellComponentName: 'em-table-status-cell', + minWidth: "50px" + }, { + id: 'progress', + headerTitle: 'Progress', + contentPath: 'progress', + cellComponentName: 'em-table-progress-cell', + cellDefinition: { +       valueMax: 100 +     }, + }, { + id: 'stTime', + headerTitle: 'Start Time', + contentPath: 'startTime', + }, { + id: 'elTime', + headerTitle: 'Elapsed Time', + contentPath: 'elapsedTime', + cellDefinition: { + type: "duration" + } + }, { + id: 'finishTime', + headerTitle: 'Finished Time', + contentPath: 'validatedFinishedTs', + observePath: true + }, { + id: 'priority', + headerTitle: 'Priority', + contentPath: 'priority', + }, { + id: 'cluster', + headerTitle: '%Cluster', + contentPath: 'clusterUsagePercentage', + observePath: true + }); + return ColumnDef.make(colums); + }.property() +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js new file mode 100644 index 00000000000..5c5063b94ea --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/apps.js @@ -0,0 +1,25 @@ +/** + * 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'; +import ColumnDef from 'em-table/utils/column-definition'; +import AppTableController from '../app-table-columns'; + +export default AppTableController.extend({ +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js new file mode 100644 index 00000000000..5c5063b94ea --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-apps/services.js @@ -0,0 +1,25 @@ +/** + * 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'; +import ColumnDef from 'em-table/utils/column-definition'; +import AppTableController from '../app-table-columns'; + +export default AppTableController.extend({ +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js index 55d9b3e32df..335a33c1cf6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-node.js @@ -20,8 +20,9 @@ import Ember from 'ember'; export default Ember.Controller.extend({ - breadcrumbs: Ember.computed("model.attempt.appId", function () { + breadcrumbs: Ember.computed("model.nodeInfo", function () { var nodeInfo = this.get("model.nodeInfo"); + return [{ text: "Home", routeName: 'application' diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js new file mode 100644 index 00000000000..3b7b0f6721e --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes/table.js @@ -0,0 +1,109 @@ +/** + * 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'; +import ColumnDef from 'em-table/utils/column-definition'; + +export default Ember.Controller.extend({ + columns: function() { + var colums = []; + colums.push({ + id: 'label', + headerTitle: 'Node Label', + contentPath: 'nodeLabelsAsString', + minWidth: "100px" + }, { + id: 'rack', + headerTitle: 'Rack', + contentPath: 'rack', + minWidth: "100px" + }, { + id: 'state', + headerTitle: 'Node State', + contentPath: 'state', + cellComponentName: 'em-table-status-cell', + minWidth: "100px" + }, { + id: 'address', + headerTitle: 'Node Address', + contentPath: 'id', + minWidth: "300px" + }, { + id: 'nodeId', + headerTitle: 'Node HTTP Address', + contentPath: 'nodeHTTPAddress', + cellComponentName: 'em-table-linked-cell', + getCellContent: function(row) { + var node_id = row.get("id"), + node_addr = row.get("nodeHTTPAddress"), + href = `#/yarn-node/${node_id}/${node_addr}`; + switch(row.get("nodeState")) { + case "SHUTDOWN": + case "LOST": + href = ""; + } +   return { + text: row.get("nodeHTTPAddress"), + href: href + }; + }, + minWidth: "250px" + }, { + id: 'containers', + headerTitle: 'Containers', + contentPath: 'numContainers', + }, { + id: 'memUsed', + headerTitle: 'Mem Used', + contentPath: 'usedMemoryBytes', + cellDefinition: { + type: "memory" + } + }, { + id: 'memAvail', + headerTitle: 'Mem Available', + contentPath: 'availMemoryBytes', + cellDefinition: { + type: "memory" + } + }, { + id: 'coresUsed', + headerTitle: 'VCores Used', + contentPath: 'usedVirtualCores', + }, { + id: 'coresAvail', + headerTitle: 'VCores Available', + contentPath: 'availableVirtualCores', + }, { + id: 'healthUpdate', + headerTitle: 'Last Health Update', + contentPath: 'lastHealthUpdate', + }, { + id: 'healthReport', + headerTitle: 'Health-Report', + contentPath: 'healthReport', + }, { + id: 'version', + headerTitle: 'Version', + contentPath: 'version', + observePath: true + }); + return ColumnDef.make(colums); + }.property() +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js new file mode 100644 index 00000000000..905d96daf30 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-queue/apps.js @@ -0,0 +1,31 @@ +/** + * 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'; +import TableDefinition from 'em-table/utils/table-definition'; +import AppTableController from '../app-table-columns'; + +export default AppTableController.extend({ + // Your custom instance of table definition + tableDefinition: TableDefinition.create(), + + // Search text alias, any change in controller's searchText would affect the table's searchText, and vice-versa. + _selectedObserver: Ember.on("init", Ember.observer("model.selected", function () { + this.set("tableDefinition.searchText", this.get("model.selected")); + })), +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js index c7875b453c6..461bf003774 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/models/yarn-rm-node.js @@ -96,4 +96,12 @@ export default DS.Model.extend({ "

Used Memory: " + Math.round(this.get("usedMemoryMB")) + ' MB

' + "

Available Memory: " + Math.round(this.get("availMemoryMB")) + ' MB

'; }.property(), + + usedMemoryBytes: function() { + return this.get("usedMemoryMB") * 1024 * 1024; + }.property("usedMemoryMB"), + + availMemoryBytes: function() { + return this.get("availMemoryMB") * 1024 * 1024; + }.property("availMemoryMB"), }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js index 1b671dae742..56349aaadd9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps.js @@ -23,13 +23,11 @@ import AbstractRoute from './abstract'; export default AbstractRoute.extend({ model() { return Ember.RSVP.hash({ - apps: this.store.findAll('yarn-app', {reload: true}), clusterMetrics: this.store.findAll('ClusterMetric', {reload: true}), }); }, unloadAll() { - this.store.unloadAll('yarn-app'); this.store.unloadAll('ClusterMetric'); } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js index 871917068fd..b0f37452af0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/apps.js @@ -19,4 +19,13 @@ import Ember from 'ember'; export default Ember.Route.extend({ + model() { + return Ember.RSVP.hash({ + apps: this.store.findAll('yarn-app', {reload: true}), + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app'); + } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js index 871917068fd..34ad1adaf48 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-apps/services.js @@ -19,4 +19,15 @@ import Ember from 'ember'; export default Ember.Route.extend({ + model() { + return Ember.RSVP.hash({ + apps: this.store.query('yarn-app', { + applicationTypes: "org-apache-slider" + }), + }); + }, + + unloadAll() { + this.store.unloadAll('yarn-app'); + } }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js index faae8b12fa5..1c4546cae0e 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queue.js @@ -26,7 +26,9 @@ export default AbstractRoute.extend({ selected : param.queue_name, queues: this.store.query('yarn-queue', {}), selectedQueue : undefined, - apps: this.store.findAll('yarn-app', {reload: true}) + apps: this.store.query('yarn-app', { + queue: param.queue_name + }) }); }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js index 7ef7ac358f9..e4f145d00b6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/routes/yarn-queues.js @@ -31,8 +31,7 @@ export default AbstractRoute.extend({ return Ember.RSVP.hash({ selected : queueName, queues: this.store.query('yarn-queue', {}), - selectedQueue : undefined, - apps: this.store.findAll('yarn-app', {reload: true}) + selectedQueue : undefined }); }, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js index 83d1e329c23..172286fcbf0 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/serializers/yarn-app.js @@ -43,7 +43,8 @@ export default DS.JSONAPISerializer.extend({ queue: payload.queue, state: payload.state, startTime: Converter.timeStampToDate(payload.startedTime), - elapsedTime: Converter.msToElapsedTime(payload.elapsedTime), + //elapsedTime: Converter.msToElapsedTime(payload.elapsedTime), + elapsedTime: payload.elapsedTime, finishedTime: Converter.timeStampToDate(payload.finishedTime), finalStatus: payload.finalStatus, progress: payload.progress, diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs index a2ba163a74e..8c72ce4f83c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/apps.hbs @@ -16,9 +16,12 @@ limitations under the License. --}} -{{#if model.apps}} - {{app-table table-id="apps-table" arr=model.apps}} - {{simple-table table-id="apps-table" bFilter=true colsOrder="0,desc" colTypes="natural elapsed-time" colTargets="0 7"}} +{{#if model.apps.isPending}} +

Loading...

{{else}} -

Could not find any applications from this cluster

-{{/if}} \ No newline at end of file + {{#if model.apps}} + {{em-table columns=columns rows=model.apps}} + {{else}} +

Could not find any applications from this cluster

+ {{/if}} +{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs index e472e8e107b..7556908a9e4 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-apps/services.hbs @@ -17,9 +17,7 @@ --}} {{#if model.apps}} - {{app-table table-id="apps-table" arr=model.apps}} - {{simple-table table-id="apps-table" bFilter=true colsOrder="0,desc" - colTypes="natural elapsed-time" colTargets="0 7" defaultSearch="slider"}} + {{em-table columns=columns rows=model.apps}} {{else}}

Could not find any applications from this cluster

{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs index d9fae3ac174..1390906f84c 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/table.hbs @@ -18,47 +18,7 @@
{{#if model.nodes}} - - - - - - - - - - - - - - - - - - - - {{#each model.nodes as |node|}} - - - - - - {{node-link nodeId=node.id nodeHTTPAddress=node.nodeHTTPAddress nodeState=node.state}} - - - - - - - - - - {{/each}} - -
Node LabelsRackNode StateNode AddressNode HTTP AddressLast Health UpdateHealth-ReportContainersMem UsedMem AvailVCores UsedVCores AvailVersion
{{node.nodeLabelsAsString}}{{node.rack}}{{node.state}}{{node.id}}{{node.lastHealthUpdate}}{{node.healthReport}}{{node.numContainers}}{{divide num=node.usedMemoryMB den=1024}} GB{{divide num=node.availMemoryMB den=1024}} GB{{node.usedVirtualCores}}{{node.availableVirtualCores}}{{node.version}}
- - {{simple-table table-id="nodes-table" bFilter=true}} + {{em-table columns=columns rows=model.nodes}} {{else}}

No nodes found on this cluster

{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs index 6d6488fb886..4a508c116a7 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-queue/apps.hbs @@ -19,8 +19,7 @@
{{#if model.apps}} - {{app-table table-id="apps-table" arr=model.apps}} - {{simple-table table-id="apps-table" bFilter=true colTypes="elapsed-time" colTargets="7"}} + {{em-table columns=columns rows=model.apps}} {{else}}

Could not find any applications from this cluster

{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json index 6a4eb16a180..4cd0fdc18ad 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/package.json @@ -20,9 +20,9 @@ "devDependencies": { "broccoli-asset-rev": "2.4.2", "broccoli-funnel": "1.0.1", - "em-table": "0.1.6", - "ember-bootstrap": "0.5.1", + "em-table": "0.7.0", "ember-array-contains-helper": "1.0.2", + "ember-bootstrap": "0.5.1", "ember-cli": "1.13.13", "ember-cli-app-version": "1.0.0", "ember-cli-babel": "5.1.6", @@ -47,6 +47,9 @@ "select2": "4.0.0" }, "dependencies": { - "em-helpers": "^0.5.13" + "em-helpers": "^0.8.0", + "em-table": "^0.7.0", + "ember-cli-moment-shim": "^3.0.1", + "ember-cli-numeral": "^0.2.0" } } diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js new file mode 100644 index 00000000000..b8b77ad1b1f --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/app-table-columns-test.js @@ -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:app-table-columns', 'Unit | Controller | app table columns', { + // 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); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js new file mode 100644 index 00000000000..a0042831374 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/apps-test.js @@ -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-apps/apps', 'Unit | Controller | yarn apps/apps', { + // 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); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js new file mode 100644 index 00000000000..d0a1f854f46 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-apps/services-test.js @@ -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-apps/services', 'Unit | Controller | yarn apps/services', { + // 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); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js new file mode 100644 index 00000000000..fdf586e27d5 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-nodes/table-test.js @@ -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-nodes/table', 'Unit | Controller | yarn nodes/table', { + // 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); +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js new file mode 100644 index 00000000000..3abf21a2a88 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/tests/unit/controllers/yarn-queue/apps-test.js @@ -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-queue/apps', 'Unit | Controller | yarn queue/apps', { + // 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); +});