mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
WIP: Updated install wizard
This commit is contained in:
parent
db61ed3d5e
commit
31b61b9002
@ -633,6 +633,15 @@ body.login {
|
||||
margin: 6px 4px 0 0;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .range-item {
|
||||
width: 142px;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .range-item input {
|
||||
width: 131px;
|
||||
}
|
||||
|
||||
.install-wizard .step .setup-form .multi-range input[type=text] {
|
||||
width: 128px;
|
||||
}
|
||||
@ -4913,14 +4922,14 @@ label.error {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.tree-view>ul {
|
||||
.tree-view > ul {
|
||||
/*+placement:shift 3px 40px;*/
|
||||
position: relative;
|
||||
left: 3px;
|
||||
top: 40px;
|
||||
}
|
||||
|
||||
.tree-view>ul>li {
|
||||
.tree-view > ul > li {
|
||||
left: 5px;
|
||||
}
|
||||
|
||||
@ -4955,7 +4964,7 @@ label.error {
|
||||
position: absolute;
|
||||
}
|
||||
|
||||
.tree-view ul li.expanded>.expand {
|
||||
.tree-view ul li.expanded > .expand {
|
||||
background-position: -631px -228px;
|
||||
}
|
||||
|
||||
@ -5372,7 +5381,7 @@ div.panel.ui-dialog div.list-view div.fixed-header {
|
||||
top: 2px;
|
||||
}
|
||||
|
||||
.recurring-snapshots .schedule .forms>div {
|
||||
.recurring-snapshots .schedule .forms > div {
|
||||
}
|
||||
|
||||
.recurring-snapshots .schedule .forms form {
|
||||
|
||||
@ -52,55 +52,67 @@
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-gateway': function(args) {
|
||||
'tooltip.addGuestNetwork.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for your network'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.description': function(args) {
|
||||
args.response.success({
|
||||
text: 'A description for your network'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.guestGateway': function(args) {
|
||||
args.response.success({
|
||||
text: 'The gateway that the guests should use'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-netmask': function(args) {
|
||||
'tooltip.addGuestNetwork.guestNetmask': function(args) {
|
||||
args.response.success({
|
||||
text: 'The netmask in use on the subnet that the guests should use'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-ip-range-start': function(args) {
|
||||
'tooltip.addGuestNetwork.guestStartIp': function(args) {
|
||||
args.response.success({
|
||||
text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addIPRange.guest-ip-range-end': function(args) {
|
||||
'tooltip.addGuestNetwork.guestEndIp': function(args) {
|
||||
args.response.success({
|
||||
text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-name': function(args) {
|
||||
'tooltip.addPod.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the pod'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-gateway': function(args) {
|
||||
'tooltip.addPod.gateway': function(args) {
|
||||
args.response.success({
|
||||
text: 'The gateway for the hosts in that pod.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-netmask': function(args) {
|
||||
'tooltip.addPod.netmask': function(args) {
|
||||
args.response.success({
|
||||
text: 'The netmask in use on the subnet the guests will use.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-ip-range-start': function(args) {
|
||||
'tooltip.addPod.startip': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.pod-ip-range-end': function(args) {
|
||||
'tooltip.addPod.endip': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.'
|
||||
});
|
||||
|
||||
@ -37,45 +37,209 @@
|
||||
|
||||
// Copy text
|
||||
copy: {
|
||||
// Tooltips
|
||||
'tooltip.addZone.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the zone.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.dns1': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.dns2': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by guest VMs in the zone. These DNS servers will be accessed via the public network you will add later. The public IP addresses for the zone must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.internaldns1': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by system VMs in the zone. These DNS servers will be accessed via the private network interface of the System VMs. The private IP address you provide for the pods must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addZone.internaldns2': function(args) {
|
||||
args.response.success({
|
||||
text: 'These are DNS servers for use by system VMs in the zone. These DNS servers will be accessed via the private network interface of the System VMs. The private IP address you provide for the pods must have a route to the DNS server named here.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for your network'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.description': function(args) {
|
||||
args.response.success({
|
||||
text: 'A description for your network'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.guestGateway': function(args) {
|
||||
args.response.success({
|
||||
text: 'The gateway that the guests should use'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.guestNetmask': function(args) {
|
||||
args.response.success({
|
||||
text: 'The netmask in use on the subnet that the guests should use'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.guestStartIp': function(args) {
|
||||
args.response.success({
|
||||
text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addGuestNetwork.guestEndIp': function(args) {
|
||||
args.response.success({
|
||||
text: 'The range of IP addresses that will be available for allocation to guests in this zone. If one NIC is used, these IPs should be in the same CIDR as the pod CIDR.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the pod'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.gateway': function(args) {
|
||||
args.response.success({
|
||||
text: 'The gateway for the hosts in that pod.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.netmask': function(args) {
|
||||
args.response.success({
|
||||
text: 'The netmask in use on the subnet the guests will use.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.startip': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPod.endip': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the IP range in the private network that the CloudStack uses to manage Secondary Storage VMs and Console Proxy VMs. These IP addresses are taken from the same subnet as computing servers.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addCluster.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'A name for the cluster. This can be text of your choosing and is not used by CloudStack.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.hostname': function(args) {
|
||||
args.response.success({
|
||||
text: 'The DNS name or IP address of the host.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.username': function(args) {
|
||||
args.response.success({
|
||||
text: 'Usually root.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.password': function(args) {
|
||||
args.response.success({
|
||||
text: 'This is the password for the user named above (from your XenServer install).'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addHost.hosttags': function(args) {
|
||||
args.response.success({
|
||||
text: '(Optional) Any labels that you use to categorize hosts for ease of maintenance.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.name': function(args) {
|
||||
args.response.success({
|
||||
text: 'The name for the storage device.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.server': function(args) {
|
||||
args.response.success({
|
||||
text: '(for NFS, iSCSI, or PreSetup) The IP address or DNS name of the storage device.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.path': function(args) {
|
||||
args.response.success({
|
||||
text: '(for NFS) In NFS this is the exported path from the server. Path (for SharedMountPoint). With KVM this is the path on each host that is where this primary storage is mounted. For example, "/mnt/primary".'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addPrimaryStorage.storageTags': function(args) {
|
||||
args.response.success({
|
||||
text: 'A comma-separated list of any desired tags that you use to categorize storage devices.'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addSecondaryStorage.nfsServer': function(args) {
|
||||
args.response.success({
|
||||
text: 'The IP address of the NFS server hosting the secondary storage'
|
||||
});
|
||||
},
|
||||
|
||||
'tooltip.addSecondaryStorage.path': function(args) {
|
||||
args.response.success({
|
||||
text: 'The exported path, located on the server you specified above'
|
||||
});
|
||||
},
|
||||
|
||||
// Intro text
|
||||
whatIsCloudStack: function(args) {
|
||||
args.response.success({
|
||||
text: 'CloudStack is open source software written in java that is designed to deploy and manage large networks of virtual machines, as a highly available, scalable cloud computing platform. CloudStack current supports the most popular open source hypervisors VMware, Oracle VM, KVM, XenServer and Xen Cloud Platform. CloudStack offers three ways to manage cloud computing environments: a easy-to-use web interface, command line and a full-featured RESTful API.'
|
||||
text: 'CloudStack™ is a software platform that pools computing resources to build public, private, and hybrid Infrastructure as a Service (IaaS) clouds. CloudStack™ manages the network, storage, and compute nodes that make up a cloud infrastructure. Use CloudStack™ to deploy, manage, and configure cloud computing environments.<br/><br/>Extending beyond individual virtual machine images running on commodity hardware, CloudStack™ provides a turnkey cloud infrastructure software stack for delivering virtual datacenters as a service - delivering all of the essential components to build, deploy, and manage multi-tier and multi-tenant cloud applications. Both open-source and Premium versions are available, with the open-source version offering nearly identical features. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAZone: function(args) {
|
||||
args.response.success({
|
||||
text: 'A zone is integral to the CloudStack platform -- your entire network is represented via a zone. More text goes here...'
|
||||
text: 'A zone is the largest organizational unit within a CloudStack™ deployment. A zone typically corresponds to a single datacenter, although it is permissible to have multiple zones in a datacenter. The benefit of organizing infrastructure into zones is to provide physical isolation and redundancy. For example, each zone can have its own power supply and network uplink, and the zones can be widely separated geographically (though this is not required).'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAPod: function(args) {
|
||||
args.response.success({
|
||||
text: 'A pod is a part of a zone. More text goes here...'
|
||||
text: 'A pod often represents a single rack. Hosts in the same pod are in the same subnet.<br/><br/>A pod is the second-largest organizational unit within a CloudStack™ deployment. Pods are contained within zones. Each zone can contain one or more pods; in the Basic Installation, you will have just one pod in your zone'
|
||||
});
|
||||
},
|
||||
|
||||
whatIsACluster: function(args) {
|
||||
args.response.success({
|
||||
text: 'A cluster is a part of a zone. More text goes here...'
|
||||
text: 'A cluster provides a way to group hosts. The hosts in a cluster all have identical hardware, run the same hypervisor, are on the same subnet, and access the same shared storage. Virtual machine instances (VMs) can be live-migrated from one host to another within the same cluster, without interrupting service to the user. A cluster is the third-largest organizational unit within a CloudStack™ deployment. Clusters are contained within pods, and pods are contained within zones.<br/><br/>CloudStack™ allows multiple clusters in a cloud deployment, but for a Basic Installation, we only need one cluster. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsAHost: function(args) {
|
||||
args.response.success({
|
||||
text: 'A host is a part of a zone. More text goes here...'
|
||||
text: 'A host is a single computer. Hosts provide the computing resources that run the guest virtual machines. Each host has hypervisor software installed on it to manage the guest VMs (except for bare metal hosts, which are a special case discussed in the Advanced Installation Guide). For example, a Linux KVM-enabled server, a Citrix XenServer server, and an ESXi server are hosts. In a Basic Installation, we use a single host running XenServer.<br/><br/>The host is the smallest organizational unit within a CloudStack™ deployment. Hosts are contained within clusters, clusters are contained within pods, and pods are contained within zones. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsPrimaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Primary storage is a part of a zone. More text goes here...'
|
||||
text: 'A CloudStack™ cloud infrastructure makes use of two types of storage: primary storage and secondary storage. Both of these can be iSCSI or NFS servers, or localdisk.<br/><br/><strong>Primary storage</strong> is associated with a cluster, and it stores the disk volumes of each guest VM for all the VMs running on hosts in that cluster. The primary storage server is typically located close to the hosts. '
|
||||
});
|
||||
},
|
||||
|
||||
whatIsSecondaryStorage: function(args) {
|
||||
args.response.success({
|
||||
text: 'Secondary storage is a part of a zone. More text goes here...'
|
||||
text: 'Secondary storage is associated with a zone, and it stores the following:<ul><li>Templates - OS images that can be used to boot VMs and can include additional configuration information, such as installed applications</li><li>ISO images - OS images that can be bootable or non-bootable</li><li>Disk volume snapshots - saved copies of VM data which can be used for data recovery or to create new templates</ul>'
|
||||
});
|
||||
}
|
||||
},
|
||||
@ -84,202 +248,419 @@
|
||||
var complete = args.response.success;
|
||||
var data = args.data;
|
||||
|
||||
/**
|
||||
* Step 1: add zone
|
||||
*/
|
||||
var createZone = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createZone'),
|
||||
data: {
|
||||
name: data.zone.name,
|
||||
networktype: 'Basic',
|
||||
dns1: data.zone.dns1,
|
||||
dns2: data.zone.dns2,
|
||||
internaldns1: data.zone.internaldns1,
|
||||
internaldns2: data.zone.internaldns2
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createPod({
|
||||
data: {
|
||||
zone: data.createzoneresponse.zone
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var addZoneAction = function(args) {
|
||||
var array1 = [];
|
||||
|
||||
/**
|
||||
* Step 2: add pod
|
||||
*/
|
||||
var createPod = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createPod'),
|
||||
data: {
|
||||
name: data.pod['pod-name'],
|
||||
zoneid: args.data.zone.id,
|
||||
gateway: data.pod['pod-gateway'],
|
||||
netmask: data.pod['pod-netmask'],
|
||||
startip: data.pod['pod-ip-range-start'],
|
||||
endip: data.pod['pod-ip-range-end']
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createIPRange({
|
||||
data: $.extend(args.data, {
|
||||
pod: data.createpodresponse.pod
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
//var networktype = $thisWizard.find("#step1").find("input:radio[name=basic_advanced]:checked").val(); //"Basic", "Advanced"
|
||||
var networktype = 'Basic';
|
||||
array1.push("&networktype=" + todb(networktype));
|
||||
|
||||
/**
|
||||
* Step 3: add public IP range
|
||||
*/
|
||||
var createIPRange = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createVlanIpRange'),
|
||||
data: {
|
||||
zoneid: args.data.zone.id,
|
||||
vlan: 'untagged',
|
||||
gateway: data.zoneIPRange['guest-gateway'],
|
||||
netmask: data.zoneIPRange['guest-netmask'],
|
||||
startip: data.zoneIPRange['guest-ip-range-start'],
|
||||
endip: data.zoneIPRange['guest-ip-range-end'],
|
||||
forVirtualNetwork: false,
|
||||
podid: args.data.pod.id
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createCluster({
|
||||
data: $.extend(args.data, {
|
||||
ipRange: data.createvlaniprangeresponse.vlan
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
array1.push("&name=" + todb(args.data.name));
|
||||
|
||||
/**
|
||||
* Step 4: add cluster
|
||||
*/
|
||||
var createCluster = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('addCluster'),
|
||||
data: {
|
||||
clustername: data.cluster.name,
|
||||
podid: args.data.pod.id,
|
||||
zoneid: args.data.zone.id,
|
||||
hypervisor: data.cluster.hypervisor,
|
||||
clustertype: 'CloudManaged'
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createHost({
|
||||
data: $.extend(args.data, {
|
||||
cluster: data.addclusterresponse.cluster[0]
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
array1.push("&dns1=" + todb(args.data.dns1));
|
||||
|
||||
/**
|
||||
* Step 5: add host
|
||||
*/
|
||||
var createHost = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('addHost'),
|
||||
data: {
|
||||
clustername: args.data.cluster.name,
|
||||
zoneid: args.data.zone.id,
|
||||
podid: args.data.pod.id,
|
||||
hypervisor: 'XenServer',
|
||||
clustertype: 'CloudManaged',
|
||||
url: 'http://' + data.host.hostname,
|
||||
username: data.host.username,
|
||||
password: data.host.password
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createPrimaryStorage({
|
||||
data: $.extend(args.data, {
|
||||
host: data.addhostresponse.host[0]
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
var dns2 = args.data.dns2;
|
||||
if (dns2 != null && dns2.length > 0)
|
||||
array1.push("&dns2=" + todb(dns2));
|
||||
|
||||
/**
|
||||
* Step 6: add primary storage
|
||||
*/
|
||||
var createPrimaryStorage = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('createStoragePool'),
|
||||
data: {
|
||||
name: data.primaryStorage.name,
|
||||
clusterid: args.data.cluster.id,
|
||||
zoneid: args.data.zone.id,
|
||||
podid: args.data.pod.id,
|
||||
hypervisor: 'XenServer',
|
||||
clustertype: 'CloudManaged',
|
||||
url: 'nfs://' + data.primaryStorage.server + data.primaryStorage.path
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
createSecondaryStorage({
|
||||
data: $.extend(args.data, {
|
||||
host: data.createstoragepoolresponse.storagepool
|
||||
})
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
array1.push("&internaldns1="+todb(args.data.internaldns1));
|
||||
|
||||
/**
|
||||
* Step 7: add secondary storage
|
||||
*/
|
||||
var createSecondaryStorage = function(args) {
|
||||
$.ajax({
|
||||
url: createURL('addSecondaryStorage'),
|
||||
data: {
|
||||
clusterid: args.data.cluster.id,
|
||||
zoneid: args.data.zone.id,
|
||||
url: 'nfs://' + data.secondaryStorage.nfsServer + data.secondaryStorage.path
|
||||
},
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
pollSystemVMs();
|
||||
}
|
||||
});
|
||||
};
|
||||
var internaldns2 = args.data.internaldns2;
|
||||
if (internaldns2 != null && internaldns2.length > 0)
|
||||
array1.push("&internaldns2=" + todb(internaldns2));
|
||||
|
||||
/**
|
||||
* Final step: poll for system VMs, wait until they are active to complete wizard
|
||||
*/
|
||||
var pollSystemVMs = function() {
|
||||
var poll = setInterval(function() {
|
||||
if(networktype == "Advanced") {
|
||||
//if(args.data["isolation-mode"] == "security-groups") {
|
||||
// array1.push("&securitygroupenabled=true");
|
||||
//}
|
||||
//else { //args.data["isolation-mode"] == "vlan"
|
||||
array1.push("&securitygroupenabled=false");
|
||||
|
||||
var guestcidraddress = args.data["guest-cidr"];
|
||||
if(guestcidraddress != null && guestcidraddress.length > 0) {
|
||||
array1.push("&guestcidraddress="+todb(guestcidraddress));
|
||||
}
|
||||
//}
|
||||
}
|
||||
|
||||
var zoneId;
|
||||
$.ajax({
|
||||
url: createURL('listSystemVms'),
|
||||
dataType: 'json',
|
||||
async: true,
|
||||
success: function(data) {
|
||||
if (data.listsystemvmsresponse.systemvm) {
|
||||
clearInterval(poll);
|
||||
complete();
|
||||
url: createURL("createZone" + array1.join("")),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var zoneObj = json.createzoneresponse.zone;
|
||||
zoneId = zoneObj.id;
|
||||
|
||||
//NaaS (begin)
|
||||
var physicalNetworkId;
|
||||
$.ajax({
|
||||
url: createURL("listPhysicalNetworks&zoneId=" + zoneId),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listphysicalnetworksresponse.physicalnetwork;
|
||||
if(items != null && items.length > 0)
|
||||
physicalNetworkId = items[0].id
|
||||
}
|
||||
});
|
||||
if(physicalNetworkId == null) {
|
||||
alert("error: listPhysicalNetworks API doesn't return Physical Network ID");
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL("updatePhysicalNetwork&state=Enabled&id=" + physicalNetworkId),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var jobId = json.updatephysicalnetworkresponse.jobid;
|
||||
var timerKey = "updatePhysicalNetworkJob_"+jobId;
|
||||
$("body").everyTime(2000, timerKey, function() {
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobId="+jobId),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var result = json.queryasyncjobresultresponse;
|
||||
if (result.jobstatus == 0) {
|
||||
return; //Job has not completed
|
||||
}
|
||||
else {
|
||||
$("body").stopTime(timerKey);
|
||||
if (result.jobstatus == 1) {
|
||||
//alert("updatePhysicalNetwork succeeded.");
|
||||
|
||||
// get network service provider ID of Virtual Router
|
||||
var networkServiceProviderId;
|
||||
$.ajax({
|
||||
url: createURL("listNetworkServiceProviders&name=VirtualRouter&physicalNetworkId=" + physicalNetworkId),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listnetworkserviceprovidersresponse.networkserviceprovider;
|
||||
if(items != null && items.length > 0) {
|
||||
networkServiceProviderId = items[0].id;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(networkServiceProviderId == null) {
|
||||
alert("error: listNetworkServiceProviders API doesn't return Network Service Provider ID");
|
||||
return;
|
||||
}
|
||||
|
||||
var virtualRouterElementId;
|
||||
$.ajax({
|
||||
url: createURL("listVirtualRouterElements&nspid=" + networkServiceProviderId),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var items = json.listvirtualrouterelementsresponse.virtualrouterelement;
|
||||
if(items != null && items.length > 0) {
|
||||
virtualRouterElementId = items[0].id;
|
||||
}
|
||||
}
|
||||
});
|
||||
if(virtualRouterElementId == null) {
|
||||
alert("error: listVirtualRouterElements API doesn't return Virtual Router Element Id");
|
||||
return;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL("configureVirtualRouterElement&enabled=true&id=" + virtualRouterElementId),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var jobId = json.configurevirtualrouterelementresponse.jobid;
|
||||
var timerKey = "configureVirtualRouterElementJob_"+jobId;
|
||||
$("body").everyTime(2000, timerKey, function() {
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobId="+jobId),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var result = json.queryasyncjobresultresponse;
|
||||
if (result.jobstatus == 0) {
|
||||
return; //Job has not completed
|
||||
}
|
||||
else {
|
||||
$("body").stopTime(timerKey);
|
||||
if (result.jobstatus == 1) {
|
||||
//alert("configureVirtualRouterElement succeeded.");
|
||||
|
||||
$.ajax({
|
||||
url: createURL("updateNetworkServiceProvider&state=Enabled&id=" + networkServiceProviderId),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var jobId = json.updatenetworkserviceproviderresponse.jobid;
|
||||
var timerKey = "updateNetworkServiceProviderJob_"+jobId;
|
||||
$("body").everyTime(2000, timerKey, function() {
|
||||
$.ajax({
|
||||
url: createURL("queryAsyncJobResult&jobId="+jobId),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var result = json.queryasyncjobresultresponse;
|
||||
if (result.jobstatus == 0) {
|
||||
return; //Job has not completed
|
||||
}
|
||||
else {
|
||||
$("body").stopTime(timerKey);
|
||||
if (result.jobstatus == 1) {}
|
||||
else if (result.jobstatus == 2) {
|
||||
alert("updateNetworkServiceProvider failed. Error: " + fromdb(result.jobresult.errortext));
|
||||
}
|
||||
|
||||
args.complete({ data: { zone: zoneObj } });
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
alert("updateNetworkServiceProvider failed. Error: " + errorMsg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (result.jobstatus == 2) {
|
||||
alert("configureVirtualRouterElement failed. Error: " + fromdb(result.jobresult.errortext));
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
alert("configureVirtualRouterElement failed. Error: " + errorMsg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
else if (result.jobstatus == 2) {
|
||||
alert("updatePhysicalNetwork failed. Error: " + fromdb(result.jobresult.errortext));
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
alert("updatePhysicalNetwork failed. Error: " + errorMsg);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
//NaaS (end)
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
args.response.error(errorMsg);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
};
|
||||
|
||||
addZoneAction({ data: data.zone, complete: createPod });
|
||||
};
|
||||
|
||||
var createPod = function(args) {
|
||||
var array1 = [];
|
||||
array1.push("&zoneId=" + args.data.zone.id);
|
||||
array1.push("&name=" + todb(data.pod.name));
|
||||
array1.push("&gateway=" + todb(data.pod.gateway));
|
||||
array1.push("&netmask=" + todb(data.pod.netmask));
|
||||
array1.push("&startIp=" + todb(data.pod.startip));
|
||||
|
||||
var endip = data.pod.endip; //optional
|
||||
if (endip != null && endip.length > 0)
|
||||
array1.push("&endIp=" + todb(endip));
|
||||
|
||||
$.ajax({
|
||||
url: createURL("createPod" + array1.join("")),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var item = json.createpodresponse.pod;
|
||||
createNetwork({ data: $.extend(args.data, { pod: item })});
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
args.response.error(errorMsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var createNetwork = function(args) {
|
||||
var createNetworkAction = function(selectedZoneObj, args) {
|
||||
var array1 = [];
|
||||
array1.push("&zoneId=" + selectedZoneObj.id);
|
||||
array1.push("&name=" + todb(args.data.name));
|
||||
array1.push("&displayText=" + todb(args.data.description));
|
||||
array1.push("&networkOfferingId=" + args.data.networkOfferingId);
|
||||
|
||||
if(selectedZoneObj.networktype == "Basic") {
|
||||
array1.push("&vlan=untagged");
|
||||
}
|
||||
else { //"Advanced"
|
||||
if (args.data.vlanTagged == "tagged")
|
||||
array1.push("&vlan=" + todb(args.data.vlanId));
|
||||
else
|
||||
array1.push("&vlan=untagged");
|
||||
|
||||
var $form = args.$form;
|
||||
|
||||
if($form.find('.form-item[rel=domainId]').css("display") != "none") {
|
||||
if($form.find('.form-item[rel=account]').css("display") != "none") { //account-specific
|
||||
array1.push("&acltype=account");
|
||||
array1.push("&domainId=" + args.data.domainId);
|
||||
array1.push("&account=" + args.data.account);
|
||||
}
|
||||
else { //domain-specific
|
||||
array1.push("&acltype=domain");
|
||||
array1.push("&domainId=" + args.data.domainId);
|
||||
}
|
||||
}
|
||||
else { //zone-wide
|
||||
array1.push("&acltype=domain"); //server-side will make it Root domain (i.e. domainid=1)
|
||||
}
|
||||
|
||||
array1.push("&isDefault=" + (args.data.isDefault=="on"));
|
||||
array1.push("&gateway=" + args.data.guestGateway);
|
||||
array1.push("&netmask=" + args.data.guestNetmask);
|
||||
array1.push("&startip=" + args.data.guestStartIp);
|
||||
array1.push("&endip=" + args.data.guestEndIp);
|
||||
|
||||
if(args.data.networkdomain != null && args.data.networkdomain.length > 0)
|
||||
array1.push("&networkdomain=" + todb(args.data.networkdomain));
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
url: createURL("createNetwork" + array1.join("")),
|
||||
dataType: "json",
|
||||
success: function(json) {
|
||||
var item = json.createnetworkresponse.network;
|
||||
|
||||
args.response.success({data:item});
|
||||
|
||||
if(selectedZoneObj.networktype == "Basic") {
|
||||
var array2 = [];
|
||||
|
||||
var podId;
|
||||
if(args.data.podId != "0") {
|
||||
podId = args.data.podId;
|
||||
}
|
||||
else { //args.data.podId==0, create pod first
|
||||
var array1 = [];
|
||||
array1.push("&zoneId=" + selectedZoneObj.id);
|
||||
array1.push("&name=" + todb(args.data.podname));
|
||||
array1.push("&gateway=" + todb(args.data.reservedSystemGateway));
|
||||
array1.push("&netmask=" + todb(args.data.reservedSystemNetmask));
|
||||
array1.push("&startIp=" + todb(args.data.reservedSystemStartIp));
|
||||
|
||||
var endip = args.data.reservedSystemEndIp; //optional
|
||||
if (endip != null && endip.length > 0)
|
||||
array1.push("&endIp=" + todb(endip));
|
||||
|
||||
$.ajax({
|
||||
url: createURL("createPod" + array1.join("")),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
var item = json.createpodresponse.pod;
|
||||
podId = item.id;
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
//var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
//args.response.error(errorMsg);
|
||||
}
|
||||
});
|
||||
}
|
||||
if(podId == null) {
|
||||
alert("podId is null, so unable to create IP range on pod level");
|
||||
return;
|
||||
}
|
||||
|
||||
array2.push("&podId=" + podId);
|
||||
array2.push("&vlan=untagged");
|
||||
array2.push("&zoneid=" + selectedZoneObj.id);
|
||||
array2.push("&forVirtualNetwork=false"); //direct VLAN
|
||||
array2.push("&gateway=" + todb(args.data.guestGateway));
|
||||
array2.push("&netmask=" + todb(args.data.guestNetmask));
|
||||
array2.push("&startip=" + todb(args.data.guestStartIp));
|
||||
var endip = args.data.guestEndIp;
|
||||
if(endip != null && endip.length > 0)
|
||||
array2.push("&endip=" + todb(endip));
|
||||
$.ajax({
|
||||
url: createURL("createVlanIpRange" + array2.join("")),
|
||||
dataType: "json",
|
||||
async: false,
|
||||
success: function(json) {
|
||||
//var item = json.createvlaniprangeresponse.vlan;
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
//var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
//args.response.error(errorMsg);
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
},
|
||||
error: function(XMLHttpResponse) {
|
||||
var errorMsg = parseXMLHttpResponse(XMLHttpResponse);
|
||||
args.response.error(errorMsg);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
// Get default network offering ID
|
||||
var networkOfferingID;
|
||||
$.ajax({
|
||||
url: createURL("listNetworkOfferings&guestiptype=Shared"),
|
||||
dataType: "json",
|
||||
async: true,
|
||||
success: function(json) {
|
||||
var networkOfferings = json.listnetworkofferingsresponse.networkoffering;
|
||||
networkOfferingID = $.grep(networkOfferings, function(elem) {
|
||||
return elem.name == 'DefaultSharedNetworkOffering';
|
||||
})[0].id;
|
||||
|
||||
createNetworkAction(args.data.zone, {
|
||||
response: {
|
||||
success: function(successArgs) {
|
||||
createCluster({ data: $.extend(args.data, { guestNetwork: successArgs.data })});
|
||||
}
|
||||
},
|
||||
data: {
|
||||
name: data.guestNetwork.name,
|
||||
description: data.guestNetwork.description,
|
||||
podId: args.data.pod.id,
|
||||
guestGateway: data.guestNetwork.guestGateway,
|
||||
guestNetmask: data.guestNetwork.guestNetmask,
|
||||
guestStartIp: data.guestNetwork.guestStartIp,
|
||||
guestEndIp: data.guestNetwork.guestEndIp,
|
||||
networkOfferingId: networkOfferingID
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
var createCluster = function(args) {
|
||||
createHost();
|
||||
};
|
||||
|
||||
var createHost = function(args) {
|
||||
createPrimaryStorage();
|
||||
};
|
||||
|
||||
var createPrimaryStorage = function(args) {
|
||||
createSecondaryStorage();
|
||||
};
|
||||
|
||||
var createSecondaryStorage = function(args) {
|
||||
pollSystemVMs();
|
||||
};
|
||||
|
||||
var pollSystemVMs = function() {
|
||||
setTimeout(function() {
|
||||
complete();
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
createZone();
|
||||
|
||||
@ -54,6 +54,68 @@
|
||||
* Generic page elements
|
||||
*/
|
||||
var elems = {
|
||||
/**
|
||||
* A standard wizard step template
|
||||
* -- relies on createForm for form generation
|
||||
*/
|
||||
step: function(args) {
|
||||
var title = args.title;
|
||||
var formData = args.form;
|
||||
var diagram = args.diagram;
|
||||
var id = args.id;
|
||||
var stateID = args.stateID;
|
||||
var tooltipID = args.tooltipID;
|
||||
var nextStepID = args.nextStepID;
|
||||
var form;
|
||||
|
||||
var $container = $('<div></div>').addClass(id);
|
||||
var $form = $('<div>').addClass('setup-form');
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html(title);
|
||||
|
||||
// Generate form
|
||||
form = cloudStack.dialog.createForm({
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: title,
|
||||
desc: '',
|
||||
fields: formData
|
||||
},
|
||||
after: function(args) {
|
||||
goTo(nextStepID, stateID, $form);
|
||||
}
|
||||
});
|
||||
|
||||
$form.append(form.$formContainer);
|
||||
$form.find('.form-item').addClass('field');
|
||||
$save.appendTo($form.find('form'));
|
||||
|
||||
// Submit handler
|
||||
$form.find('form').submit(function() {
|
||||
form.completeAction($form);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Setup diagram, tooltips
|
||||
showDiagram(diagram);
|
||||
|
||||
// Cleanup
|
||||
$form.find('.message').remove();
|
||||
$form.find('label.error').hide();
|
||||
|
||||
$container.append($form.prepend($title));
|
||||
|
||||
return function(args) {
|
||||
showTooltip($form, tooltipID);
|
||||
|
||||
return $container;
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* A form item tooltip
|
||||
*/
|
||||
tooltip: function(title, content) {
|
||||
return $('<div>').addClass('tooltip-info').append(
|
||||
$('<div>').addClass('arrow'),
|
||||
@ -61,6 +123,10 @@
|
||||
$('<div>').addClass('content').append($('<p>').html(content))
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* The main header
|
||||
*/
|
||||
header: function() {
|
||||
return $('<div></div>').addClass('header')
|
||||
.append(
|
||||
@ -70,9 +136,17 @@
|
||||
)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* The wizard body (contains form)
|
||||
*/
|
||||
body: function() {
|
||||
return $('<div></div>').addClass('body');
|
||||
},
|
||||
|
||||
/**
|
||||
* A standard next button
|
||||
*/
|
||||
nextButton: function(label, options) {
|
||||
var $button = options && !options.type ?
|
||||
$('<div>').addClass('button goTo').html(label) :
|
||||
@ -115,7 +189,7 @@
|
||||
$tooltip.css({
|
||||
top: $(this).position().top - 20
|
||||
});
|
||||
|
||||
|
||||
var content = getCopy(
|
||||
'tooltip.' + sectionID + '.' + $input.attr('name'),
|
||||
$tooltip.find('p')
|
||||
@ -127,7 +201,7 @@
|
||||
});
|
||||
|
||||
setTimeout(function() {
|
||||
$formContainer.find('input:first').focus();
|
||||
$formContainer.find('input:first').focus();
|
||||
}, 600);
|
||||
};
|
||||
|
||||
@ -135,6 +209,38 @@
|
||||
* Layout/behavior for each step in wizard
|
||||
*/
|
||||
var steps = {
|
||||
intro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro what-is-cloudstack');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('What is CloudStack™?');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('Introduction to CloudStack™');
|
||||
var $copy = getCopy('whatIsCloudStack', $('<p></p>'));
|
||||
var $continue = elems.nextButton('Continue with basic installation');
|
||||
var $advanced = elems.nextButton(
|
||||
'I have used Cloudstack before, skip this guide'
|
||||
).addClass('advanced-installation');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('changeUser');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$advanced.click(function() {
|
||||
complete();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$advanced,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
changeUser: function(args) {
|
||||
var $changeUser = $('<div></div>').addClass('step change-user');
|
||||
var $form = $('<form></form>').appendTo($changeUser);
|
||||
@ -166,7 +272,7 @@
|
||||
data: cloudStack.serializeForm($form),
|
||||
response: {
|
||||
success: function(args) {
|
||||
goTo('intro', 'newUser', $form);
|
||||
goTo('addZoneIntro', 'newUser', $form);
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -177,36 +283,6 @@
|
||||
return $changeUser;
|
||||
},
|
||||
|
||||
intro: function(args) {
|
||||
var $intro = $('<div></div>').addClass('intro');
|
||||
var $title = $('<div></div>').addClass('title')
|
||||
.html('What is CloudStack™?');
|
||||
var $subtitle = $('<div></div>').addClass('subtitle')
|
||||
.html('Introduction to CloudStack™');
|
||||
var $copy = getCopy('whatIsCloudStack', $('<p></p>'));
|
||||
var $continue = elems.nextButton('Continue with basic installation');
|
||||
var $advanced = elems.nextButton('Setup advanced installation').addClass('advanced-installation');
|
||||
|
||||
$continue.click(function() {
|
||||
goTo('addZoneIntro');
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
$advanced.click(function() {
|
||||
complete();
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
return $intro.append(
|
||||
$title, $subtitle,
|
||||
$copy,
|
||||
$advanced,
|
||||
$continue
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add zone intro text
|
||||
* @param args
|
||||
@ -237,74 +313,22 @@
|
||||
|
||||
/**
|
||||
* Add zone form
|
||||
* @param args
|
||||
*/
|
||||
addZone: function(args) {
|
||||
var $addZone = $('<div></div>').addClass('add-zone');
|
||||
var $addZoneForm = $('<div>').addClass('setup-form').append(
|
||||
$('#template').find('.multi-wizard.zone-wizard .steps .setup-zone').clone()
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html('Setup Zone');
|
||||
|
||||
$addZoneForm.find('form').validate();
|
||||
|
||||
$save.click(function() {
|
||||
if (!$addZoneForm.find('form').valid()) return false;
|
||||
|
||||
goTo('addIPRange', 'zone', $addZoneForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Remove unneeded fields
|
||||
$addZoneForm.find('.main-desc, .conditional').remove();
|
||||
$addZoneForm.find('.field:last').remove();
|
||||
|
||||
showDiagram('.part.zone');
|
||||
showTooltip($addZoneForm, 'addZone');
|
||||
|
||||
return $addZone.append(
|
||||
$addZoneForm
|
||||
.prepend($title)
|
||||
.append($save)
|
||||
);
|
||||
},
|
||||
|
||||
/**
|
||||
* Add IP range form
|
||||
* @param args
|
||||
*/
|
||||
addIPRange: function(args) {
|
||||
var $addIPRange = $('<div></div>').addClass('add-zone');
|
||||
var $addIPRangeForm = $('<div>').addClass('setup-form').append(
|
||||
$('#template').find('.multi-wizard.zone-wizard .steps .add-ip-range').clone()
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html('Setup IP Range');
|
||||
|
||||
$addIPRangeForm.find('form').validate();
|
||||
|
||||
$save.click(function() {
|
||||
if (!$addIPRangeForm.find('form').valid()) return false;
|
||||
|
||||
goTo('addPodIntro', 'zoneIPRange', $addIPRangeForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
showDiagram('.part.zone');
|
||||
showTooltip($addIPRangeForm, 'addIPRange');
|
||||
|
||||
// Remove unneeded fields
|
||||
$addIPRangeForm.find('.main-desc, .conditional').remove();
|
||||
|
||||
return $addIPRange.append(
|
||||
$addIPRangeForm
|
||||
.prepend($title)
|
||||
.append($save)
|
||||
);
|
||||
},
|
||||
addZone: elems.step({
|
||||
title: 'Add zone',
|
||||
id: 'add-zone',
|
||||
stateID: 'zone',
|
||||
tooltipID: 'addZone',
|
||||
diagram: '.part.zone',
|
||||
nextStepID: 'addPodIntro',
|
||||
form: {
|
||||
name: { label: 'Name', validation: { required: true } },
|
||||
dns1: { label: 'DNS 1', validation: { required: true } },
|
||||
dns2: { label: 'DNS 2' },
|
||||
internaldns1: { label: 'Internal DNS 1', validation: { required: true } },
|
||||
internaldns2: { label: 'Internal DNS 2' }
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Add pod intro text
|
||||
@ -338,36 +362,39 @@
|
||||
* Add pod form
|
||||
* @param args
|
||||
*/
|
||||
addPod: function(args) {
|
||||
var $addPod = $('<div></div>').addClass('add-pod');
|
||||
var $addPodForm = $('<div>').addClass('setup-form').append(
|
||||
$('#template').find('.multi-wizard.zone-wizard .steps .setup-pod').clone()
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' });
|
||||
var $title = $('<div></div>').addClass('title').html('Add a Pod');
|
||||
addPod: elems.step({
|
||||
title: 'Add pod',
|
||||
id: 'add-pod',
|
||||
stateID: 'pod',
|
||||
tooltipID: 'addPod',
|
||||
diagram: '.part.zone, .part.pod',
|
||||
nextStepID: 'addGuestNetwork',
|
||||
form: {
|
||||
name: { label: 'Name', validation: { required: true }},
|
||||
gateway: { label: 'Gateway', validation: { required: true }},
|
||||
netmask: { label: 'Netmask', validation: { required: true }},
|
||||
ipRange: { label: 'IP Range', range: ['startip', 'endip'], validation: { required: true }}
|
||||
}
|
||||
}),
|
||||
|
||||
$addPodForm.find('form').validate();
|
||||
|
||||
$save.click(function() {
|
||||
if (!$addPodForm.find('form').valid()) return false;
|
||||
|
||||
goTo('addClusterIntro', 'pod', $addPodForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
// Remove unneeded fields
|
||||
$addPodForm.find('.main-desc, .conditional').remove();
|
||||
|
||||
showDiagram('.part.zone, .part.pod');
|
||||
showTooltip($addPodForm, 'addPod');
|
||||
|
||||
return $addPod.append(
|
||||
$addPodForm
|
||||
.prepend($title)
|
||||
.append($save)
|
||||
);
|
||||
},
|
||||
/**
|
||||
* Add guest network form
|
||||
*/
|
||||
addGuestNetwork: elems.step({
|
||||
title: 'Add guest network',
|
||||
id: 'add-guest-network',
|
||||
stateID: 'guestNetwork',
|
||||
tooltipID: 'launchInfo',
|
||||
diagram: '.part.zone',
|
||||
nextStepID: 'launchInfo',
|
||||
form: {
|
||||
name: { label: 'Name', validation: { required: true } },
|
||||
description: { label: 'Description', validation: { required: true } },
|
||||
guestGateway: { label: 'Gateway', validation: { required: true } },
|
||||
guestNetmask: { label: 'Netmask', validation: { required: true } },
|
||||
guestIPRange: { label: 'IP Range', range: ['guestStartIp', 'guestEndIp'], validation: { required: true } }
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Add cluster intro text
|
||||
@ -401,46 +428,25 @@
|
||||
* Add cluster form
|
||||
* @param args
|
||||
*/
|
||||
addCluster: function(args) {
|
||||
var $addCluster = $('<div></div>').addClass('add-cluster');
|
||||
var addClusterForm = cloudStack.dialog.createForm({
|
||||
context: {
|
||||
zones: [{}]
|
||||
addCluster: elems.step({
|
||||
title: 'Add cluster',
|
||||
id: 'add-cluster',
|
||||
stateID: 'cluster',
|
||||
tooltipID: 'addCluster',
|
||||
nextStepID: 'addHostIntro',
|
||||
diagram: '.part.zone, .part.cluster',
|
||||
form: {
|
||||
hypervisor: {
|
||||
label: 'Hypervisor',
|
||||
select: function(args) {
|
||||
args.response.success({ data: [
|
||||
{ id: 'xen', description: 'XenServer' }
|
||||
]});
|
||||
}
|
||||
},
|
||||
noDialog: true,
|
||||
form: cloudStack.sections.system
|
||||
.subsections.clusters.listView
|
||||
.actions.add.createForm,
|
||||
after: function(args) {
|
||||
goTo('addHostIntro', 'cluster', $addClusterForm);
|
||||
}
|
||||
});
|
||||
var $addClusterForm = $('<div>').addClass('setup-form').append(
|
||||
addClusterForm.$formContainer
|
||||
);
|
||||
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addClusterForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add a Cluster');
|
||||
|
||||
$addClusterForm.find('form').submit(function() {
|
||||
addClusterForm.completeAction($addClusterForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.cluster');
|
||||
showTooltip($addClusterForm, 'addCluster');
|
||||
|
||||
// Cleanup
|
||||
$addClusterForm.find('.message').remove();
|
||||
$addClusterForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
$addClusterForm.find('.form-item[rel=podId]').remove();
|
||||
|
||||
return $addCluster.append(
|
||||
$addClusterForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
name: { label: 'Name', validation: { required: true }}
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Add host intro text
|
||||
@ -474,67 +480,31 @@
|
||||
* Add host form
|
||||
* @param args
|
||||
*/
|
||||
addHost: function(args) {
|
||||
var $addHost = $('<div></div>').addClass('add-host');
|
||||
var addHostForm = cloudStack.dialog.createForm({
|
||||
context: { zones: [{}] },
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: 'Add new host',
|
||||
desc: 'Please fill in the following information to add a new host fro the specified zone configuration.',
|
||||
fields: {
|
||||
hostname: {
|
||||
label: 'Host name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
username: {
|
||||
label: 'User name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
password: {
|
||||
label: 'Password',
|
||||
validation: { required: true },
|
||||
isPassword: true
|
||||
},
|
||||
//always appear (begin)
|
||||
hosttags: {
|
||||
label: 'Host tags',
|
||||
validation: { required: false }
|
||||
}
|
||||
//always appear (end)
|
||||
}
|
||||
addHost: elems.step({
|
||||
title: 'Add host',
|
||||
id: 'add-host',
|
||||
stateID: 'host',
|
||||
tooltipID: 'addHost',
|
||||
nextStepID: 'addPrimaryStorageIntro',
|
||||
diagram: '.part.zone, .part.host',
|
||||
form: {
|
||||
hostname: {
|
||||
label: 'Host name',
|
||||
validation: { required: true }
|
||||
},
|
||||
after: function(args) {
|
||||
goTo('addPrimaryStorageIntro', 'host', $addHostForm);
|
||||
|
||||
username: {
|
||||
label: 'User name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
password: {
|
||||
label: 'Password',
|
||||
validation: { required: true },
|
||||
isPassword: true
|
||||
}
|
||||
});
|
||||
var $addHostForm = $('<div>').addClass('setup-form').append(
|
||||
addHostForm.$formContainer
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addHostForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add a Host');
|
||||
|
||||
$addHostForm.find('form').submit(function() {
|
||||
addHostForm.completeAction($addHostForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.host');
|
||||
showTooltip($addHostForm, 'addHost');
|
||||
|
||||
// Cleanup
|
||||
$addHostForm.find('.message').remove();
|
||||
$addHostForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
$addHostForm.find('.form-item[rel=cluster], .form-item[rel=pod]').remove();
|
||||
|
||||
return $addHost.append(
|
||||
$addHostForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Add primary storage intro text
|
||||
@ -568,64 +538,35 @@
|
||||
* Add primary storage
|
||||
* @param args
|
||||
*/
|
||||
addPrimaryStorage: function(args) {
|
||||
var $addPrimaryStorage = $('<div></div>').addClass('add-primary-storage');
|
||||
var addPrimaryStorageForm = cloudStack.dialog.createForm({
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: 'Add new primary storage',
|
||||
desc: 'Please fill in the following information to add a new primary storage',
|
||||
fields: {
|
||||
name: {
|
||||
label: 'Name',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
server: {
|
||||
label: 'Server',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
path: {
|
||||
label: 'Path',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
storageTags: {
|
||||
label: 'Storage Tags',
|
||||
validation: { required: false }
|
||||
}
|
||||
}
|
||||
addPrimaryStorage: elems.step({
|
||||
title: 'Add primary storage',
|
||||
id: 'add-primary-storage',
|
||||
stateID: 'primaryStorage',
|
||||
tooltipID: 'addPrimaryStorage',
|
||||
nextStepID: 'addSecondaryStorageIntro',
|
||||
diagram: '.part.zone, .part.primaryStorage',
|
||||
form: {
|
||||
name: {
|
||||
label: 'Name',
|
||||
validation: { required: true }
|
||||
},
|
||||
after: function(args) {
|
||||
goTo('addSecondaryStorageIntro', 'primaryStorage', $addPrimaryStorageForm);
|
||||
|
||||
server: {
|
||||
label: 'Server',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
path: {
|
||||
label: 'Path',
|
||||
validation: { required: true }
|
||||
},
|
||||
|
||||
storageTags: {
|
||||
label: 'Storage Tags',
|
||||
validation: { required: false }
|
||||
}
|
||||
});
|
||||
var $addPrimaryStorageForm = $('<div>').addClass('setup-form').append(
|
||||
addPrimaryStorageForm.$formContainer
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addPrimaryStorageForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add Primary Storage');
|
||||
|
||||
$addPrimaryStorageForm.find('form').submit(function() {
|
||||
addPrimaryStorageForm.completeAction($addPrimaryStorageForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.primaryStorage');
|
||||
showTooltip($addPrimaryStorageForm, 'addPrimaryStorage');
|
||||
|
||||
// Cleanup
|
||||
$addPrimaryStorageForm.find('.message').remove();
|
||||
$addPrimaryStorageForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
$addPrimaryStorageForm.find('.form-item[rel=clusterId], .form-item[rel=podId]').remove();
|
||||
|
||||
return $addPrimaryStorage.append(
|
||||
$addPrimaryStorageForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Add secondary storage intro text
|
||||
@ -659,52 +600,24 @@
|
||||
* Add secondary storage
|
||||
* @param args
|
||||
*/
|
||||
addSecondaryStorage: function(args) {
|
||||
var $addSecondaryStorage = $('<div></div>').addClass('add-secondary-storage');
|
||||
var addSecondaryStorageForm = cloudStack.dialog.createForm({
|
||||
noDialog: true,
|
||||
form: {
|
||||
title: 'Add new secondary storage',
|
||||
desc: 'Please fill in the following information to add a new secondary storage',
|
||||
fields: {
|
||||
nfsServer: {
|
||||
label: 'NFS Server',
|
||||
validation: { required: true }
|
||||
},
|
||||
path: {
|
||||
label: 'Path',
|
||||
validation: { required: true }
|
||||
}
|
||||
}
|
||||
addSecondaryStorage: elems.step({
|
||||
title: 'Add secondary storage',
|
||||
id: 'add-secondary-storage',
|
||||
stateID: 'secondaryStorage',
|
||||
tooltipID: 'addSecondaryStorage',
|
||||
nextStepID: 'launchInfo',
|
||||
diagram: '.part.zone, .part.secondaryStorage',
|
||||
form: {
|
||||
nfsServer: {
|
||||
label: 'NFS Server',
|
||||
validation: { required: true }
|
||||
},
|
||||
after: function(args) {
|
||||
goTo('launchInfo', 'secondaryStorage', $addSecondaryStorageForm);
|
||||
path: {
|
||||
label: 'Path',
|
||||
validation: { required: true }
|
||||
}
|
||||
});
|
||||
var $addSecondaryStorageForm = $('<div>').addClass('setup-form').append(
|
||||
addSecondaryStorageForm.$formContainer
|
||||
);
|
||||
var $save = elems.nextButton('Continue', { type: 'submit' }).appendTo($addSecondaryStorageForm.find('form'));
|
||||
var $title = $('<div></div>').addClass('title').html('Add Secondary Storage');
|
||||
|
||||
$addSecondaryStorageForm.find('form').submit(function() {
|
||||
addSecondaryStorageForm.completeAction($addSecondaryStorageForm);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
showDiagram('.part.zone, .part.secondaryStorage');
|
||||
showTooltip($addSecondaryStorageForm, 'addSecondaryStorage');
|
||||
|
||||
// Cleanup
|
||||
$addSecondaryStorageForm.find('.message').remove();
|
||||
$addSecondaryStorageForm.find('.form-item').addClass('field').find('label.error').hide();
|
||||
|
||||
return $addSecondaryStorage.append(
|
||||
$addSecondaryStorageForm
|
||||
.prepend($title)
|
||||
);
|
||||
},
|
||||
}
|
||||
}),
|
||||
|
||||
/**
|
||||
* Pre-launch text
|
||||
@ -758,7 +671,8 @@
|
||||
}
|
||||
};
|
||||
|
||||
var initialStep = steps.changeUser().addClass('step');
|
||||
var initialStep = steps.intro().addClass('step');
|
||||
showDiagram('');
|
||||
|
||||
$installWizard.append(
|
||||
elems.header(),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user