From 4b2fcf1c001fc1178b6ca4ea7c81466de6deef23 Mon Sep 17 00:00:00 2001 From: Sunil G Date: Wed, 22 Feb 2017 23:18:40 +0530 Subject: [PATCH] YARN-5335 --- .../src/main/webapp/app/adapters/yarn-app.js | 4 +- .../webapp/app/components/app-usage-donut-chart.js | 1 - .../src/main/webapp/app/components/donut-chart.js | 1 - .../webapp/app/controllers/app-table-columns.js | 98 ++++++++++++++++++ .../main/webapp/app/controllers/yarn-apps/apps.js | 25 +++++ .../webapp/app/controllers/yarn-apps/services.js | 25 +++++ .../src/main/webapp/app/controllers/yarn-node.js | 3 +- .../webapp/app/controllers/yarn-nodes/table.js | 109 +++++++++++++++++++++ .../main/webapp/app/controllers/yarn-queue/apps.js | 31 ++++++ .../src/main/webapp/app/models/yarn-rm-node.js | 8 ++ .../src/main/webapp/app/routes/yarn-apps.js | 2 - .../src/main/webapp/app/routes/yarn-apps/apps.js | 9 ++ .../main/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 +- .../src/main/webapp/app/serializers/yarn-app.js | 3 +- .../main/webapp/app/templates/yarn-apps/apps.hbs | 13 ++- .../webapp/app/templates/yarn-apps/services.hbs | 4 +- .../main/webapp/app/templates/yarn-nodes/table.hbs | 42 +------- .../main/webapp/app/templates/yarn-queue/apps.hbs | 3 +- .../hadoop-yarn-ui/src/main/webapp/package.json | 9 +- .../unit/controllers/app-table-columns-test.js | 30 ++++++ .../tests/unit/controllers/yarn-apps/apps-test.js | 30 ++++++ .../unit/controllers/yarn-apps/services-test.js | 30 ++++++ .../unit/controllers/yarn-nodes/table-test.js | 30 ++++++ .../tests/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 b34c606..fc52f7c 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 274c219..c72d934 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 e5699b4..82d2d46 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 0000000..53a6439 --- /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 0000000..5c5063b --- /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 0000000..5c5063b --- /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 55d9b3e..335a33c 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 0000000..35bf9c6 --- /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 0000000..905d96d --- /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 c7875b4..461bf00 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 1b671da..56349aa 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 8719170..b0f3745 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 8719170..34ad1ad 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 faae8b1..1c4546c 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 7ef7ac3..e4f145d 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 83d1e32..172286f 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 a2ba163..8c72ce4 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 e472e8e..7556908 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 d9fae3a..1390906 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 6d6488f..4a508c1 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 6a4eb16..4cd0fdc 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 0000000..b8b77ad --- /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 0000000..a004283 --- /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 0000000..d0a1f85 --- /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 0000000..fdf586e --- /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 0000000..3abf21a --- /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); +}); -- 2.10.1 (Apple Git-78)