mirror of
https://github.com/apache/cloudstack.git
synced 2025-12-16 10:32:34 +01:00
Merge branch 'master' of https://git-wip-us.apache.org/repos/asf/incubator-cloudstack
This commit is contained in:
commit
0333225e22
25
patches/systemvm/debian/config/opt/cloud/bin/checkbatchs2svpn.sh
Executable file
25
patches/systemvm/debian/config/opt/cloud/bin/checkbatchs2svpn.sh
Executable file
@ -0,0 +1,25 @@
|
||||
#!/bin/bash
|
||||
# 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.
|
||||
|
||||
for i in $*
|
||||
do
|
||||
info=`/opt/cloud/bin/checks2svpn.sh $i`
|
||||
ret=$?
|
||||
echo -n "$i:$ret:$info&"
|
||||
done
|
||||
|
||||
@ -220,7 +220,7 @@ under the License.
|
||||
</div>
|
||||
|
||||
<!-- Step 5: Network -->
|
||||
<div class="step network" wizard-step-id="network">
|
||||
<div class="step network always-load" wizard-step-id="network">
|
||||
<!-- 5a: Network description -->
|
||||
<div class="wizard-step-conditional nothing-to-select">
|
||||
<p id="from_instance_page_1"><fmt:message key="message.zone.no.network.selection"/></p>
|
||||
|
||||
@ -269,24 +269,29 @@
|
||||
|
||||
if (selectedZoneObj.networktype == "Advanced") { //Advanced zone. Show network list.
|
||||
var $networkStep = $(".step.network:visible .nothing-to-select");
|
||||
var $networkStepContainer = $('.step.network:visible');
|
||||
|
||||
if(args.initArgs.pluginForm != null && args.initArgs.pluginForm.name == "vpcTierInstanceWizard") { //from VPC Tier chart
|
||||
step5ContainerType = 'nothing-to-select';
|
||||
$networkStep.find("#from_instance_page_1").hide();
|
||||
$networkStep.find("#from_instance_page_2").hide();
|
||||
$networkStep.find("#from_vpc_tier").text("tier " + args.context.networks[0].name);
|
||||
$networkStep.find("#from_vpc_tier").show();
|
||||
}
|
||||
else { //from Instance page
|
||||
} else { //from Instance page
|
||||
if(selectedZoneObj.securitygroupsenabled != true) { // Advanced SG-disabled zone
|
||||
step5ContainerType = 'select-network';
|
||||
$networkStep.find("#from_instance_page_1").show();
|
||||
$networkStep.find("#from_instance_page_2").show();
|
||||
$networkStep.find("#from_vpc_tier").text("");
|
||||
$networkStep.find("#from_vpc_tier").hide();
|
||||
} else { // Advanced SG-enabled zone
|
||||
step5ContainerType = 'select-advanced-sg';
|
||||
}
|
||||
else { // Advanced SG-enabled zone
|
||||
step5ContainerType = 'select-security-group';
|
||||
}
|
||||
|
||||
if ($networkStepContainer.hasClass('next-use-security-groups')) {
|
||||
$networkStepContainer.removeClass('repeat next-use-security-groups loaded');
|
||||
step5ContainerType = 'select-security-group';
|
||||
}
|
||||
}
|
||||
}
|
||||
else { //Basic zone. Show securigy group list or nothing(when no SecurityGroup service in guest network)
|
||||
@ -320,7 +325,7 @@
|
||||
}
|
||||
|
||||
//step5ContainerType = 'nothing-to-select'; //for testing only, comment it out before checking in
|
||||
if(step5ContainerType == 'select-network') {
|
||||
if(step5ContainerType == 'select-network' || step5ContainerType == 'select-advanced-sg') {
|
||||
var defaultNetworkArray = [], optionalNetworkArray = [];
|
||||
var networkData = {
|
||||
zoneId: args.currentData.zoneid
|
||||
@ -379,6 +384,9 @@
|
||||
});
|
||||
//get network offerings (end) ***
|
||||
|
||||
if (step5ContainerType == 'select-advanced-sg') {
|
||||
$networkStepContainer.addClass('repeat next-use-security-groups');
|
||||
}
|
||||
|
||||
args.response.success({
|
||||
type: 'select-network',
|
||||
@ -546,40 +554,37 @@
|
||||
if(checkedSecurityGroupIdArray.length > 0)
|
||||
array1.push("&securitygroupids=" + checkedSecurityGroupIdArray.join(","));
|
||||
|
||||
/*
|
||||
if(selectedZoneObj.networktype == "Advanced" && selectedZoneObj.securitygroupsenabled == true) { // Advanced SG-enabled zone
|
||||
var networkData = {
|
||||
zoneId: selectedZoneObj.id,
|
||||
type: 'Shared',
|
||||
supportedServices: 'SecurityGroup'
|
||||
};
|
||||
if (!(cloudStack.context.projects && cloudStack.context.projects[0])) {
|
||||
networkData.domainid = g_domainid;
|
||||
networkData.account = g_account;
|
||||
var array2 = [];
|
||||
var myNetworks = $('.multi-wizard:visible form').data('my-networks'); //widget limitation: If using an advanced security group zone, get the guest networks like this
|
||||
var defaultNetworkId = $('.multi-wizard:visible form').find('input[name=defaultNetwork]:checked').val();
|
||||
|
||||
var checkedNetworkIdArray;
|
||||
if(typeof(myNetworks) == "object" && myNetworks.length != null) { //myNetworks is an array of string, e.g. ["203", "202"],
|
||||
checkedNetworkIdArray = myNetworks;
|
||||
}
|
||||
else if(typeof(myNetworks) == "string" && myNetworks.length > 0) { //myNetworks is a string, e.g. "202"
|
||||
checkedNetworkIdArray = [];
|
||||
checkedNetworkIdArray.push(myNetworks);
|
||||
}
|
||||
else { // typeof(myNetworks) == null
|
||||
checkedNetworkIdArray = [];
|
||||
}
|
||||
|
||||
var selectedNetworkObj = null;
|
||||
$.ajax({
|
||||
url: createURL('listNetworks'),
|
||||
data: networkData,
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var networks = json.listnetworksresponse.network;
|
||||
if(networks != null && networks.length > 0) {
|
||||
selectedNetworkObj = networks[0]; //each Advanced SG-enabled zone has only one guest network that is Shared and has SecurityGroup service
|
||||
}
|
||||
//add default network first
|
||||
if(defaultNetworkId != null && defaultNetworkId.length > 0 && defaultNetworkId != 'new-network')
|
||||
array2.push(defaultNetworkId);
|
||||
|
||||
//then, add other checked networks
|
||||
if(checkedNetworkIdArray.length > 0) {
|
||||
for(var i=0; i < checkedNetworkIdArray.length; i++) {
|
||||
if(checkedNetworkIdArray[i] != defaultNetworkId) //exclude defaultNetworkId that has been added to array2
|
||||
array2.push(checkedNetworkIdArray[i]);
|
||||
}
|
||||
});
|
||||
if(selectedNetworkObj != null) {
|
||||
array1.push("&networkIds=" + selectedNetworkObj.id);
|
||||
}
|
||||
else {
|
||||
alert('unable to find any Shared network with SecurityGroup service. Therefore, unable to deploy VM in this Advanced SecurityGroup-enabled zone.');
|
||||
return;
|
||||
}
|
||||
}
|
||||
*/
|
||||
|
||||
array1.push("&networkIds=" + array2.join(","));
|
||||
}
|
||||
}
|
||||
else if (step5ContainerType == 'nothing-to-select') {
|
||||
if(args.context.networks != null) { //from VPC tier
|
||||
|
||||
@ -598,6 +598,8 @@
|
||||
response: {
|
||||
success: function(args) {
|
||||
var vpcs = args.data.vpcs;
|
||||
var addClass = args.addClass;
|
||||
var removeClass = args.removeClass;
|
||||
|
||||
// Populate VPC drop-down
|
||||
$vpcSelect.html('');
|
||||
@ -753,7 +755,8 @@
|
||||
)
|
||||
);
|
||||
|
||||
$targetStep.addClass('loaded');
|
||||
if (!$targetStep.hasClass('repeat') &&
|
||||
!$targetStep.hasClass('always-load')) $targetStep.addClass('loaded');
|
||||
}
|
||||
|
||||
// Show launch vm button if last step
|
||||
@ -806,6 +809,14 @@
|
||||
|
||||
//step 5 - select network
|
||||
if($activeStep.find('.wizard-step-conditional.select-network:visible').size() > 0) {
|
||||
var data = $activeStep.data('my-networks');
|
||||
|
||||
if (!data) {
|
||||
$activeStep.closest('form').data('my-networks', cloudStack.serializeForm(
|
||||
$activeStep.closest('form')
|
||||
)['my-networks']);
|
||||
}
|
||||
|
||||
if($activeStep.find('input[type=checkbox]:checked').size() == 0) { //if no checkbox is checked
|
||||
cloudStack.dialog.notice({ message: 'message.step.4.continue' });
|
||||
return false;
|
||||
@ -828,7 +839,11 @@
|
||||
}
|
||||
}
|
||||
|
||||
showStep($steps.filter(':visible').index() + 2);
|
||||
if ($activeStep.hasClass('repeat')) {
|
||||
showStep($steps.filter(':visible').index() + 1);
|
||||
} else {
|
||||
showStep($steps.filter(':visible').index() + 2);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user