Revision a37690bd

b/ui/templates/list.html
160 160
	}
161 161
});
162 162

  
163
// reboot action
163

  
164 164
$("a.enabled#action-reboot").live('click', function() {
165
    // reboot action
166
    var payload = {
167
        "reboot": {"type" : "HARD"}
168
    };   
169

  
165 170
	var checked = $("tbody input[type='checkbox']:checked").toArray();	
166 171
	for (c in checked) {
167 172
		$.ajax({
168 173
			url: '/api/v1.0/servers/' + checked[c].id.replace('input-','') + '/action',
169 174
			type: "POST",
170
			data: {
171
				"reboot": '{"type" : "HARD"}'
172
				},
173 175
			dataType: "json",
176
            data: JSON.stringify(payload),
174 177
			success: function() {}
175 178
		});
176 179
	}
177 180
});
178 181

  
179
// shutdown action. Not implemented by rackspace API atm
180
$("a.enabled#action-shutdown").live('click', function() {
182

  
183
$("a.enabled#action-start").live('click', function() {
184
    // start action
185
    var payload = {
186
        "start": {"type" : "NORMAL"}
187
    };   
188

  
181 189
	var checked = $("tbody input[type='checkbox']:checked").toArray();	
182 190
	for (c in checked) {
183 191
		$.ajax({
184 192
			url: '/api/v1.0/servers/' + checked[c].id.replace('input-','') + '/action',
185 193
			type: "POST",
186
			data: {
187
				"shutdown": '{"timeout" : "5"}'
188
				},
194
            dataType: "json",
195
            data: JSON.stringify(payload),
196
			success: function() {}
197
		});
198
	}
199
});
200

  
201

  
202
$("a.enabled#action-shutdown").live('click', function() {
203
    // shutdown action. Not implemented by rackspace API atm
204
    var payload = {
205
        "shutdown": {"timeout" : "5"}
206
    };   
207

  
208
	var checked = $("tbody input[type='checkbox']:checked").toArray();	
209
	for (c in checked) {
210
		$.ajax({
211
			url: '/api/v1.0/servers/' + checked[c].id.replace('input-','') + '/action',
212
			type: "POST",			
189 213
			dataType: "json",
214
            data: JSON.stringify(payload),
190 215
			success: function() {}
191 216
		});
192 217
	}

Also available in: Unified diff