diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-attempt-table.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-attempt-table.js index 3c430376dd..88282750e2 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-attempt-table.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/app-attempt-table.js @@ -19,11 +19,4 @@ import Ember from 'ember'; export default Ember.Component.extend({ - nodeHttpAddressFormatted: Ember.computed('attempt.nodeHttpAddress', function() { - var nodeHttpAddress = this.get('attempt.nodeHttpAddress'); - if (nodeHttpAddress && nodeHttpAddress.indexOf('://') < 0) { - nodeHttpAddress = 'http://' + nodeHttpAddress; - } - return nodeHttpAddress; - }) }); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js index d730a43c43..4a33d5b6d9 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/components/timeline-view.js @@ -18,6 +18,7 @@ import Ember from 'ember'; import Converter from 'yarn-ui/utils/converter'; +import ColumnDef from 'em-table/utils/column-definition'; export default Ember.Component.extend({ canvas: { @@ -31,6 +32,8 @@ export default Ember.Component.extend({ modelArr: [], colors: d3.scale.category10().range(), _selected: undefined, + gridColumns: [], + gridRows: [], selected: function() { return this._selected; @@ -276,5 +279,199 @@ export default Ember.Component.extend({ if (this.modelArr.length > 0) { this.setSelected(this.modelArr[0]); } + + if (this.get('attemptModel')) { + this.setAttemptsGridColumnsAndRows(); + } else { + this.setContainersGridColumnsAndRows(); + } }, -}); \ No newline at end of file + + setAttemptsGridColumnsAndRows: function() { + var self = this; + var columns = []; + + columns.push({ + id: 'id', + headerTitle: 'Attempt ID', + contentPath: 'id', + cellComponentName: 'em-table-linked-cell', + minWidth: '300px', + getCellContent: function(row) { + return { + displayText: row.get('id'), + routeName: 'yarn-app-attempt', + id: row.get('id') + }; + } + }, { + id: 'attemptStartedTime', + headerTitle: 'Started Time', + contentPath: 'attemptStartedTime' + }, { + id: 'finishedTime', + headerTitle: 'Finished Time', + contentPath: 'finishedTime', + getCellContent: function(row) { + if (row.get('finishedTs')) { + return row.get('finishedTime'); + } + return 'N/A'; + } + }, { + id: 'elapsedTime', + headerTitle: 'Elapsed Time', + contentPath: 'elapsedTime' + }, { + id: 'appMasterContainerId', + headerTitle: 'AM Container ID', + contentPath: 'appMasterContainerId', + minWidth: '300px' + }, { + id: 'amNodeId', + headerTitle: 'AM Node ID', + contentPath: 'amNodeId' + }, { + id: 'attemptState', + headerTitle: 'State', + contentPath: 'attemptState', + getCellContent: function(row) { + var state = row.get('attemptState'); + if (state) { + return state; + } else { + return 'N/A'; + } + } + }, { + id: 'nodeHttpAddress', + headerTitle: 'NodeManager Web UI', + contentPath: 'nodeHttpAddress', + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var address = self.checkHttpProtocol(row.get('nodeHttpAddress')); + if (address) { + return `${address}`; + } else { + return 'N/A'; + } + } + }, { + id: 'logsLink', + headerTitle: 'Logs', + contentPath: 'logsLink', + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var logUrl = self.checkHttpProtocol(row.get('logsLink')); + if (logUrl) { + return `Link`; + } else { + return 'N/A'; + } + } + }); + + var gridCols = ColumnDef.make(columns); + this.set('gridColumns', gridCols); + this.set('gridRows', this.modelArr); + }, + + setContainersGridColumnsAndRows: function() { + var self = this; + var columns = []; + + columns.push({ + id: 'id', + headerTitle: 'Container ID', + contentPath: 'id', + minWidth: '300px' + }, { + id: 'startedTime', + headerTitle: 'Started Time', + contentPath: 'startedTime' + }, { + id: 'finishedTime', + headerTitle: 'Finished Time', + contentPath: 'finishedTime', + getCellContent: function(row) { + if (row.get('finishedTs')) { + return row.get('finishedTime'); + } + return 'N/A'; + } + }, { + id: 'elapsedTime', + headerTitle: 'Elapsed Time', + contentPath: 'elapsedTime' + }, { + id: 'priority', + headerTitle: 'Priority', + contentPath: 'priority' + }, { + id: 'containerExitStatus', + headerTitle: 'Exit Status', + contentPath: 'containerExitStatus', + getCellContent: function(row) { + var status = row.get('containerExitStatus'); + if (status) { + return status; + } else { + return 'N/A'; + } + } + }, { + id: 'containerState', + headerTitle: 'State', + contentPath: 'containerState', + getCellContent: function(row) { + var state = row.get('containerState'); + if (state) { + return state; + } else { + return 'N/A'; + } + } + }, { + id: 'logUrl', + headerTitle: 'Logs', + contentPath: 'logUrl', + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var url = self.checkHttpProtocol(row.get('logUrl')); + if (url) { + return `${url}`; + } else { + return 'N/A'; + } + } + }, { + id: 'nodeHttpAddress', + headerTitle: 'Node Manager UI', + contentPath: 'nodeHttpAddress', + cellComponentName: 'em-table-html-cell', + getCellContent: function(row) { + var address = self.checkHttpProtocol(row.get('nodeHttpAddress')); + if (address) { + return `${address}`; + } else { + return 'N/A'; + } + } + }); + + var gridCols = ColumnDef.make(columns); + this.set('gridColumns', gridCols); + this.set('gridRows', this.modelArr); + }, + + checkHttpProtocol: function(prop) { + if (prop && prop.indexOf('://') < 0) { + prop = 'http://' + prop; + } + return prop; + }, + + isDataEmpty: Ember.computed(function() { + return this.modelArr.length === 0; + }) +}); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/prepend-protocol.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/prepend-protocol.js new file mode 100644 index 0000000000..e8d18c4472 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/helpers/prepend-protocol.js @@ -0,0 +1,29 @@ +/** + * 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 function prependProtocol(params/*, hash*/) { + let address = params[0]; + if (address && address.indexOf('://') < 0) { + address = 'http://' + address; + } + return address; +} + +export default Ember.Helper.helper(prependProtocol); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs index fcd076b2eb..c3a9e32e77 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/app-attempt-table.hbs @@ -23,39 +23,43 @@
Start Time | +Started Time | {{container.startedTime}} | |
Finished Time | {{container.validatedFinishedTs}} | ||
Elapsed Time | {{container.elapsedTime}} | @@ -34,21 +36,29 @@Priority | {{container.priority}} |
Log | -Link | -||
Exit Status | {{container.containerExitStatus}} | ||
State | {{container.containerState}} | ||
NodeManager UI | -{{container.nodeHttpAddress}} | +{{container.nodeHttpAddress}} | |
Log | +Link | +