Revision e5e5d5c6 ui/static/synnefo.js
b/ui/static/synnefo.js | ||
---|---|---|
64 | 64 |
try { |
65 | 65 |
ajax_error(jqXHR.status, undefined, 'Unknown', jqXHR.responseText); |
66 | 66 |
} catch(err) { |
67 |
if (!isXhrException(err)) { |
|
68 |
ajax_error(-501, "UI Error", 'Generic error', err); |
|
69 |
} else { |
|
70 |
return false; |
|
71 |
} |
|
67 |
ajax_error(-1, textStatus, 'Unknown', "NETWORK ERROR"); |
|
72 | 68 |
} |
73 | 69 |
} |
74 | 70 |
|
... | ... | |
423 | 419 |
try { |
424 | 420 |
ajax_error(jqXHR.status, undefined, 'Update VMs', jqXHR.responseText); |
425 | 421 |
} catch(err) { |
426 |
if (!isXhrException(err)) { |
|
427 |
ajax_error(-502, "UI Error", 'Update VMs', err); |
|
428 |
} else { |
|
429 |
return false; |
|
430 |
} |
|
422 |
ajax_error(-1, textStatus, 'Update VMs', "NETWORK ERROR"); |
|
431 | 423 |
} |
432 | 424 |
return false; |
433 | 425 |
}, |
... | ... | |
592 | 584 |
try { |
593 | 585 |
ajax_error(jqXHR.status, undefined, 'Update networks', jqXHR.responseText); |
594 | 586 |
} catch(err) { |
595 |
if (!isXhrException(err)) { |
|
596 |
ajax_error(-504, "UI Error", 'Update networks', err); |
|
597 |
} else { |
|
598 |
return false; |
|
599 |
} |
|
587 |
ajax_error(-1, textStatus, 'Update networks', "NETWORK ERROR"); |
|
600 | 588 |
} |
601 | 589 |
return false; |
602 | 590 |
}, |
... | ... | |
660 | 648 |
try { |
661 | 649 |
ajax_error(jqXHR.status, undefined, 'Update network names', jqXHR.responseText); |
662 | 650 |
} catch(err) { |
663 |
ajax_error(-506, "UI Error", 'Update network names', err);
|
|
651 |
ajax_error(-1, textStatus, 'Update network names', "NETWORK ERROR");
|
|
664 | 652 |
} |
665 | 653 |
return false; |
666 | 654 |
}, |
... | ... | |
708 | 696 |
try { |
709 | 697 |
ajax_error(jqXHR.status, undefined, 'Update Images', jqXHR.responseText); |
710 | 698 |
} catch(err) { |
711 |
ajax_error(-508, "UI error", 'Update Images', err);
|
|
699 |
ajax_error(-1, textStatus, 'Update Images', "NETWORK ERROR");
|
|
712 | 700 |
} |
713 | 701 |
}, |
714 | 702 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
834 | 822 |
try { |
835 | 823 |
ajax_error(jqXHR.status, undefined, 'Update Flavors', jqXHR.responseText); |
836 | 824 |
} catch (err) { |
837 |
ajax_error(-509, "UI Error", "Update Flavors", err);
|
|
825 |
ajax_error(-1, textStatus, "Update Flavors", "NETWORK ERROR");
|
|
838 | 826 |
} |
839 | 827 |
// start updating vm list |
840 | 828 |
update_vms(UPDATE_INTERVAL); |
... | ... | |
984 | 972 |
try { |
985 | 973 |
ajax_error(jqXHR.status, undefined, 'Create VM', jqXHR.responseText); |
986 | 974 |
} catch(err) { |
987 |
if (!isXhrException(err)) { |
|
988 |
ajax_error(-510, "UI Error", 'Create VM', err); |
|
989 |
} |
|
975 |
ajax_error(-1, textStatus, 'Create VM', "NETWORK ERROR"); |
|
990 | 976 |
} |
991 | 977 |
}, |
992 | 978 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1446 | 1432 |
$("a#metadata-scrollable").data('overlay').close(); |
1447 | 1433 |
ajax_error(jqXHR.status, undefined, 'Get metadata', jqXHR.responseText); |
1448 | 1434 |
} catch (err) { |
1449 |
if (!isXhrException(err)) { |
|
1450 |
ajax_error(-511, "UI Error", "Get metadata", err); |
|
1451 |
} else { |
|
1452 |
return false; |
|
1453 |
} |
|
1435 |
ajax_error(-1, textStatus, 'Get metadata', "NETWORK ERROR"); |
|
1454 | 1436 |
} |
1455 | 1437 |
}, |
1456 | 1438 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1482 | 1464 |
$("a#metadata-scrollable").data('overlay').close(); |
1483 | 1465 |
ajax_error(jqXHR.status, undefined, 'Delete metadata', jqXHR.responseText); |
1484 | 1466 |
} catch (err) { |
1485 |
if (!isXhrException(err)) { |
|
1486 |
ajax_error(-512, "UI Error", "Delete metadata", err); |
|
1487 |
} else { |
|
1488 |
return false; |
|
1489 |
} |
|
1467 |
ajax_error(-1, textStatus, 'Delete metadata', "NETWORK ERROR"); |
|
1490 | 1468 |
} |
1491 | 1469 |
}, |
1492 | 1470 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1517 | 1495 |
$("a#metadata-scrollable").data('overlay').close(); |
1518 | 1496 |
ajax_error(jqXHR.status, undefined, 'Add metadata', jqXHR.responseText); |
1519 | 1497 |
} catch (err) { |
1520 |
if (!isXhrException(err)) { |
|
1521 |
ajax_error(-513, "UI Error", "Add metadata", err); |
|
1522 |
} else { |
|
1523 |
return false; |
|
1524 |
} |
|
1498 |
ajax_error(-1, textStatus, 'Add metadata', "NETWORK ERROR"); |
|
1525 | 1499 |
} |
1526 | 1500 |
}, |
1527 | 1501 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1569 | 1543 |
try { |
1570 | 1544 |
ajax_error(jqXHR.status, undefined, 'Get server stats', jqXHR.responseText); |
1571 | 1545 |
} catch(err) { |
1572 |
if (!isXhrException(err)) { |
|
1573 |
ajax_error(-520, "UI Error", "Get server stats", err); |
|
1574 |
} |
|
1546 |
ajax_error(-1, textStatus, 'Get server stats', "NETWORK ERROR"); |
|
1575 | 1547 |
} |
1576 | 1548 |
}, |
1577 | 1549 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1730 | 1702 |
$("a#networkscreate").overlay().close(); |
1731 | 1703 |
ajax_error(jqXHR.status, undefined, 'Create network', jqXHR.responseText); |
1732 | 1704 |
} catch (err) { |
1733 |
if (!isXhrException(err)) { |
|
1734 |
ajax_error(-514, "UI Error", "Create network", err); |
|
1735 |
} else { |
|
1736 |
return false; |
|
1737 |
} |
|
1705 |
ajax_error(-1, textStatus, 'Create network', "NETWORK ERROR"); |
|
1738 | 1706 |
} |
1739 | 1707 |
}, |
1740 | 1708 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1780 | 1748 |
try { |
1781 | 1749 |
ajax_error(jqXHR.status, undefined, 'Rename network', jqXHR.responseText); |
1782 | 1750 |
} catch (err) { |
1783 |
if (!isXhrException(err)) { |
|
1784 |
ajax_error(-515, "UI Error", 'Rename network', err); |
|
1785 |
} else { |
|
1786 |
return false; |
|
1787 |
} |
|
1751 |
ajax_error(-1, textStatus, 'Rename network', "NETWORK ERROR"); |
|
1788 | 1752 |
} |
1789 | 1753 |
}, |
1790 | 1754 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1871 | 1835 |
$("a#add-machines-overlay").data('overlay').close(); |
1872 | 1836 |
ajax_error(jqXHR.status, undefined, 'Add server to network', jqXHR.responseText); |
1873 | 1837 |
} catch (err) { |
1874 |
if (!isXhrException(err)) { |
|
1875 |
ajax_error(-516, "UI Error", 'Add server to network', err); |
|
1876 |
} else { |
|
1877 |
return false; |
|
1878 |
} |
|
1838 |
ajax_error(-1, textStatus, 'Add server to network', "NETWORK ERROR"); |
|
1879 | 1839 |
} |
1880 | 1840 |
}, |
1881 | 1841 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1921 | 1881 |
timeout: TIMEOUT, |
1922 | 1882 |
error: function(jqXHR, textStatus, errorThrown) { |
1923 | 1883 |
try { |
1924 |
ajax_error(jqXHR.status, undefined, 'Remove server form network', jqXHR.responseText);
|
|
1884 |
ajax_error(jqXHR.status, undefined, 'Remove server from network', jqXHR.responseText);
|
|
1925 | 1885 |
} catch (err) { |
1926 |
if (!isXhrException(err)) { |
|
1927 |
ajax_error(-517, "UI Error", 'Remove server form network', err); |
|
1928 |
} else { |
|
1929 |
return false; |
|
1930 |
} |
|
1886 |
ajax_error(-1, textStatus, 'Remove server from network', "NETWORK ERROR"); |
|
1931 | 1887 |
} |
1932 | 1888 |
}, |
1933 | 1889 |
success: function(data, textStatus, jqXHR) { |
... | ... | |
1968 | 1924 |
try { |
1969 | 1925 |
ajax_error(jqXHR.status, undefined, 'Set firewall profile', jqXHR.responseText); |
1970 | 1926 |
} catch (err) { |
1971 |
if (!isXhrException(err)) { |
|
1972 |
ajax_error(-518, "UI Error", 'Set firewall profile', err); |
|
1973 |
} else { |
|
1974 |
return false; |
|
1975 |
} |
|
1927 |
ajax_error(-1, textStatus, 'Set firewall profile', "NETWORK ERROR"); |
|
1976 | 1928 |
} |
1977 | 1929 |
}, |
1978 | 1930 |
success: function(data, textStatus, jqXHR) { |
Also available in: Unified diff