Skip to content

Commit e58ff4d

Browse files
committed
Pull real form data for server calls
1 parent 105080e commit e58ff4d

1 file changed

Lines changed: 85 additions & 22 deletions

File tree

‎ui/scripts/installWizard.js‎

Lines changed: 85 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,84 @@
1414
});
1515
},
1616

17+
changeUser: function(args) {
18+
$.ajax({
19+
url: createURL('updateUser'),
20+
data: {
21+
id: cloudStack.context.users[0].userid,
22+
password: md5Hashed ? $.md5(args.data.password) : args.data.password
23+
},
24+
dataType: 'json',
25+
async: true,
26+
success: function(data) {
27+
args.response.success({
28+
data: { newUser: data.updateuserresponse.user }
29+
});
30+
}
31+
});
32+
},
33+
34+
// Copy text
35+
copy: {
36+
whatIsCloudStack: function(args) {
37+
args.response.success({
38+
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.'
39+
});
40+
},
41+
42+
whatIsAZone: function(args) {
43+
args.response.success({
44+
text: 'A zone is integral to the CloudStack platform -- your entire network is represented via a zone. More text goes here...'
45+
});
46+
},
47+
48+
whatIsAPod: function(args) {
49+
args.response.success({
50+
text: 'A pod is a part of a zone. More text goes here...'
51+
});
52+
},
53+
54+
whatIsACluster: function(args) {
55+
args.response.success({
56+
text: 'A cluster is a part of a zone. More text goes here...'
57+
});
58+
},
59+
60+
whatIsAHost: function(args) {
61+
args.response.success({
62+
text: 'A host is a part of a zone. More text goes here...'
63+
});
64+
},
65+
66+
whatIsPrimaryStorage: function(args) {
67+
args.response.success({
68+
text: 'Primary storage is a part of a zone. More text goes here...'
69+
});
70+
},
71+
72+
whatIsSecondaryStorage: function(args) {
73+
args.response.success({
74+
text: 'Secondary storage is a part of a zone. More text goes here...'
75+
});
76+
}
77+
},
78+
1779
action: function(args) {
1880
var complete = args.response.success;
81+
var data = args.data
1982

2083
/**
2184
* Step 1: add zone
2285
*/
2386
var createZone = function(args) {
87+
debugger;
2488
$.ajax({
2589
url: createURL('createZone'),
2690
data: {
27-
name: 'brian-zone',
91+
name: data.zone.name,
2892
networktype: 'Basic',
29-
dns1: '8.8.8.8',
30-
internaldns1: '10.223.110.223'
93+
internaldns1: data.zone.internaldns1,
94+
internaldns2: data.zone.internaldns2
3195
},
3296
dataType: 'json',
3397
async: true,
@@ -48,12 +112,12 @@
48112
$.ajax({
49113
url: createURL('createPod'),
50114
data: {
51-
name: 'brian-pod',
115+
name: data['pod-name'],
52116
zoneid: args.data.zone.id,
53-
gateway: '10.223.183.1',
54-
netmask: '255.255.255.0',
55-
startip: '10.223.183.10',
56-
endip: '10.223.183.20'
117+
gateway: data['pod-gateway'],
118+
netmask: data['pod-netmask'],
119+
startip: data['pod-ip-range-start'],
120+
endip: data['pod-ip-range-end']
57121
},
58122
dataType: 'json',
59123
async: true,
@@ -74,13 +138,12 @@
74138
$.ajax({
75139
url: createURL('createVlanIpRange'),
76140
data: {
77-
name: 'brian-zone',
78141
zoneid: args.data.zone.id,
79142
vlan: 'untagged',
80-
gateway: '10.223.183.1',
81-
netmask: '255.255.255.0',
82-
startip: '10.223.183.50',
83-
endip: '10.223.183.100'
143+
gateway: data['guest-gateway'],
144+
netmask: data['guest-netmask'],
145+
startip: data['guest-ip-range-start'],
146+
endip: data['guest-ip-range-end']
84147
},
85148
dataType: 'json',
86149
async: true,
@@ -101,10 +164,10 @@
101164
$.ajax({
102165
url: createURL('addCluster'),
103166
data: {
104-
clustername: 'brian-cluster-xen',
167+
clustername: data.cluster.name,
105168
podid: args.data.pod.id,
106169
zoneid: args.data.zone.id,
107-
hypervisor: 'XenServer',
170+
hypervisor: data.cluster.hypervisor,
108171
clustertype: 'CloudManaged'
109172
},
110173
dataType: 'json',
@@ -126,14 +189,14 @@
126189
$.ajax({
127190
url: createURL('addHost'),
128191
data: {
129-
clustername: 'brian-cluster-xen',
192+
clustername: args.data.cluster.name,
130193
zoneid: args.data.zone.id,
131194
podid: args.data.pod.id,
132195
hypervisor: 'XenServer',
133196
clustertype: 'CloudManaged',
134-
url: 'http://10.223.183.2',
135-
username: 'root',
136-
password: 'password'
197+
url: 'http://' + data.host.hostname,
198+
username: data.host.username,
199+
password: data.host.password
137200
},
138201
dataType: 'json',
139202
async: true,
@@ -154,13 +217,13 @@
154217
$.ajax({
155218
url: createURL('createStoragePool'),
156219
data: {
157-
name: 'brian-primary-storage',
220+
name: data.primaryStorage.name,
158221
clusterid: args.data.cluster.id,
159222
zoneid: args.data.zone.id,
160223
podid: args.data.pod.id,
161224
hypervisor: 'XenServer',
162225
clustertype: 'CloudManaged',
163-
url: 'nfs://10.223.110.232/export/home/bfederle/primary'
226+
url: 'nfs://' + data.primaryStorage.server + data.primaryStorage.path
164227
},
165228
dataType: 'json',
166229
async: true,
@@ -183,7 +246,7 @@
183246
data: {
184247
clusterid: args.data.cluster.id,
185248
zoneid: args.data.zone.id,
186-
url: 'nfs://10.223.110.232/export/home/bfederle/secondary'
249+
url: 'nfs://' + data.secondaryStorage.nfsServer + data.secondaryStorage.path
187250
},
188251
dataType: 'json',
189252
async: true,

0 commit comments

Comments
 (0)