Revision 7e45ddef ui/static/synnefo.js

b/ui/static/synnefo.js
248 248
			
249 249
			if (jqXHR.status == 200 || jqXHR.status == 203) {
250 250
				try {
251
					servers = data.servers;
251
					servers = data.servers.values;
252 252
				} catch(err) { ajax_error('400', undefined, 'Update VMs', jqXHR.responseText);}
253 253
				update_machines_view(data);
254 254
			} else if (jqXHR.status != 304){
......
470 470
            }
471 471
        }
472 472
    };
473

  
473
	var uri = API_URL + '/servers';
474 474

  
475 475
    $.ajax({
476
    url: API_URL + '/servers',
476
    url: uri,
477 477
    type: "POST",
478
	contentType: "application/json",
478 479
    dataType: "json",    
479 480
    data: JSON.stringify(payload),
480 481
    timeout: TIMEOUT,
......
505 506
	
506 507
	$.ajax({
507 508
		url: API_URL + '/servers/' + serverID + '/action',
508
		type: "POST",        
509
		type: "POST",
510
		contentType: "application/json",
509 511
		dataType: "json",
510 512
		data: JSON.stringify(payload),
511 513
		timeout: TIMEOUT,
......
545 547
    $.ajax({
546 548
	    url: API_URL + '/servers/' + serverID + '/action',
547 549
	    type: "POST",
550
		contentType: "application/json",
548 551
	    dataType: "json",
549 552
        data: JSON.stringify(payload),
550 553
        timeout: TIMEOUT,
......
582 585
    $.ajax({
583 586
	    url: API_URL + '/servers/' + serverID,
584 587
	    type: "DELETE",
588
		contentType: "application/json",
585 589
	    dataType: "json",
586 590
        data: JSON.stringify(payload),
587 591
        timeout: TIMEOUT,
......
621 625
    $.ajax({
622 626
        url: API_URL + '/servers/' + serverID + '/action',
623 627
        type: "POST",
628
		contentType: "application/json",
624 629
        dataType: "json",
625 630
        data: JSON.stringify(payload),
626 631
        timeout: TIMEOUT,

Also available in: Unified diff