Revision 740826d9

View differences:

src/sunstone/public/js/plugins/templates-tab.js
317 317
               popUpInstantiateVMTemplateDialog();
318 318
             }
319 319
             else
320
             {             
320
             {
321 321
               $.each(nodes,function(){
322 322
                 Sunstone.runAction("Template.instantiate",this,"");
323 323
               });
......
1023 1023
            "aiExclude": [ 0 ]
1024 1024
        },
1025 1025
        "aoColumnDefs": [
1026
            { "bSortable": false, "aTargets": ["check"] },
1027
            { "sWidth": "60px", "aTargets": [0,2,3,9,10] },
1028
            { "sWidth": "35px", "aTargets": [1,6,11,12] },
1029
            { "sWidth": "100px", "aTargets": [5,7] },
1030
            { "sWidth": "150px", "aTargets": [8] },
1026
            { "sWidth": "35px", "aTargets": [0,1] },
1031 1027
            { "bVisible": false, "aTargets": [0,2,3,6,9,8,12]}
1032 1028
        ],
1033 1029
        "oLanguage": (datatable_lang != "") ?
......
1263 1259
                  "aiExclude": [ 0 ]
1264 1260
              },
1265 1261
              "aoColumnDefs": [
1266
                  { "bSortable": false, "aTargets": ["check"] },
1267
                  { "sWidth": "60px", "aTargets": [0,6,7,8] },
1268
                  { "sWidth": "35px", "aTargets": [1] },
1269
                  { "sWidth": "100px", "aTargets": [2,3,5] },
1262
                  { "sWidth": "35px", "aTargets": [0,1] },
1270 1263
                  { "bVisible": false, "aTargets": [0, 7]}
1271 1264
              ],
1272 1265
              "oLanguage": (datatable_lang != "") ?
......
1676 1669

  
1677 1670
        // Append the new div containing the tab and add the tab to the list
1678 1671
        var html_tab_content = '<li id="'+str_disk_tab_id+'Tab" class="disk wizard_internal_tab">'+
1679
          generate_disk_tab_content(str_disk_tab_id, str_datatable_id) + 
1672
          generate_disk_tab_content(str_disk_tab_id, str_datatable_id) +
1680 1673
        '</li>'
1681 1674
        $(html_tab_content).appendTo($("ul#template_create_storage_tabs_content"));
1682 1675

  
......
1743 1736
      var str_datatable_id = 'datatable_template_networks' + number_of_nics;
1744 1737

  
1745 1738
      var html_tab_content = '<li id="'+str_nic_tab_id+'Tab" class="nic wizard_internal_tab">'+
1746
          generate_nic_tab_content(str_nic_tab_id, str_datatable_id) + 
1739
          generate_nic_tab_content(str_nic_tab_id, str_datatable_id) +
1747 1740
        '</li>'
1748 1741

  
1749 1742
      // Append the new div containing the tab and add the tab to the list
......
2015 2008
                "aiExclude": [ 0 ]
2016 2009
            },
2017 2010
            "aoColumnDefs": [
2018
                { "bSortable": false, "aTargets": ["check"] },
2019
                { "sWidth": "60px", "aTargets": [0,2,3,9,10] },
2020
                { "sWidth": "35px", "aTargets": [1,6,11,12] },
2021
                { "sWidth": "100px", "aTargets": [5,7] },
2022
                { "sWidth": "150px", "aTargets": [8] },
2011
                { "sWidth": "35px", "aTargets": [0,1] },
2023 2012
                { "bVisible": false, "aTargets": [0,3,2,5,6,7,9,8,11,12,10]}
2024 2013
            ],
2025 2014
            "oLanguage": (datatable_lang != "") ?
......
2088 2077
                "aiExclude": [ 0 ]
2089 2078
            },
2090 2079
            "aoColumnDefs": [
2091
                { "bSortable": false, "aTargets": ["check"] },
2092
                { "sWidth": "60px", "aTargets": [0,2,3,9,10] },
2093
                { "sWidth": "35px", "aTargets": [1,6,11,12] },
2094
                { "sWidth": "100px", "aTargets": [5,7] },
2095
                { "sWidth": "150px", "aTargets": [8] },
2080
                { "sWidth": "35px", "aTargets": [0,1] },
2096 2081
                { "bVisible": false, "aTargets": [0,2,3,5,6,7,9,8,10,11,12]}
2097 2082
            ],
2098 2083
            "oLanguage": (datatable_lang != "") ?
......
2487 2472
          },
2488 2473
          "aoColumnDefs": [
2489 2474
              { "bSortable": false, "aTargets": ["check"] },
2490
              { "sWidth": "60px", "aTargets": [0,2,3,9,10] },
2491
              { "sWidth": "35px", "aTargets": [1,6,11,12] },
2492
              { "sWidth": "100px", "aTargets": [5,7] },
2493
              { "sWidth": "150px", "aTargets": [8] },
2475
              { "sWidth": "35px", "aTargets": [0,1] },
2494 2476
              { "bVisible": false, "aTargets": [0,2,3,5,6,7,9,8,10,11,12]}
2495 2477
          ],
2496 2478
          "oLanguage": (datatable_lang != "") ?
......
2752 2734
          },
2753 2735
          "bAutoWidth":false,
2754 2736
          "aoColumnDefs": [
2755
              { "bSortable": false, "aTargets": ["check"] },
2756
              { "sWidth": "60px", "aTargets": [0,4] },
2757
              { "sWidth": "35px", "aTargets": [1] },
2758
              { "sWidth": "100px", "aTargets": [9,3,10,11,12] },
2759
              { "sWidth": "150", "aTargets": [5,6,7,8] },
2737
              { "sWidth": "35px", "aTargets": [0,1] },
2760 2738
              { "bVisible": false, "aTargets": [0,3,5,7,10,11,12]}
2761 2739
          ],
2762 2740
          "oLanguage": (datatable_lang != "") ?
......
2856 2834
          },
2857 2835
          "bAutoWidth":false,
2858 2836
          "aoColumnDefs": [
2859
              { "bSortable": false, "aTargets": ["check"] },
2860
              { "sWidth": "60px", "aTargets": [0] },
2861
              { "sWidth": "35px", "aTargets": [1,3,4,5] },
2837
              { "sWidth": "35px", "aTargets": [0,1] },
2862 2838
              { "bVisible": false, "aTargets": [0]}
2863 2839
          ],
2864 2840
          "oLanguage": (datatable_lang != "") ?
......
4070 4046
    },INTERVAL+someTime());
4071 4047
};
4072 4048

  
4073
// Instantiate dialog 
4049
// Instantiate dialog
4074 4050
// Sets up the instiantiate template dialog and all the processing associated to it
4075 4051
function setupInstantiateTemplateDialog(){
4076 4052

  
......
4130 4106
        "sDom" : "<'H'>t<'row'<'six columns'i><'six columns'p>>",
4131 4107
        "aoColumnDefs": [
4132 4108
            { "bSortable": false, "aTargets": ["check"] },
4133
            { "sWidth": "60px", "aTargets": [0] },
4134
            { "sWidth": "35px", "aTargets": [1] },
4109
            { "sWidth": "35px", "aTargets": [0,1] },
4135 4110
            { "sWidth": "150px", "aTargets": [5] },
4136 4111
            { "sWidth": "100px", "aTargets": [2,3] }
4137 4112
        ]
src/sunstone/public/js/plugins/vms-tab.js
1387 1387
                      <th>'+tr("MESSAGE")+'</th>\
1388 1388
                      <th colspan="">'+tr("Actions")+'</th>\
1389 1389
                   </tr>\
1390
                  </thead>' + 
1390
                  </thead>' +
1391 1391
                    fromJSONtoActionsTable(
1392 1392
                                      vm_info.USER_TEMPLATE.SCHED_ACTION) +
1393 1393
                 '</table>\
......
1435 1435
        });
1436 1436

  
1437 1437
        return false;
1438
    }); 
1438
    });
1439 1439

  
1440
    $("#submit_scheduling_action").live("click", function() { 
1440
    $("#submit_scheduling_action").live("click", function() {
1441 1441
        var date_input_value = $("#date_time_input").val();
1442 1442

  
1443
        if (date_input_value=="") 
1443
        if (date_input_value=="")
1444 1444
          return false;
1445 1445

  
1446 1446
        // Calculate MAX_ID
......
1476 1476

  
1477 1477
        // Let OpenNebula know
1478 1478
        var template_str = convert_template_to_string(vm_info.USER_TEMPLATE);
1479
        Sunstone.runAction("VM.update_template",vm_info.ID,template_str);        
1479
        Sunstone.runAction("VM.update_template",vm_info.ID,template_str);
1480 1480

  
1481 1481
        $("#add_scheduling_action").removeAttr("disabled");
1482 1482
        return false;
......
1527 1527

  
1528 1528
        // Time
1529 1529
        var time_value_str = $(".tr_action_"+index+" .time_row").text();
1530
        $(".tr_action_"+index+" .time_row").html('<div><input style="width:90%;" class="input_edit_time" id="input_edit_time_'+ 
1530
        $(".tr_action_"+index+" .time_row").html('<div><input style="width:90%;" class="input_edit_time" id="input_edit_time_'+
1531 1531
                        index+'" type="text" value="'+time_value_str+'">\
1532 1532
                        <a class="date_time_picker_link">t</a></div>');
1533 1533

  
......
1599 1599
    var str = ""
1600 1600
    if (!actions_array){ return "";}
1601 1601
    if (!$.isArray(actions_array))
1602
    { 
1602
    {
1603 1603
      var tmp_array = new Array();
1604 1604
      tmp_array[0]  = actions_array;
1605 1605
      actions_array = tmp_array;
......
1742 1742

  
1743 1743
            var save_as;
1744 1744
            // Snapshot deferred
1745
            if ( 
1745
            if (
1746 1746
               ( // ACTIVE
1747
                vm_info.STATE == "3") && 
1747
                vm_info.STATE == "3") &&
1748 1748
               ( // HOTPLUG_SAVEAS HOTPLUG_SAVEAS_POWEROFF HOTPLUG_SAVEAS_SUSPENDED
1749
                vm_info.LCM_STATE == "26" || vm_info.LCM_STATE == "27" || vm_info.LCM_STATE == "28") && 
1750
               ( // 
1749
                vm_info.LCM_STATE == "26" || vm_info.LCM_STATE == "27" || vm_info.LCM_STATE == "28") &&
1750
               ( //
1751 1751
                disk.SAVE_AS_ACTIVE == "YES")
1752 1752
               ) {
1753 1753
              save_as = "in progress";
1754 1754
              actions = 'deferred snapshot in progress'
1755
            } 
1755
            }
1756 1756
            // Snapshot Hot
1757
            else if ( 
1757
            else if (
1758 1758
               ( // ACTIVE
1759
                vm_info.STATE == "3") && 
1759
                vm_info.STATE == "3") &&
1760 1760
               ( // HOTPLUG_SAVEAS HOTPLUG_SAVEAS_POWEROFF HOTPLUG_SAVEAS_SUSPENDED
1761
                vm_info.LCM_STATE == "26" || vm_info.LCM_STATE == "27" || vm_info.LCM_STATE == "28") && 
1762
               ( // 
1761
                vm_info.LCM_STATE == "26" || vm_info.LCM_STATE == "27" || vm_info.LCM_STATE == "28") &&
1762
               ( //
1763 1763
                disk.HOTPLUG_SAVE_AS_ACTIVE == "YES")
1764 1764
               ) {
1765 1765
              save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-');
1766
              actions = 'hot snapshot in progress' 
1766
              actions = 'hot snapshot in progress'
1767 1767
            }
1768 1768
            // Attach / Detach
1769
            else if ( 
1769
            else if (
1770 1770
               ( // ACTIVE
1771
                vm_info.STATE == "3") && 
1771
                vm_info.STATE == "3") &&
1772 1772
               ( // HOTPLUG_SAVEAS HOTPLUG_SAVEAS_POWEROFF HOTPLUG_SAVEAS_SUSPENDED
1773
                vm_info.LCM_STATE == "17") && 
1774
               ( // 
1773
                vm_info.LCM_STATE == "17") &&
1774
               ( //
1775 1775
                disk.ATTACH = "YES")
1776
               ) { 
1776
               ) {
1777 1777
              save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-');
1778 1778
              actions = 'attach/detach in progress'
1779 1779
            }
......
1781 1781
              save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-');
1782 1782

  
1783 1783
              actions = '';
1784
              
1784

  
1785 1785
              if ((vm_info.STATE == "3" && vm_info.LCM_STATE == "3") || vm_info.STATE == "5" || vm_info.STATE == "8") {
1786 1786
                actions += '<a href="VM.saveas" class="saveas" ><i class="icon-save"/>'+tr("Snapshot")+'</a> &emsp;'
1787 1787
              }
......
2008 2008

  
2009 2009
        //b.html(spinner);
2010 2010
        return false;
2011
    }); 
2011
    });
2012 2012

  
2013 2013
    $('#refresh_disk').live('click', function(){
2014 2014
        var b = $(this);
......
2016 2016
        Sunstone.runAction("VM.showdisks", vm_id);
2017 2017

  
2018 2018
        return false;
2019
    }); 
2019
    });
2020 2020
}
2021 2021

  
2022 2022

  
......
2084 2084

  
2085 2085
            var save_as;
2086 2086
            // Attach / Detach
2087
            if ( 
2087
            if (
2088 2088
               ( // ACTIVE
2089
                vm_info.STATE == "3") && 
2089
                vm_info.STATE == "3") &&
2090 2090
               ( // HOTPLUG_NIC
2091
                vm_info.LCM_STATE == "25") && 
2092
               ( // 
2091
                vm_info.LCM_STATE == "25") &&
2092
               ( //
2093 2093
                nic.ATTACH == "YES")
2094 2094
               ) {
2095 2095
              actions = 'attach/detach in progress'
......
2258 2258

  
2259 2259
        //b.html(spinner);
2260 2260
        return false;
2261
    }); 
2261
    });
2262 2262

  
2263 2263
    $('#refresh_nic').live('click', function(){
2264 2264
        var b = $(this);
......
2266 2266
        Sunstone.runAction("VM.shownics", vm_id);
2267 2267

  
2268 2268
        return false;
2269
    }); 
2269
    });
2270 2270
}
2271 2271

  
2272 2272

  
......
2446 2446

  
2447 2447
        //b.html(spinner);
2448 2448
        return false;
2449
    }); 
2449
    });
2450 2450

  
2451 2451
    $('#refresh_capacity').live('click', function(){
2452 2452
        var b = $(this);
......
2454 2454
        Sunstone.runAction("VM.showcapacity", vm_id);
2455 2455

  
2456 2456
        return false;
2457
    }); 
2457
    });
2458 2458
}
2459 2459

  
2460 2460

  
......
2518 2518
        for (var i = 0; i < snapshots.length; i++){
2519 2519
            var snapshot = snapshots[i];
2520 2520

  
2521
            if ( 
2521
            if (
2522 2522
               ( // ACTIVE
2523
                vm_info.STATE == "3") && 
2523
                vm_info.STATE == "3") &&
2524 2524
               ( // HOTPLUG_SNAPSHOT
2525 2525
                vm_info.LCM_STATE == "24"))  {
2526
              actions = 'snapshot in progress' 
2526
              actions = 'snapshot in progress'
2527 2527
            }
2528 2528
            else {
2529 2529
              actions = '';
2530
              
2530

  
2531 2531
              if ((vm_info.STATE == "3" && vm_info.LCM_STATE == "3")) {
2532 2532
                actions += '<a href="VM.snapshot_revert" class="snapshot_revert" ><i class="icon-reply"/>'+tr("Revert")+'</a> &emsp;'
2533 2533
                actions += '<a href="VM.snapshot_delete" class="snapshot_delete" ><i class="icon-remove"/>'+tr("Delete")+'</a>'
......
2655 2655

  
2656 2656
        //b.html(spinner);
2657 2657
        return false;
2658
    }); 
2658
    });
2659 2659

  
2660 2660
    $('#refresh_snapshot').live('click', function(){
2661 2661
        var b = $(this);
......
2663 2663
        Sunstone.runAction("VM.showsnapshots", vm_id);
2664 2664

  
2665 2665
        return false;
2666
    }); 
2666
    });
2667 2667
}
2668 2668

  
2669 2669

  
......
2884 2884
        },
2885 2885
        "aoColumnDefs": [
2886 2886
            { "bSortable": false, "aTargets": ["check"] },
2887
            { "sWidth": "60px", "aTargets": [0,6,7] },
2888
            { "sWidth": "35px", "aTargets": [1,11] },
2889
            { "sWidth": "150px", "aTargets": [5,10] },
2890
            { "sWidth": "100px", "aTargets": [2,3,9] },
2887
            { "sWidth": "35px", "aTargets": [0,1] },
2891 2888
            { "bVisible": false, "aTargets": [6,7,10]}
2892 2889
        ],
2893 2890
        "oLanguage": (datatable_lang != "") ?

Also available in: Unified diff