You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by or...@apache.org on 2013/04/24 15:35:27 UTC
svn commit: r1471409 - in
/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources:
index.html js/qpid/common/util.js js/qpid/management/treeView.js
Author: orudyy
Date: Wed Apr 24 13:35:27 2013
New Revision: 1471409
URL: http://svn.apache.org/r1471409
Log:
QPID-4773: Add functionality to display information about http errors which might occur when communicating with the broker
Modified:
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html?rev=1471409&r1=1471408&r2=1471409&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/index.html Wed Apr 24 13:35:27 2013
@@ -85,6 +85,22 @@
<div data-dojo-type="dijit.layout.ContentPane" data-dojo-props="region:'bottom'">
<div qpid-type="footer"></div>
</div>
+
+ <div class="dijitHidden">
+ <div data-dojo-type="dijit.Dialog" data-dojo-props="title: 'Connection Error'" id="errorDialog">
+ <div style="width:400px; overflow: auto">
+ <div><strong><span id="errorMessage">An error occurred when communicating with the broker.</span></strong></div>
+ <div><span id="statusMessage"></span></div>
+ <div style="margin-top: 10px; margin-bottom: 8px"><span id="reloadMessage">Please try to reload.</span></div>
+ <div id="errorDetails" data-dojo-type="dijit.TitlePane" data-dojo-props="title: 'Details', open:false">
+ <span id="errorDetailsMessage"></span>
+ </div>
+ </div>
+ <div class="dijitDialogPaneActionBar">
+ <input type="button" value="Close" label="Close" dojoType="dijit.form.Button" onClick="dijit.byId('errorDialog').hide();"/>
+ </div>
+ </div>
+ </div>
</div>
</body>
Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js?rev=1471409&r1=1471408&r2=1471409&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js Wed Apr 24 13:35:27 2013
@@ -309,8 +309,49 @@ define(["dojo/_base/xhr",
var maxHeight = Math.max(Math.floor(viewport.h * 0.6), 100);
dialogContentArea.style.overflow= "auto";
dialogContentArea.style.height = Math.min(aproximateHeight, maxHeight ) + "px";
+ setAttributesDialog.on("hide", function(e){setAttributesDialog.destroy();});
setAttributesDialog.show();
};
+ util.xhrErrorHandler = function(error)
+ {
+ if (error)
+ {
+ if (error.hasOwnProperty("status"))
+ {
+ if (error.status == 401)
+ {
+ dojo.byId("statusMessage").innerHTML = "401 - Authentication required.";
+ }
+ else if (error.status == 403)
+ {
+ dojo.byId("statusMessage").innerHTML = "403 - Access denied.";
+ }
+ else
+ {
+ dojo.byId("statusMessage").innerHTML = "HTTP status code: " + error.status;
+ }
+ }
+ else
+ {
+ dojo.byId("statusMessage").innerHTML = "";
+ }
+ if (error.hasOwnProperty("message"))
+ {
+ dojo.byId("errorDetailsMessage").innerHTML = error.message;
+ dojo.byId("errorDetails").style.display = "block";
+ }
+ else
+ {
+ dojo.byId("errorDetails").style.display = "none";
+ }
+ var dialog = dijit.byId("errorDialog");
+ if (!dialog.open)
+ {
+ dialog.show();
+ }
+ }
+ };
+
return util;
});
\ No newline at end of file
Modified: qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js?rev=1471409&r1=1471408&r2=1471409&view=diff
==============================================================================
--- qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js (original)
+++ qpid/trunk/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/treeView.js Wed Apr 24 13:35:27 2013
@@ -42,7 +42,6 @@ define(["dojo/_base/xhr",
this.onDelete = function (object) {
// fired when an object is deleted
};
-
}
@@ -297,7 +296,7 @@ define(["dojo/_base/xhr",
else {
thisObj.buildModel(data);
}
- });
+ }, util.xhrErrorHandler);
};
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org