mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-15 18:12:35 +01:00
CLOUDSTACK-3487: Add egress default policy to network offering UI
This commit is contained in:
parent
43dc85cea1
commit
f06ad9bcae
@ -14,6 +14,7 @@
|
||||
# KIND, either express or implied. See the License for the
|
||||
# specific language governing permissions and limitations
|
||||
# under the License.
|
||||
label.egress.default.policy=Egress Default Policy
|
||||
label.routing=Routing
|
||||
label.about=About
|
||||
label.app.name=CloudStack
|
||||
|
||||
@ -25,6 +25,7 @@ under the License.
|
||||
<% long now = System.currentTimeMillis(); %>
|
||||
<script language="javascript">
|
||||
dictionary = {
|
||||
'label.egress.default.policy': '<fmt:message key="label.egress.default.policy" />',
|
||||
'label.routing': '<fmt:message key="label.routing" />',
|
||||
'message.validate.invalid.characters': '<fmt:message key="message.validate.invalid.characters" />',
|
||||
'label.about': '<fmt:message key="label.about" />',
|
||||
|
||||
@ -1932,6 +1932,12 @@
|
||||
args.$form.find('.form-item[rel=\"service.Lb.inlineModeDropdown\"]').hide();
|
||||
}
|
||||
|
||||
if (args.$form.find('.form-item[rel=\"service.Firewall.isEnabled\"] input[type=checkbox]').is(':checked') == true) {
|
||||
args.$form.find('.form-item[rel=\"egresspolicy\"]').css('display', 'inline-block');
|
||||
} else {
|
||||
args.$form.find('.form-item[rel=\"egresspolicy\"]').css('display', 'none');
|
||||
}
|
||||
|
||||
//show LB Isolation dropdown only when (1)LB Service is checked (2)Service Provider is Netscaler OR F5
|
||||
if ((args.$form.find('.form-item[rel=\"service.Lb.isEnabled\"]').find('input[type=checkbox]').is(':checked') == true) && (args.$form.find('.form-item[rel=\"service.Lb.provider\"]').find('select').val() == 'Netscaler' || args.$form.find('.form-item[rel=\"service.Lb.provider\"]').find('select').val() == 'F5BigIp')) {
|
||||
args.$form.find('.form-item[rel=\"service.Lb.lbIsolationDropdown\"]').css('display', 'inline-block');
|
||||
@ -2361,6 +2367,19 @@
|
||||
}]
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
egresspolicy: {
|
||||
label: 'Default egress policy',
|
||||
isHidden: true,
|
||||
select: function(args) {
|
||||
args.response.success({
|
||||
data: [
|
||||
{ id: 'ALLOW', description: 'Allow' },
|
||||
{ id: 'DENY', description: 'Deny' }
|
||||
]
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -2485,7 +2504,6 @@
|
||||
inputData['conservemode'] = false;
|
||||
}
|
||||
|
||||
|
||||
// Make service provider map
|
||||
var serviceProviderIndex = 0;
|
||||
$.each(serviceProviderMap, function(key, value) {
|
||||
@ -2497,6 +2515,12 @@
|
||||
if (args.$form.find('.form-item[rel=availability]').css("display") == "none")
|
||||
inputData['availability'] = 'Optional';
|
||||
|
||||
if (args.$form.find('.form-item[rel=egresspolicy]').is(':visible')) {
|
||||
inputData['egressdefaultpolicy'] = formData.egresspolicy === 'ALLOW' ? true : false;
|
||||
} else {
|
||||
delete inputData.egresspolicy;
|
||||
}
|
||||
|
||||
if (args.$form.find('.form-item[rel=systemOfferingForRouter]').css("display") == "none")
|
||||
delete inputData.systemOfferingForRouter;
|
||||
|
||||
@ -2723,6 +2747,13 @@
|
||||
converter: cloudStack.converters.toBooleanText
|
||||
},
|
||||
|
||||
egressdefaultpolicy: {
|
||||
label: 'label.egress.default.policy',
|
||||
converter: function(str) {
|
||||
return str === true ? 'Allow' : 'Deny';
|
||||
}
|
||||
},
|
||||
|
||||
availability: {
|
||||
label: 'label.availability',
|
||||
isEditable: true,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user