diff --git a/ui/css/cloudstack3.css b/ui/css/cloudstack3.css index 9b77b9f3a4f..8ae54edef00 100644 --- a/ui/css/cloudstack3.css +++ b/ui/css/cloudstack3.css @@ -7022,6 +7022,42 @@ label.error { max-width: 91px; } +/*** Add multiple pod ranges form*/ +.multi-wizard.zone-wizard .add-pod .info-desc { + margin-bottom: 26px; +} + +.multi-wizard.zone-wizard .pod-edit { +} + +.multi-wizard.zone-wizard .pod-edit span.message { + display: none; + text-decoration: underline; +} + +.multi-wizard.zone-wizard .pod-edit .form-container { + height: 36px; +} + +.multi-wizard.zone-wizard .pod-edit .form-container form { +} + +.multi-wizard.zone-wizard .pod-edit .form-container form { +} + +.multi-wizard.zone-wizard .pod-edit .form-container .form-item .name label { + width: 51px; +} + +.multi-wizard.zone-wizard .pod-edit .form-container .form-item .name { + width: 58px; +} + +.multi-wizard.zone-wizard .pod-edit .multi-edit .data-body { + height: 209px; + overflow: auto; +} + /*** Select container fields*/ .multi-wizard.zone-wizard .select-container .field { width: 100%; diff --git a/ui/index.jsp b/ui/index.jsp index 3b8f37886ef..31452440606 100644 --- a/ui/index.jsp +++ b/ui/index.jsp @@ -659,8 +659,7 @@ under the License.
-
+
+ diff --git a/ui/scripts/ui-custom/podEdit.js b/ui/scripts/ui-custom/podEdit.js new file mode 100644 index 00000000000..d33cd97d210 --- /dev/null +++ b/ui/scripts/ui-custom/podEdit.js @@ -0,0 +1,66 @@ +// 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. +(function(cloudStack, $) { + cloudStack.uiCustom.podEdit = function(args) { + var $podEdit = $('
').addClass('pod-edit'); + var multiEditData = []; + var totalIndex = 0; + var form = cloudStack.dialog.createForm({ + noDialog: true, + desc: '', + form: { + desc: '', + fields: args.form.fields + } + }); + var $multi = $('
').multiEdit($.extend(true, {}, args.multiEdit, { + context: args.context, + noSelect: true, + add: { + label: 'label.add', + action: function(args) { + multiEditData.push($.extend(args.data, { + index: totalIndex + })); + + totalIndex++; + args.response.success(); + } + }, + actions: { + destroy: { + label: 'label.remove.rule', + action: function(args) { + multiEditData = $.grep(multiEditData, function(item) { + return item.index != args.context.multiRule[0].index; + }); + args.response.success(); + } + } + }, + dataProvider: function(args) { + args.response.success({ + data: multiEditData + }); + } + })); + + $podEdit.append(form.$formContainer, $multi); + + return $podEdit; + }; +}(window.cloudStack, window.jQuery)); \ No newline at end of file diff --git a/ui/scripts/zoneWizard.js b/ui/scripts/zoneWizard.js index 5108c5c0c3b..79f0643fde1 100755 --- a/ui/scripts/zoneWizard.js +++ b/ui/scripts/zoneWizard.js @@ -121,6 +121,31 @@ }, customUI: { + podIPRange: function(args) { + return cloudStack.uiCustom.podEdit({ + form: { + fields: { + name: { + label: 'label.name', + validation: { required: true }, + desc: 'message.tooltip.pod.name' + } + } + }, + multiEdit: { + noSelect: true, + fields: { + 'gateway': { edit: true, label: 'label.gateway' }, + 'netmask': { edit: true, label: 'label.netmask' }, + 'vlanid': { edit: true, label: 'label.vlan', isOptional: true }, + 'startip': { edit: true, label: 'label.start.IP' }, + 'endip': { edit: true, label: 'label.end.IP' }, + 'add-rule': { label: 'label.add', addButton: true } + } + } + }); + }, + publicTrafficIPRange: function(args) { var multiEditData = []; var totalIndex = 0;