summaryrefslogtreecommitdiff
path: root/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
diff options
context:
space:
mode:
authorKeith Wall <kwall@apache.org>2015-03-12 14:13:28 +0000
committerKeith Wall <kwall@apache.org>2015-03-12 14:13:28 +0000
commite8e05131324cf3137a3c65a95cad833cd3275c78 (patch)
treee4ad0110b5696cef4282b29eb02cc4257f03f2d2 /qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
parent657ad54bf98f740fb37405daeaa95a95754841f5 (diff)
downloadqpid-python-e8e05131324cf3137a3c65a95cad833cd3275c78.tar.gz
Merge from trunk
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/QPID-6262-JavaBrokerNIO@1666200 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js')
-rw-r--r--qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js28
1 files changed, 2 insertions, 26 deletions
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
index befb5df9c1..1069e2300b 100644
--- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
+++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addPort.js
@@ -267,33 +267,9 @@ define(["dojo/_base/xhr",
alert("A trust store must be selected when requesting client certificates.");
return false;
}
- var that = this;
-
- xhr.put({url: "api/latest/port/" + encodeURIComponent(newPort.name), sync: true, handleAs: "json",
- headers: { "Content-Type": "application/json"},
- putData: json.toJson(newPort),
- load: function (x)
- {
- that.success = true;
- },
- error: function (error)
- {
- that.success = false;
- that.failureReason = error;
- }});
-
- if (this.success === true)
- {
- registry.byId("addPort").hide();
- }
- else
- {
- util.xhrErrorHandler(this.failureReason);
- }
-
+ var method = registry.byId("formAddPort.name").get("disabled") ? "put" : "post";
+ util[method]("api/latest/port/" + encodeURIComponent(newPort.name), newPort, function(x){registry.byId("addPort").hide()});
return false;
-
-
} else
{
alert('Form contains invalid data. Please correct first');