ARTEMIS-4574 fix broker diagram

This commit is contained in:
Erwin Dondorp 2024-01-18 00:47:22 +01:00 committed by Justin Bertram
parent 1197898232
commit 22a31fb254
2 changed files with 22 additions and 22 deletions

View File

@ -44,22 +44,22 @@ svg text {
font-family: PatternFlyIcons-webfont; font-family: PatternFlyIcons-webfont;
} }
.pf-topology-svg g.ThisMasterBroker circle { .pf-topology-svg g.ThisPrimaryBroker circle {
stroke: black; stroke: black;
fill: #c12766; fill: #c12766;
} }
.pf-topology-svg g.MasterBroker circle { .pf-topology-svg g.PrimaryBroker circle {
stroke: #801944; stroke: #801944;
fill: #c12766; fill: #c12766;
} }
.pf-topology-svg g.ThisSlaveBroker circle { .pf-topology-svg g.ThisBackupBroker circle {
stroke: black; stroke: black;
fill: #cf242a; fill: #cf242a;
} }
.pf-topology-svg g.SlaveBroker circle { .pf-topology-svg g.BackupBroker circle {
stroke: #82171b; stroke: #82171b;
fill: #cf242a; fill: #cf242a;
} }
@ -2517,4 +2517,4 @@ ng-include > .nav.nav-tabs {
.modal-body{ .modal-body{
max-height: calc(100vh - 200px); max-height: calc(100vh - 200px);
overflow-y: auto; overflow-y: auto;
} }

View File

@ -47,10 +47,10 @@ var Artemis;
<input type="checkbox" ng-model="$ctrl.showInternalQueues"> <input type="checkbox" ng-model="$ctrl.showInternalQueues">
</label> </label>
<label style="margin-right: 1em" ng-show="$ctrl.cntLiveBrokers && $ctrl.cntBackupBrokers">Show Primary Brokers: <label style="margin-right: 1em" ng-show="$ctrl.cntPrimaryBrokers && $ctrl.cntBackupBrokers">Show Primary Brokers:
<input type="checkbox" ng-model="$ctrl.showLiveBrokers"> <input type="checkbox" ng-model="$ctrl.showPrimaryBrokers">
</label> </label>
<label style="margin-right: 1em" ng-show="$ctrl.cntLiveBrokers && $ctrl.cntBackupBrokers">Show Backup Brokers: <label style="margin-right: 1em" ng-show="$ctrl.cntPrimaryBrokers && $ctrl.cntBackupBrokers">Show Backup Brokers:
<input type="checkbox" ng-model="$ctrl.showBackupBrokers"> <input type="checkbox" ng-model="$ctrl.showBackupBrokers">
</label> </label>
<label style="margin-right: 1em" ng-show="$ctrl.relations.length">Show Connectors: <label style="margin-right: 1em" ng-show="$ctrl.relations.length">Show Connectors:
@ -94,10 +94,10 @@ var Artemis;
ctrl.showQueues = true; ctrl.showQueues = true;
ctrl.showInternalAddresses = false; ctrl.showInternalAddresses = false;
ctrl.showInternalQueues = false; ctrl.showInternalQueues = false;
ctrl.showLiveBrokers = true; ctrl.showPrimaryBrokers = true;
ctrl.showBackupBrokers = true; ctrl.showBackupBrokers = true;
ctrl.showConnectors = true; ctrl.showConnectors = true;
ctrl.cntLiveBrokers = 0; ctrl.cntPrimaryBrokers = 0;
ctrl.cntBackupBrokers = 0; ctrl.cntBackupBrokers = 0;
ctrl.cntAddresses = 0; ctrl.cntAddresses = 0;
ctrl.cntInternalAddresses = 0; ctrl.cntInternalAddresses = 0;
@ -145,18 +145,18 @@ var Artemis;
updateInternalQueueKind(); updateInternalQueueKind();
}); });
function updateLiveBrokerKind() { function updateLiveBrokerKind() {
if(ctrl.kinds.ThisPrimaryBroker && !ctrl.showLiveBrokers) { if(ctrl.kinds.ThisPrimaryBroker && !ctrl.showPrimaryBrokers) {
delete ctrl.kinds.ThisPrimaryBroker; delete ctrl.kinds.ThisPrimaryBroker;
} else if (!ctrl.kinds.ThisPrimaryBroker && ctrl.showLiveBrokers) { } else if (!ctrl.kinds.ThisPrimaryBroker && ctrl.showPrimaryBrokers) {
ctrl.kinds.ThisPrimaryBroker = true; ctrl.kinds.ThisPrimaryBroker = true;
} }
if(ctrl.kinds.PrimaryBroker && !ctrl.showLiveBrokers) { if(ctrl.kinds.PrimaryBroker && !ctrl.showPrimaryBrokers) {
delete ctrl.kinds.PrimaryBroker; delete ctrl.kinds.PrimaryBroker;
} else if (!ctrl.kinds.PrimaryBroker && ctrl.showLiveBrokers) { } else if (!ctrl.kinds.PrimaryBroker && ctrl.showPrimaryBrokers) {
ctrl.kinds.PrimaryBroker = true; ctrl.kinds.PrimaryBroker = true;
} }
} }
$scope.$watch('$ctrl.showLiveBrokers', function () { $scope.$watch('$ctrl.showPrimaryBrokers', function () {
updateLiveBrokerKind(); updateLiveBrokerKind();
}); });
function updateBackupBrokerKind() { function updateBackupBrokerKind() {
@ -418,7 +418,7 @@ var Artemis;
var val = atts.value; var val = atts.value;
var details = Core.parseMBean(mBean); var details = Core.parseMBean(mBean);
var cntLiveBrokers = 0; var cntPrimaryBrokers = 0;
var cntBackupBrokers = 0; var cntBackupBrokers = 0;
if (details) { if (details) {
@ -439,13 +439,13 @@ var Artemis;
// use the broker-name when nothing else is available // use the broker-name when nothing else is available
thisBroker = { thisBroker = {
backup: isBackup ? properties.broker.replace(/["]+/g, "") : undefined, backup: isBackup ? properties.broker.replace(/["]+/g, "") : undefined,
live: isBackup ? undefined : properties.broker.replace(/["]+/g, "") primary: isBackup ? undefined : properties.broker.replace(/["]+/g, "")
}; };
// prevent confusion between this thisBroker and one of the brokers // prevent confusion between this thisBroker and one of the brokers
// listed in the connectors-list that we expand below // listed in the connectors-list that we expand below
val.Connectors = []; val.Connectors = [];
} }
if (thisBroker.live) { if (thisBroker.primary) {
ctrl.items[thisBroker.primary] = { ctrl.items[thisBroker.primary] = {
"name": thisBroker.primary.replace(/:6161[67]$/, ""), "name": thisBroker.primary.replace(/:6161[67]$/, ""),
"kind": isBackup ? "PrimaryBroker" : "ThisPrimaryBroker", "kind": isBackup ? "PrimaryBroker" : "ThisPrimaryBroker",
@ -454,7 +454,7 @@ var Artemis;
"display_kind": "Server", "display_kind": "Server",
"mbean": isBackup ? undefined : mBean "mbean": isBackup ? undefined : mBean
} }
cntLiveBrokers += 1; cntPrimaryBrokers += 1;
} }
if (thisBroker.backup) { if (thisBroker.backup) {
ctrl.items[thisBroker.backup] = { ctrl.items[thisBroker.backup] = {
@ -478,7 +478,7 @@ var Artemis;
angular.forEach(remoteBrokers, function (remoteBroker) { angular.forEach(remoteBrokers, function (remoteBroker) {
if (nodeId != remoteBroker.nodeID) { if (nodeId != remoteBroker.nodeID) {
if (remoteBroker.live) { if (remoteBroker.primary) {
ctrl.items[remoteBroker.primary] = { ctrl.items[remoteBroker.primary] = {
"name": remoteBroker.primary.replace(/:6161[67]$/, ""), "name": remoteBroker.primary.replace(/:6161[67]$/, ""),
"kind": "PrimaryBroker", "kind": "PrimaryBroker",
@ -486,7 +486,7 @@ var Artemis;
"status": "broker", "status": "broker",
"display_kind": "Server" "display_kind": "Server"
}; };
cntLiveBrokers += 1; cntPrimaryBrokers += 1;
//if we arent a backup then connect to it as we are in the cluster //if we arent a backup then connect to it as we are in the cluster
if(!isBackup) {} if(!isBackup) {}
ctrl.relations.push({ ctrl.relations.push({
@ -530,7 +530,7 @@ var Artemis;
} }
// reduce the checkbox-list by updating their visibility // reduce the checkbox-list by updating their visibility
ctrl.cntLiveBrokers = cntLiveBrokers; ctrl.cntPrimaryBrokers = cntPrimaryBrokers;
ctrl.cntBackupBrokers = cntBackupBrokers; ctrl.cntBackupBrokers = cntBackupBrokers;
ctrl.cntAddresses = val.AddressNames.filter(name => !isInternalName(name, 0)).length; ctrl.cntAddresses = val.AddressNames.filter(name => !isInternalName(name, 0)).length;
ctrl.cntInternalAddresses = val.AddressNames.filter(name => isInternalName(name, 0)).length; ctrl.cntInternalAddresses = val.AddressNames.filter(name => isInternalName(name, 0)).length;