anmolbabu has uploaded a new change for review. Change subject: gluster-nagios-monitoring : messageOrigin url formation fixed ......................................................................
gluster-nagios-monitoring : messageOrigin url formation fixed This patch fixes the message origin url formation by appending the port address to the url if and only if the the $location has port address and the port address is present in the $location absolute url. Change-Id: I2dd11b3accc83fe4a603a930c4fcaf9c3261a271 Signed-off-by: Anmol Babu <anb...@redhat.com> --- M gluster-nagios-monitoring/src/js/dashboard-init.js M gluster-nagios-monitoring/src/js/trends.js 2 files changed, 2 insertions(+), 2 deletions(-) git pull ssh://gerrit.ovirt.org:29418/samples-uiplugins refs/changes/96/27396/1 diff --git a/gluster-nagios-monitoring/src/js/dashboard-init.js b/gluster-nagios-monitoring/src/js/dashboard-init.js index c8b43aa..d66ea3a 100644 --- a/gluster-nagios-monitoring/src/js/dashboard-init.js +++ b/gluster-nagios-monitoring/src/js/dashboard-init.js @@ -63,7 +63,7 @@ bootstrapPlugin: function () { var messageOrigin; if(!pluginApi.configObject().messageOrigins || !pluginApi.configObject()){ - messageOrigin = $location.protocol() + "://" + $location.host() + ":" +((!$location.port()) ? "" : $location.port()); + messageOrigin = $location.protocol() + "://" + $location.host() + ((($location.port()) && ($location.absUrl().indexOf($location.port().toString()) > 0)) ? ":" + $location.port() : ""); } else { messageOrigin = pluginApi.configObject().messageOrigins; } diff --git a/gluster-nagios-monitoring/src/js/trends.js b/gluster-nagios-monitoring/src/js/trends.js index e2e29f6..ba4d0e2 100644 --- a/gluster-nagios-monitoring/src/js/trends.js +++ b/gluster-nagios-monitoring/src/js/trends.js @@ -164,7 +164,7 @@ */ var pnp4NagiosUrl = ""; if((!configObject.pnp4nagiosUrl) || (!configObject)) { - pnp4NagiosUrl = $location.protocol() + "://" + $location.host() + ":" + ((!$location.port()) ? "" : $location.port()); + pnp4NagiosUrl = $location.protocol() + "://" + $location.host() + ((($location.port()) && ($location.absUrl().indexOf($location.port().toString()) > 0)) ? ":" + $location.port() : ""); } else { pnp4NagiosUrl = configObject.pnp4nagiosUrl; } -- To view, visit http://gerrit.ovirt.org/27396 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I2dd11b3accc83fe4a603a930c4fcaf9c3261a271 Gerrit-PatchSet: 1 Gerrit-Project: samples-uiplugins Gerrit-Branch: master Gerrit-Owner: anmolbabu <anb...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches