Skip to content
This repository was archived by the owner on Mar 3, 2023. It is now read-only.

Commit 06a55e9

Browse files
authored
Re-organize UI elements in Heorn UI topology page (#3397)
1 parent bd06dc8 commit 06a55e9

File tree

5 files changed

+223
-112
lines changed

5 files changed

+223
-112
lines changed

heron/tools/ui/resources/static/css/main.css

+38
Original file line numberDiff line numberDiff line change
@@ -2253,3 +2253,41 @@ nav {
22532253
.navbar-custom .navbar-link:hover {
22542254
color: #ffecb3;
22552255
}
2256+
2257+
/* Topology details */
2258+
div#display-navigator {
2259+
border-style: solid;
2260+
border-width: 1px;
2261+
border-color: #dddddd;
2262+
border-bottom-width: 0px;
2263+
}
2264+
2265+
#display-navigator .navbar-default button {
2266+
padding-left: 15px;
2267+
padding-right: 15px;
2268+
padding-top: 5px;
2269+
padding-bottom: 5px;
2270+
background-color: transparent;
2271+
border-width: 0px;
2272+
}
2273+
2274+
#display-navigator .navbar-default button.active {
2275+
background-color: lightskyblue;
2276+
}
2277+
2278+
/* Select the right topology details to show */
2279+
div#topologydetails {
2280+
border-style: solid;
2281+
border-width: 1px;
2282+
border-color: #dddddd;
2283+
}
2284+
2285+
div#topologydetails div.display-info {
2286+
display: none;
2287+
}
2288+
2289+
div#topologydetails.display-stats div.display-info.display-stats,
2290+
div#topologydetails.display-counters div.display-info.display-counters,
2291+
div#topologydetails.display-config div.display-info.display-config {
2292+
display: block;
2293+
}

heron/tools/ui/resources/static/js/config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ var ConfigTable = React.createClass({
166166
tableLayout: 'inherit'
167167
};
168168
return (
169-
<div>
169+
<div className="display-info display-config">
170170
<div className="widget-header">
171171
<div className="title">
172172
<h4>{title}</h4>

heron/tools/ui/resources/static/js/topologies.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,7 @@ var AllMetrics = React.createClass({
598598
instance: this.props.instance,
599599
};
600600
return (
601-
<div>
601+
<div className="display-info display-counters">
602602
<TopologyCounters info={info} />
603603
<SpoutRunningInfo info={info} />
604604
<BoltRunningInfo info={info} />
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
/**
21+
* Navigator of the topology details section in the topology page.
22+
* When a tab is clicked, the corresponding "display-" class
23+
* is set to the "topologydetails" element. Then CSS shows/hides
24+
* the information.
25+
*/
26+
(function () {
27+
var selected = "stats"; // Show stats tab at beginning.
28+
29+
function navigate () {
30+
this.parentElement.selected=this.id;
31+
for (var i = 0; i < this.parentElement.children.length; ++i) {
32+
this.parentElement.children[i].className = ''; // Hide all
33+
}
34+
this.className = 'active'; // Show "this" element.
35+
36+
// Show the right div by setting the class of the outter div.
37+
d3.selectAll('div#topologydetails').attr('class', 'display-' + this.id);
38+
}
39+
40+
d3.selectAll('.navigator button').on('click', navigate);
41+
}());

0 commit comments

Comments
 (0)