From fb4ab9f09df8290c00a33c509cb26fac098ac8e6 Mon Sep 17 00:00:00 2001 From: Keith Wall Date: Thu, 7 Aug 2014 17:05:30 +0000 Subject: QPID-5972: [Java Broker] Web UI to edit actual attribute values rather than effective values Work completed by Andrew MacBean and me. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1616543 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/resources/addAuthenticationProvider.html | 4 +- .../src/main/java/resources/addPort.html | 9 ++-- .../addVirtualHostNodeAndVirtualHost.html | 3 +- .../src/main/java/resources/editVirtualHost.html | 24 +++------- .../src/main/java/resources/js/qpid/common/util.js | 22 ++++++++++ .../java/resources/js/qpid/management/Broker.js | 31 ++++++++----- .../java/resources/js/qpid/management/KeyStore.js | 6 ++- .../qpid/management/PreferencesProviderFields.js | 5 ++- .../resources/js/qpid/management/TrustStore.js | 8 +++- .../qpid/management/addAuthenticationProvider.js | 5 ++- .../resources/js/qpid/management/addKeystore.js | 10 ++--- .../java/resources/js/qpid/management/addPort.js | 19 +++++--- .../management/addVirtualHostNodeAndVirtualHost.js | 6 ++- .../js/qpid/management/editVirtualHost.js | 20 +++++++-- .../js/qpid/management/editVirtualHostNode.js | 2 +- .../management/virtualhost/providedstore/add.js | 6 ++- .../management/virtualhost/providedstore/edit.js | 34 +++++++++++++++ .../resources/showPreferencesProviderFields.html | 2 +- .../resources/virtualhost/providedstore/add.html | 10 ++--- .../resources/virtualhost/providedstore/edit.html | 51 ++++++++++++++++++++++ .../resources/virtualhost/sizemonitoring/add.html | 10 ++--- .../resources/virtualhost/sizemonitoring/edit.html | 10 ++--- 22 files changed, 220 insertions(+), 77 deletions(-) create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js create mode 100644 qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html (limited to 'qpid/java/broker-plugins/management-http/src') diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html index 13960715a6..e90262f17b 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addAuthenticationProvider.html @@ -26,8 +26,8 @@ Name*: + id="formAddAuthenticationProvider.name" placeholder="Name" + dojoType="dijit.form.ValidationTextBox" missingMessage="A name must be supplied" /> diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html index dab8541b65..69d49248b8 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/addPort.html @@ -26,10 +26,11 @@
- + missingMessage="A name must be supplied"/> + +
@@ -55,11 +53,9 @@
Idle Timeout Close:
-
@@ -67,11 +63,9 @@
Open Timeout Warn:
-
@@ -79,11 +73,9 @@
Open Timeout Close:
-
@@ -97,11 +89,9 @@
Check period (ms):
-
@@ -109,11 +99,9 @@
Thread count:
-
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js index e4b3ed5dbc..1a89bfb374 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/common/util.js @@ -636,5 +636,27 @@ define(["dojo/_base/xhr", } } + var singleContextVarRegexp = "(\\${[\\w\\.\\-]+})"; + + util.numericOrContextVarRegexp = function(constraints) + { + return "^(\\d+)|" + singleContextVarRegexp + "$"; + } + + util.nameOrContextVarRegexp = function(constraints) + { + return "^(\\w+)|" + singleContextVarRegexp + "$"; + } + + util.jdbcUrlOrContextVarRegexp = function(constraints) + { + return "^(jdbc:.*:.*)|" + singleContextVarRegexp + "$"; + } + + util.nodeAddressOrContextVarRegexp = function(constraints) + { + return "^(([0-9a-zA-Z.-_]|::)+:[0-9]{1,5})|" + singleContextVarRegexp + "$"; + } + return util; }); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js index 3ae4537807..11a79984b3 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/Broker.js @@ -55,6 +55,7 @@ define(["dojo/_base/xhr", this.name = name; this.controller = controller; this.modelObj = { type: "broker", name: name }; + if(parent) { this.modelObj.parent = {}; this.modelObj.parent[ parent.type] = parent; @@ -64,6 +65,8 @@ define(["dojo/_base/xhr", createWidget: function(brokerData) { return new dijit.form.ValidationTextBox({ required: true, + trim: true, + regExpGen: util.nameOrContextVarRegexp, value: brokerData.name, label: "Name*:", name: "name"}) @@ -93,7 +96,7 @@ define(["dojo/_base/xhr", createWidget: function(brokerData) { return new dijit.form.ValidationTextBox({ trim: "true", - regexp: "[0-9]+", + regExpGen: util.numericOrContextVarRegexp, invalidMessage: "Invalid value", required: false, value: brokerData.statisticsReportingPeriod, @@ -117,12 +120,12 @@ define(["dojo/_base/xhr", groupName: "Global Connection Defaults", createWidget: function(brokerData) { - return new dijit.form.NumberSpinner({ + return new dijit.form.ValidationTextBox({ + trim: "true", + regExpGen: util.numericOrContextVarRegexp, invalidMessage: "Invalid value", required: false, value: brokerData["connection.sessionCountLimit"], - smallDelta: 1, - constraints: {min:1,max:65535,places:0, pattern: "#####"}, label: "Maximum number of sessions:", name: "connection.sessionCountLimit" }); @@ -132,7 +135,7 @@ define(["dojo/_base/xhr", createWidget: function(brokerData) { return new dijit.form.ValidationTextBox({ trim: "true", - regexp: "[0-9]+", + regExpGen: util.numericOrContextVarRegexp, invalidMessage: "Invalid value", required: false, value: brokerData["connection.heartBeatDelay"], @@ -221,11 +224,19 @@ define(["dojo/_base/xhr", var editButton = query(".editBroker", contentPane.containerNode)[0]; connect.connect(registry.byNode(editButton), "onClick", function(evt){ - util.showSetAttributesDialog( - that.attributeWidgetFactories, - that.brokerUpdater.brokerData, - "api/latest/broker", - "Set broker attributes"); + var query = "api/latest/broker"; + + xhr.get({url: query, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true, depth: 2 }}) + .then(function(data) + { + var brokerData = data[0]; + + util.showSetAttributesDialog( + that.attributeWidgetFactories, + brokerData, + query, + "Set broker attributes"); + }); } ); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js index f73837ba7d..667c83c6ea 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/KeyStore.js @@ -71,7 +71,11 @@ define(["dojo/dom", var node = registry.byNode(editKeyStoreButton); connect.connect(node, "onClick", function(evt){ - that.dialog(that.keyStoreUpdater.keyStoreData) + xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) + .then(function(data) + { + that.dialog(data[0], that.url); + }); }); }}); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js index 1adcbd1ff1..1fa1d603de 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/PreferencesProviderFields.js @@ -31,9 +31,10 @@ define(["dojo/_base/xhr", "dojox/html/entities", "dojo/text!../../showPreferencesProviderFields.html", "dojo/text!service/helper?action=ListPreferencesProvidersTypes", + "qpid/common/util", "dojox/validate/us", "dojox/validate/web", - "dojo/domReady!"], function (xhr, dom, query, parser, string, json, Memory, registry, FilteringSelect, ValidationTextBox, entities, template, preferencesProvidersTypes) { + "dojo/domReady!"], function (xhr, dom, query, parser, string, json, Memory, registry, FilteringSelect, ValidationTextBox, entities, template, preferencesProvidersTypes, util) { var PreferencesProviderFields = {}; @@ -114,6 +115,7 @@ define(["dojo/_base/xhr", this.fieldsContainer = query(".preferencesProviderFieldsContainer", node)[0]; this.type = registry.byNode(query(".preferencesProviderType", node)[0]); this.name = registry.byNode(query(".preferencesProviderName", node)[0]); + this.name.set("regExpGen", util.nameOrContextVarRegexp); this.id = query("input[name='preferencesProviderId']", node)[0]; this.id.value = null; this.type.set("store", new Memory({ data: types, idProperty: "id"})); @@ -132,6 +134,7 @@ define(["dojo/_base/xhr", xhr.get({ url: "api/latest/preferencesprovider/" +encodeURIComponent(authenticationProviderName) + "/" + encodeURIComponent(provider), sync: true, + content: { actuals: true }, handleAs: "json" }).then(function(data){if (data && data[0]) { that.init(data[0]);}}); } diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js index 14c51f3276..dfe276cae2 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/TrustStore.js @@ -71,11 +71,17 @@ define(["dojo/dom", var node = registry.byNode(editTrustStoreButton); connect.connect(node, "onClick", function(evt){ - that.dialog(that.keyStoreUpdater.keyStoreData) + xhr.get({url: that.url, sync: properties.useSyncGet, handleAs: "json", content: { actuals: true }}) + .then(function(data) + { + that.dialog(data[0], that.url); + }); }); }}); }; + + TrustStore.prototype.close = function() { updater.remove( this.keyStoreUpdater ); }; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js index 969a8ffd90..30bd4c22d0 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addAuthenticationProvider.js @@ -32,6 +32,7 @@ define(["dojo/_base/xhr", "dojo/_base/connect", "dojo/dom-style", "qpid/management/PreferencesProviderFields", + "qpid/common/util", /* dojox/ validate resources */ "dojox/validate/us", "dojox/validate/web", /* basic dijit classes */ @@ -45,7 +46,7 @@ define(["dojo/_base/xhr", "dojox/form/BusyButton", "dojox/form/CheckedMultiSelect", "dojox/layout/TableContainer", "dojo/domReady!"], - function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, PreferencesProviderFields) { + function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, FilteringSelect, connect, domStyle, PreferencesProviderFields, util) { var addAuthenticationProvider = {}; @@ -126,6 +127,7 @@ define(["dojo/_base/xhr", { xhr.get({ url: "api/latest/authenticationprovider/" + encodeURIComponent(providerName), + content: { actuals: true }, handleAs: "json" }).then( function(data) { @@ -134,6 +136,7 @@ define(["dojo/_base/xhr", var nameField = dijit.byId("formAddAuthenticationProvider.name"); nameField.set("value", provider.name); nameField.set("disabled", true); + nameField.set("regExpGen", util.nameOrContextVarRegexp); dialog.providerChooser.set("value", providerType); dialog.providerChooser.set("disabled", true); dojo.byId("formAddAuthenticationProvider.id").value=provider.id; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js index 2d99f97837..0ec8fb6c6c 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addKeystore.js @@ -56,7 +56,7 @@ define(["dojo/_base/lang", value: keystore.name, disabled: keystore.name ? true : false, label: "Name:", - regexp: "^[\x20-\x2e\x30-\x7F]{1,255}$", + regExpGen: util.nameOrContextVarRegexp, name: "name"}); } }, { @@ -140,23 +140,23 @@ define(["dojo/_base/lang", return fields; } - addKeystore.showKeystoreDialog = function(keystore) { + addKeystore.showKeystoreDialog = function(keystore, putURL) { var keystoreAttributeWidgetFactories = addKeystore.createWidgetFactories(true); util.showSetAttributesDialog( keystoreAttributeWidgetFactories, keystore ? keystore : {}, - "api/latest/keystore" + (keystore ? "/" + encodeURIComponent(keystore.name) : ""), + keystore ? putURL : "api/latest/keystore", keystore ? "Edit keystore - " + keystore.name : "Add keystore", keystore ? false : true); }; - addKeystore.showTruststoreDialog = function(truststore) { + addKeystore.showTruststoreDialog = function(truststore, putURL) { var truststoreAttributeWidgetFactories = addKeystore.createWidgetFactories(false); util.showSetAttributesDialog( truststoreAttributeWidgetFactories, truststore ? truststore : {}, - "api/latest/truststore" + (truststore ? "/" + encodeURIComponent(truststore.name) : ""), + truststore ? putURL : "api/latest/truststore", truststore ? "Edit truststore - " + truststore.name : "Add truststore", truststore ? false : true); }; 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 a3e1160dc1..34e2d58afb 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 @@ -32,6 +32,7 @@ define(["dojo/_base/xhr", "dijit/form/FilteringSelect", "dojo/dom-style", "dojo/_base/lang", + "qpid/common/util", /* dojox/ validate resources */ "dojox/validate/us", "dojox/validate/web", @@ -54,7 +55,7 @@ define(["dojo/_base/xhr", "dojox/grid/EnhancedGrid", "dojox/grid/enhanced/plugins/IndirectSelection", "dojo/domReady!"], - function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, ObjectStore, FilteringSelect, domStyle, lang) { + function (xhr, dom, construct, win, registry, parser, array, event, json, Memory, ObjectStore, FilteringSelect, domStyle, lang, util) { var addPort = {}; @@ -314,7 +315,7 @@ define(["dojo/_base/xhr", var newPort = convertToPort(theForm.getValues()); if ((newPort.needClientAuth || newPort.wantClientAuth) && (!newPort.hasOwnProperty("trustStores") || newPort.trustStores.length==0)) { - alert("A trustore must be selected when requesting client certificates."); + alert("A trust store must be selected when requesting client certificates."); return false; } var that = this; @@ -399,13 +400,15 @@ define(["dojo/_base/xhr", xhr.get({ url: "api/latest/port/" + encodeURIComponent(portName), + content: { actuals: true }, handleAs: "json" }).then( function(data){ var port = data[0]; - var nameField = registry.byId("formAddPort.name"); - nameField.set("value", port.name); - nameField.set("disabled", true); + var nameWidget = registry.byId("formAddPort.name"); + nameWidget.set("value", port.name); + nameWidget.set("disabled", true); + nameWidget.set("regExpGen", util.nameOrContextVarRegexp); dom.byId("formAddPort.id").value=port.id; providerWidget.set("value", port.authenticationProvider ? port.authenticationProvider : ""); keystoreWidget.set("value", port.keyStore ? port.keyStore : ""); @@ -430,7 +433,11 @@ define(["dojo/_base/xhr", var transportWidget = registry.byId("formAddPort.transports"); transportWidget.set("value", port.transports); - registry.byId("formAddPort.port").set("value", port.port); + + var portWidget = registry.byId("formAddPort.port"); + portWidget.set("value", port.port); + portWidget.set("regExpGen", util.numericOrContextVarRegexp); + var protocols = port.protocols; var typeWidget = registry.byId("formAddPort.type"); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js index 884290eed4..2eac2094e5 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/addVirtualHostNodeAndVirtualHost.js @@ -33,6 +33,7 @@ define(["dojo/_base/xhr", "dijit/form/Button", "dijit/form/FilteringSelect", "qpid/common/properties", + "qpid/common/util", "dojo/text!addVirtualHostNodeAndVirtualHost.html", "dijit/form/Form", "dijit/form/CheckBox", @@ -40,7 +41,7 @@ define(["dojo/_base/xhr", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!"], - function (xhr, event, lang, array, dom, domConstruct, json, parser, Memory, fobject, registry, Dialog, Button, FilteringSelect, properties, template) + function (xhr, event, lang, array, dom, domConstruct, json, parser, Memory, fobject, registry, Dialog, Button, FilteringSelect, properties, util, template) { var addVirtualHostNodeAndVirtualHost = @@ -51,6 +52,9 @@ define(["dojo/_base/xhr", this.containerNode = domConstruct.create("div", {innerHTML: template}); parser.parse(this.containerNode); + var virtualHostNodeName = registry.byId("addVirtualHostNode.nodeName"); + virtualHostNodeName.set("regExpGen", util.nameOrContextVarRegexp); + this.dialog = registry.byId("addVirtualHostNodeAndVirtualHost"); this.addButton = registry.byId("addVirtualHostNodeAndVirtualHost.addButton"); this.cancelButton = registry.byId("addVirtualHostNodeAndVirtualHost.cancelButton"); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js index c2f35ac9ec..1a24e5e770 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHost.js @@ -40,13 +40,14 @@ define(["dojo/_base/xhr", "dijit/form/ValidationTextBox", "dijit/form/Button", "dijit/form/Form", - "dijit/form/NumberSpinner", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!"], function (xhr, entities, array, event, lang, win, dom, domConstruct, registry, parser, json, query, Memory, ObjectStore, util, template) { var fields = [ "name", "queue.deadLetterQueueEnabled", "storeTransactionIdleTimeoutWarn", "storeTransactionIdleTimeoutClose", "storeTransactionOpenTimeoutWarn", "storeTransactionOpenTimeoutClose", "housekeepingCheckPeriod", "housekeepingThreadCount"]; + var numericFieldNames = ["storeTransactionIdleTimeoutWarn", "storeTransactionIdleTimeoutClose", "storeTransactionOpenTimeoutWarn", "storeTransactionOpenTimeoutClose", "housekeepingCheckPeriod", "housekeepingThreadCount"]; + var virtualHostEditor = { @@ -77,6 +78,7 @@ define(["dojo/_base/xhr", { url: this.query, sync: true, + content: { actuals: true }, handleAs: "json", load: function(data) { @@ -137,20 +139,30 @@ define(["dojo/_base/xhr", }, _show:function(virtualHostData) { + this.initialData = virtualHostData; for(var i = 0; i < fields.length; i++) { var fieldName = fields[i]; - if (this[fieldName] instanceof dijit.form.CheckBox) + var widget = this[fieldName]; + widget.reset(); + + if (widget instanceof dijit.form.CheckBox) { - this[fieldName].set("checked", virtualHostData[fieldName]); + widget.set("checked", virtualHostData[fieldName]); } else { - this[fieldName].set("value", virtualHostData[fieldName]); + widget.set("value", virtualHostData[fieldName]); } } + // Add regexp to the numeric fields + for(var i = 0; i < numericFieldNames.length; i++) + { + this[numericFieldNames[i]].set("regExpGen", util.numericOrContextVarRegexp); + } + var that = this; var widgets = registry.findWidgets(this.typeFieldsContainer); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js index e56e34ef41..704063ae16 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/editVirtualHostNode.js @@ -40,7 +40,6 @@ define(["dojo/_base/xhr", "dijit/form/ValidationTextBox", "dijit/form/Button", "dijit/form/Form", - "dijit/form/NumberSpinner", "dojox/validate/us", "dojox/validate/web", "dojo/domReady!"], @@ -71,6 +70,7 @@ define(["dojo/_base/xhr", { url: this.query, sync: true, + content: { actuals: true }, handleAs: "json", load: function(data) { diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js index e2f3fe35b7..7d14c6450f 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/add.js @@ -24,9 +24,10 @@ define(["dojo/_base/xhr", "dojo/json", "dijit/registry", "dojo/text!virtualhost/providedstore/add.html", + "qpid/common/util", "dijit/form/ValidationTextBox", "dojo/domReady!"], - function (xhr, parser, dom, domConstruct, json, registry, template) + function (xhr, parser, dom, domConstruct, json, registry, template, util) { return { show: function (data) @@ -34,6 +35,9 @@ define(["dojo/_base/xhr", this.containerNode = domConstruct.create("div", {innerHTML: template}, data.containerNode); parser.parse(this.containerNode); + registry.byId("addVirtualHost.storeUnderfullSize").set("regExpGen", util.numericOrContextVarRegexp); + registry.byId("addVirtualHost.storeOverfullSize").set("regExpGen", util.numericOrContextVarRegexp); + if (data.parent.virtualHostNodeType.value == "JDBC") { dom.byId("addVirtualHost.diskFlowControls").style.display = "none"; diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js new file mode 100644 index 0000000000..6264d81335 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/js/qpid/management/virtualhost/providedstore/edit.js @@ -0,0 +1,34 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +define(["dijit/registry", "qpid/common/util", "dojo/domReady!"], + function (registry, util) + { + var fieldNames = ["storeUnderfullSize", "storeOverfullSize"]; + return { + show: function(data) + { + util.buildEditUI(data.containerNode, "virtualhost/providedstore/edit.html", "editVirtualHost.", fieldNames, data.data); + + registry.byId("editVirtualHost.storeUnderfullSize").set("regExpGen", util.numericOrContextVarRegexp); + registry.byId("editVirtualHost.storeOverfullSize").set("regExpGen", util.numericOrContextVarRegexp); + } + }; + } +); diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html index 5c5bdaefef..f15a3a71b8 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/showPreferencesProviderFields.html @@ -33,7 +33,7 @@ Name*: + data-dojo-props="placeHolder: 'Name', required: true, missingMessage: 'A name must be supplied', title: 'Enter name'" />
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html index de0c2aaa21..320f056cef 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/add.html @@ -23,26 +23,24 @@
Store overfull size:
+ title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" />
Store underfull size:
+ title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" />
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html new file mode 100644 index 0000000000..ec02c67ff4 --- /dev/null +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/providedstore/edit.html @@ -0,0 +1,51 @@ + + +
+ +
+
Store overfull size (bytes):
+
+ +
+
+
+
Store underfull size (bytes):
+
+ +
+
+ +
+ +
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html index 522d2b3abf..7cf789e520 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/add.html @@ -35,26 +35,24 @@
Store overfull size:
+ title: 'Enter ceiling (in bytes) at which store will begin to throttle sessions producing messages'" />
Store underfull size:
+ title: 'Enter floor (in bytes) at which store will cease to throttle sessions producing messages'" />
diff --git a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html index 937f036445..9e240a83c4 100644 --- a/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html +++ b/qpid/java/broker-plugins/management-http/src/main/java/resources/virtualhost/sizemonitoring/edit.html @@ -37,28 +37,26 @@
Store overfull size (bytes):
-
Store underfull size (bytes):
-
-- cgit v1.2.1