From 1b26452f666da8e88ad5819e6f7ed27ff89ef558 Mon Sep 17 00:00:00 2001 From: Vasu Date: Wed, 15 Nov 2017 12:26:57 +0530 Subject: [PATCH] Reorganize node labels page --- .../webapp/app/controllers/yarn-nodes-status.js | 36 +++++++++++++ .../webapp/app/controllers/yarn-nodes/table.js | 17 ++++++- .../src/main/webapp/app/models/yarn-rm-node.js | 2 +- .../hadoop-yarn-ui/src/main/webapp/app/router.js | 1 + .../app/templates/components/nodes-heatmap.hbs | 16 +++--- .../src/main/webapp/app/templates/yarn-nodes.hbs | 59 +++++++--------------- .../webapp/app/templates/yarn-nodes/heatmap.hbs | 10 ++-- .../webapp/app/templates/yarn-nodes/status.hbs | 35 +++++++++++++ .../main/webapp/app/templates/yarn-nodes/table.hbs | 4 +- 9 files changed, 120 insertions(+), 60 deletions(-) create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js create mode 100644 hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/status.hbs diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js new file mode 100644 index 00000000000..b007cf48938 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/controllers/yarn-nodes-status.js @@ -0,0 +1,36 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import Ember from 'ember'; + +export default Ember.Controller.extend({ + needReload: true, + selectedQueue: undefined, + + breadcrumbs: [{ + text: "Home", + routeName: 'application' + }, { + text: "Nodes", + routeName: 'yarn-nodes.table', + }, { + text: "Node status", + routeName: 'yarn-nodes-status', + }] + +}); 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 index 3fae5961f87..30180ddd415 100644 --- 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 @@ -29,6 +29,10 @@ export default Ember.Controller.extend({ sortOrder: Ember.computed.alias('tableDefinition.sortOrder'), pageNum: Ember.computed.alias('tableDefinition.pageNum'), rowCount: Ember.computed.alias('tableDefinition.rowCount'), + tableDefinition: TableDefinition.create({ + enableFaceting: true, + rowCount: 25 + }), columns: function() { var colums = []; colums.push({ @@ -40,6 +44,7 @@ export default Ember.Controller.extend({ id: 'rack', headerTitle: 'Rack', contentPath: 'rack', + facetType: null, minWidth: "100px" }, { id: 'state', @@ -51,12 +56,14 @@ export default Ember.Controller.extend({ id: 'address', headerTitle: 'Node Address', contentPath: 'id', - minWidth: "300px" + minWidth: "300px", + facetType: null, }, { id: 'nodeId', headerTitle: 'Node HTTP Address', contentPath: 'nodeHTTPAddress', cellComponentName: 'em-table-linked-cell', + facetType: null, getCellContent: function(row) { var node_id = row.get("id"), node_addr = row.get("nodeHTTPAddress"), @@ -76,10 +83,12 @@ export default Ember.Controller.extend({ id: 'containers', headerTitle: 'Containers', contentPath: 'numContainers', + facetType: null, }, { id: 'memUsed', headerTitle: 'Mem Used', contentPath: 'usedMemoryBytes', + facetType: null, cellDefinition: { type: "memory" } @@ -87,6 +96,7 @@ export default Ember.Controller.extend({ id: 'memAvail', headerTitle: 'Mem Available', contentPath: 'availMemoryBytes', + facetType: null, cellDefinition: { type: "memory" } @@ -94,22 +104,27 @@ export default Ember.Controller.extend({ id: 'coresUsed', headerTitle: 'VCores Used', contentPath: 'usedVirtualCores', + facetType: null, }, { id: 'coresAvail', headerTitle: 'VCores Available', contentPath: 'availableVirtualCores', + facetType: null, }, { id: 'healthUpdate', headerTitle: 'Last Health Update', contentPath: 'lastHealthUpdate', + facetType: null, }, { id: 'healthReport', headerTitle: 'Health-Report', contentPath: 'healthReport', + facetType: null, }, { id: 'version', headerTitle: 'Version', contentPath: 'version', + facetType: null, observePath: true }); return ColumnDef.make(colums); 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 20b6f5bd2ef..13210748da0 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 @@ -35,7 +35,7 @@ export default DS.Model.extend({ nodeLabelsAsString: function() { var labels = this.get("nodeLabels"); - var labelToReturn = ""; + var labelToReturn = "default"; // Only one label per node supported. if (labels && labels.length > 0) { labelToReturn = labels[0]; diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js index c7b3d6a6f91..64e9ad2b381 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/router.js @@ -31,6 +31,7 @@ Router.map(function() { this.route('yarn-nodes', function(){ this.route('table'); this.route('heatmap'); + this.route('status'); }); this.route('yarn-queue', {path: '/yarn-queue/:queue_name'}, function() { this.route('info'); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs index e7c89d6b0aa..f68bba6b8bc 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/components/nodes-heatmap.hbs @@ -16,15 +16,13 @@ * limitations under the License. }} -
-
-
- -
-
- -
+
+
+ +
+
+

\ No newline at end of file diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs index 79d9efa20e7..c850386b681 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes.hbs @@ -15,56 +15,35 @@ See the License for the specific language governing permissions and limitations under the License. --}} - {{breadcrumb-bar breadcrumbs=breadcrumbs}} -

-
+
-

Nodes

-
-
-
-
-
- -
- {{#if model.clusterMetrics}} -
-
-
-
- Node Managers -
-
- {{donut-chart data=model.clusterMetrics.firstObject.getNodesDataForDonutChart - showLabels=true - parentId="nodes-donut-chart" - ratio=0.6 - maxHeight=350 - colorTargets="good error warn"}} -
-
- {{/if}} - - {{outlet}} +
+ {{outlet}} +
+
diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs index 0ebe7ba55cd..1421c824b5a 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/heatmap.hbs @@ -15,14 +15,10 @@ See the License for the specific language governing permissions and limitations under the License. --}} - {{#if model.nodes}} - -
-
- {{nodes-heatmap model=model.nodes parentId="nodes-heatmap-chart" - title="Node Heatmap Chart (Usage of "}} -
+
+ {{nodes-heatmap model=model.nodes parentId="nodes-heatmap-chart" + title="Node Heatmap Chart (Usage of "}}
{{/if}} diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/status.hbs b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/status.hbs new file mode 100644 index 00000000000..a941f774248 --- /dev/null +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-ui/src/main/webapp/app/templates/yarn-nodes/status.hbs @@ -0,0 +1,35 @@ +{{!-- + 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. +--}} + +{{#if model.clusterMetrics}} +
+
+
+
+ Node Managers +
+
+ {{donut-chart data=model.clusterMetrics.firstObject.getNodesDataForDonutChart showLabels=true parentId="nodes-donut-chart" + ratio=0.6 maxHeight=350 colorTargets="good error warn"}} +
+
+
+
+{{/if}} + +{{outlet}} 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 6ebcae21c13..11757f06241 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 @@ -15,8 +15,8 @@ See the License for the specific language governing permissions and limitations under the License. --}} -
-
+
+
{{#if model.nodes}} {{em-table columns=columns rows=model.nodes definition=tableDefinition}} {{else}} -- 2.13.5 (Apple Git-94)