You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ea...@apache.org on 2019/10/01 13:52:57 UTC
[qpid-dispatch] branch eallen-DISPATCH-1385 updated (ad6919d ->
a1cedb4)
This is an automated email from the ASF dual-hosted git repository.
eallen pushed a change to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git.
from ad6919d Fix address legend
new ac78143 Use light background for topology popup
new 20a1069 Add change detection and notification
new b40ba3d Remove debugging console.log statements
new a1cedb4 Fix topology background map pan/zoom
The 4 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
console/react/src/App.css | 50 +++++++++-------
console/react/src/amqp/topology.js | 1 -
console/react/src/chord/qdrChord.js | 1 -
console/react/src/contextMenuComponent.jsx | 1 -
console/react/src/topology/clientInfoComponent.js | 8 ---
console/react/src/topology/map.js | 22 +++----
console/react/src/topology/qdrTopology.js | 71 ++++++++++++++++-------
7 files changed, 89 insertions(+), 65 deletions(-)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[qpid-dispatch] 02/04: Add change detection and notification
Posted by ea...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
commit 20a106991a0d757e0890950e06612b2040ec2224
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Tue Oct 1 09:51:18 2019 -0400
Add change detection and notification
---
console/react/src/amqp/topology.js | 1 -
1 file changed, 1 deletion(-)
diff --git a/console/react/src/amqp/topology.js b/console/react/src/amqp/topology.js
index dbbc00f..8afa75a 100644
--- a/console/react/src/amqp/topology.js
+++ b/console/react/src/amqp/topology.js
@@ -29,7 +29,6 @@ class Topology {
this.filtering = false; // filter out nodes that don't have connection info
this.timeout = 5000;
this.updateInterval = interval;
- console.log(`topology constructed with interval of ${interval}`);
this._getTimer = null;
this.updating = false;
this.counter = 0;
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[qpid-dispatch] 03/04: Remove debugging console.log statements
Posted by ea...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
commit b40ba3d3c0209333c9431d7be2fb34ec4fcffc9e
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Tue Oct 1 09:52:14 2019 -0400
Remove debugging console.log statements
---
console/react/src/chord/qdrChord.js | 1 -
console/react/src/contextMenuComponent.jsx | 1 -
console/react/src/topology/clientInfoComponent.js | 8 --------
3 files changed, 10 deletions(-)
diff --git a/console/react/src/chord/qdrChord.js b/console/react/src/chord/qdrChord.js
index 24a5caf..854fc86 100644
--- a/console/react/src/chord/qdrChord.js
+++ b/console/react/src/chord/qdrChord.js
@@ -843,7 +843,6 @@ class MessageFlowPage extends Component {
// one of the legend sections was opened or closed
handleOpenChange = (id, isOpen) => {
- console.log(`handleOpenChange called with ${id} and ${isOpen}`);
const { legendOptions } = this.state;
legendOptions[`${id}Open`] = isOpen;
this.setState({ legendOptions });
diff --git a/console/react/src/contextMenuComponent.jsx b/console/react/src/contextMenuComponent.jsx
index 81029d1..18dd46c 100644
--- a/console/react/src/contextMenuComponent.jsx
+++ b/console/react/src/contextMenuComponent.jsx
@@ -31,7 +31,6 @@ class ContextMenuComponent extends React.Component {
};
handleHide = e => {
- console.log("handleHide called");
this.unregisterHandlers();
this.props.handleContextHide();
};
diff --git a/console/react/src/topology/clientInfoComponent.js b/console/react/src/topology/clientInfoComponent.js
index f5dde19..8ef3dad 100644
--- a/console/react/src/topology/clientInfoComponent.js
+++ b/console/react/src/topology/clientInfoComponent.js
@@ -363,11 +363,6 @@ class ClientInfoComponent extends Component {
this.dStart = 0;
this.dStop = Math.min(this.d.normals.length, 10);
this.updateTimer = setTimeout(this.doUpdateDetail, 2000);
-
- console.log(` ------- detail -------`);
- console.log(this.state.detail);
- console.log(rows);
- console.log(` --------------`);
}
});
};
@@ -406,8 +401,6 @@ class ClientInfoComponent extends Component {
});
subRows.push({ cells: subCells });
});
- console.log(" === subRows ===");
- console.log(subRows);
newRows.push({
parent: i * 2,
@@ -427,7 +420,6 @@ class ClientInfoComponent extends Component {
]
});
}
- console.log(newRows);
return newRows;
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[qpid-dispatch] 01/04: Use light background for topology popup
Posted by ea...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
commit ac78143504ea4d398f1979c90afd86120fb695ba
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Tue Oct 1 09:50:39 2019 -0400
Use light background for topology popup
---
console/react/src/App.css | 50 ++++++++++++++++++++++++++++-------------------
1 file changed, 30 insertions(+), 20 deletions(-)
diff --git a/console/react/src/App.css b/console/react/src/App.css
index 6782444..0497c54 100644
--- a/console/react/src/App.css
+++ b/console/react/src/App.css
@@ -413,23 +413,6 @@ div.state-container button.pf-c-clipboard-copy__group-copy {
background-color: #0e0e0e;
}
-.qdrPopup {
- position: absolute;
- z-index: 200;
- border-radius: 4px;
- border: 1px solid gray;
- background-color: white;
- color: black;
- opacity: 1;
- padding: 12px;
- font-size: 14px;
-}
-
-table.popupTable td {
- padding-right: 5px;
- font-size: 10px;
-}
-
g text {
pointer-events: none;
}
@@ -687,15 +670,42 @@ path.empty {
border-color: black;
}
+.qdrPopup {
+ position: absolute;
+ z-index: 200;
+ border-radius: 4px;
+ border: 1px solid gray;
+ background-color: white;
+ color: black;
+ opacity: 1;
+ padding: 12px;
+ font-size: 14px;
+}
+
#popover-div {
position: absolute;
z-index: 200;
border-radius: 4px;
- background-color: black;
- color: white;
+ border: 1px solid gray;
+ background-color: white;
+ color: black;
opacity: 0.95;
padding: 12px;
- font-size: 14px;
+ font-size: 16px;
+}
+
+#popover-div h5 {
+ background-color: #eaeaea;
+ padding: 0.25em 0.125em;
+}
+
+table.popupTable td {
+ padding-right: 5px;
+ font-size: 10px;
+}
+
+table.popupTable tr.header {
+ font-weight: bold;
}
#chord text {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[qpid-dispatch] 04/04: Fix topology background map pan/zoom
Posted by ea...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
eallen pushed a commit to branch eallen-DISPATCH-1385
in repository https://gitbox.apache.org/repos/asf/qpid-dispatch.git
commit a1cedb4814847124cc65513541203079d254c0e1
Author: Ernest Allen <ea...@redhat.com>
AuthorDate: Tue Oct 1 09:52:41 2019 -0400
Fix topology background map pan/zoom
---
console/react/src/topology/map.js | 22 ++++------
console/react/src/topology/qdrTopology.js | 71 ++++++++++++++++++++++---------
2 files changed, 59 insertions(+), 34 deletions(-)
diff --git a/console/react/src/topology/map.js b/console/react/src/topology/map.js
index a3ce7be..2ac3578 100644
--- a/console/react/src/topology/map.js
+++ b/console/react/src/topology/map.js
@@ -29,10 +29,11 @@ const defaultOceanColor = "#FFFFFF";
export class BackgroundMap {
// eslint-disable-line no-unused-vars
- constructor($scope, notifyFn) {
+ constructor($scope, options, notifyFn) {
this.$scope = $scope;
this.initialized = false;
this.notify = notifyFn;
+ this.options = options;
let savedOptions = localStorage.getItem(MAPOPTIONSKEY);
this.mapOptions = savedOptions
@@ -70,9 +71,7 @@ export class BackgroundMap {
}
setBackgroundColor() {
- const color = this.$scope.state.legendOptions.map.shown
- ? this.mapOptions.oceanColor
- : "#FFF";
+ const color = this.options.show ? this.mapOptions.oceanColor : "#FFF";
d3.select(".pf-c-page__main").style("background-color", color);
}
@@ -120,15 +119,12 @@ export class BackgroundMap {
.scaleExtent(this.scaleExtent)
.scale(this.projection.scale())
.translate([0, 0]) // not linked directly to projection
- .on("zoom", this.zoomed.bind(this));
+ .on("zoom", this.zoomed);
this.geo = svg
.append("g")
.attr("class", "geo")
- .style(
- "opacity",
- this.$scope.state.legendOptions.map.shown ? "1" : "0"
- );
+ .style("opacity", this.options.show ? "1" : "0");
this.geo
.append("rect")
@@ -137,7 +133,7 @@ export class BackgroundMap {
.attr("height", height)
.attr("fill", "#FFF");
- if (this.$scope.state.legendOptions.map.shown) {
+ if (this.options.show) {
this.svg.call(this.zoom).on("dblclick.zoom", null);
}
@@ -198,12 +194,12 @@ export class BackgroundMap {
return this.projection.invert([x, y]);
}
- zoomed() {
+ zoomed = () => {
if (
d3.event &&
!this.$scope.current_node &&
!this.$scope.mousedown_node &&
- this.$scope.state.legendOptions.map.shown
+ this.options.show
) {
let scale = d3.event.scale,
t = d3.event.translate,
@@ -259,7 +255,7 @@ export class BackgroundMap {
}
// update the land path with our current projection
this.geo.selectAll(".land").attr("d", this.geoPath);
- }
+ };
saveProjection() {
if (this.projection) {
this.lastProjection.rotate = this.projection.rotate()[0];
diff --git a/console/react/src/topology/qdrTopology.js b/console/react/src/topology/qdrTopology.js
index f5eda9e..da4b094 100644
--- a/console/react/src/topology/qdrTopology.js
+++ b/console/react/src/topology/qdrTopology.js
@@ -103,6 +103,7 @@ class TopologyPage extends Component {
);
this.backgroundMap = new BackgroundMap(
this,
+ this.state.legendOptions.map,
// notify: called each time a pan/zoom is performed
() => {
if (this.state.legendOptions.map.show) {
@@ -144,17 +145,45 @@ class TopologyPage extends Component {
// called only once when the component is initialized
componentDidMount = () => {
- this.init();
+ window.addEventListener("resize", this.resize);
+ // we only need to update connections during steady-state
+ this.props.service.management.topology.setUpdateEntities(["connection"]);
+ // poll the routers for their latest entities (set to connection above)
this.props.service.management.topology.startUpdating();
+
+ // create the svg
+ this.init();
+
+ // get notified when a router is added/dropped and when
+ // the number of connections for a router changes
this.props.service.management.topology.addChangedAction("topology", () => {
this.init();
});
};
componentWillUnmount = () => {
+ this.props.service.management.topology.setUpdateEntities([]);
this.props.service.management.topology.stopUpdating();
this.props.service.management.topology.delChangedAction("topology");
+ this.traffic.remove();
+ this.forceData.nodes.savePositions();
+ window.removeEventListener("resize", this.resize);
};
+
+ resize = () => {
+ if (!this.svg) return;
+ let sizes = getSizes(this.topologyRef, this.QDRLog);
+ this.width = sizes[0];
+ this.height = sizes[1];
+ if (this.width > 0) {
+ // set attrs and 'resume' force
+ this.svg.attr("width", this.width);
+ this.svg.attr("height", this.height);
+ this.force.size(sizes).resume();
+ }
+ this.updateLegend();
+ };
+
setFixed = (item, data) => {
data.setFixed(item.title !== "Unfreeze");
};
@@ -230,20 +259,18 @@ class TopologyPage extends Component {
.selectAll("g");
this.traffic.remove();
- if (this.state.legendOptions.traffic.open) {
- if (this.state.legendOptions.traffic.dots)
- this.traffic.addAnimationType(
- "dots",
- separateAddresses,
- Nodes.radius("inter-router")
- );
- if (this.state.legendOptions.traffic.congestion)
- this.traffic.addAnimationType(
- "congestion",
- separateAddresses,
- Nodes.radius("inter-router")
- );
- }
+ if (this.state.legendOptions.traffic.dots)
+ this.traffic.addAnimationType(
+ "dots",
+ separateAddresses,
+ Nodes.radius("inter-router")
+ );
+ if (this.state.legendOptions.traffic.congestion)
+ this.traffic.addAnimationType(
+ "congestion",
+ separateAddresses,
+ Nodes.radius("inter-router")
+ );
// mouse event vars
this.mousedown_node = null;
@@ -847,12 +874,14 @@ class TopologyPage extends Component {
.style("top", event.pageY - top + "px");
// show popup
let pwidth = this.popupRef.offsetWidth;
- this.setState({ showPopup: true });
- d3.select("#popover-div")
- .style("left", Math.min(width - pwidth, event.pageX + 5) + "px")
- .on("mouseout", () => {
- this.setState({ showPopup: false });
- });
+ this.setState({ showPopup: true }, () =>
+ d3
+ .select("#popover-div")
+ .style("left", Math.min(width - pwidth, event.pageX + 5) + "px")
+ .on("mouseout", () => {
+ this.setState({ showPopup: false });
+ })
+ );
};
clearAllHighlights = () => {
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org