diff options
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.js | 28 |
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'); |