Revision 38c65b7f

View differences:

src/sunstone/public/js/plugins/clusters-tab.js
1093 1093
    },
1094 1094
    "Cluster.update_dialog" : {
1095 1095
        type : "action",
1096
        layout: "more_select",
1096
        layout: "main",
1097 1097
        text : tr("Update"),
1098 1098
        alwaysActive: true
1099 1099
    },
src/sunstone/public/js/plugins/datastores-tab.js
105 105
            <option value="iscsi">' + tr("iSCSI") + '</option>\
106 106
            <option value="lvm">' + tr("LVM") + '</option>\
107 107
            <option value="ceph">' + tr("Ceph") + '</option>\
108
            <option value="custom">' + tr("Custom") + '</option>\
108 109
          </select>\
109 110
        </div>\
110 111
        <div class="one columns ">\
......
319 320
    var image_list_array = [];
320 321

  
321 322
    $.each(image_list,function(){
322
        //Grab table data from the image_list
323
      if (this.IMAGE.DATASTORE==datastore_name)
323 324
        image_list_array.push(imageElementArray(this));
324 325
    });
325 326

  
......
571 572
    var element = element_json.DATASTORE;
572 573

  
573 574
    return [
574
        '<input class="check_item" type="checkbox" id="datastore_'+element.ID+'" name="selected_items" value="'+element.ID+'"/>',
575
        '<input class="check_item" type="checkbox" id="datastore_'+
576
                             element.ID+'" name="selected_items" value="'+
577
                             element.ID+'"/>',
575 578
        element.ID,
576 579
        element.UNAME,
577 580
        element.GNAME,
......
622 625
    });
623 626

  
624 627
    updateView(list_array,dataTable_datastores);
625
    updateDatastoreSelect();
626
    updateInfraDashboard("datastores",list);
627 628
}
628 629

  
629 630

  
630 631
function updateDatastoreInfo(request,ds){
631 632
    var info = ds.DATASTORE;
633

  
634
    datastore_name = info.NAME;
635

  
632 636
    var images_str = "";
633 637
    if (info.IMAGES.ID &&
634 638
        info.IMAGES.ID.constructor == Array){
......
675 679
          </table>'
676 680
            + insert_extended_template_table(info.TEMPLATE,
677 681
                                         "Datastore",
678
                                         info.ID) +
682
                                         info.ID,
683
                                         "Configuration Attributes") +
679 684
        '</div>\
680 685
        <div class="six columns">'
681 686
            + insert_permissions_table("Datastore",
......
727 732
            } : ""
728 733
    });
729 734

  
730
    //preload it
731

  
732
    //addElement([
733
    //    spinner,
734
    //    '','','','','','','','','','','',''],dataTable_datastore_images_panel);
735

  
736

  
737 735
    // initialize datatables values
738 736
    Sunstone.runAction("DatastoreImageInfo.list");
739

  
740 737
    Sunstone.runAction("Datastore.fetch_permissions",info.ID);
741 738

  
742 739
}
......
771 768
    var dialog = $create_datastore_dialog;
772 769
    dialog.html(create_datastore_tmpl);
773 770

  
774
    //Prepare jquery dialog
775
    //dialog.dialog({
776
    //    autoOpen: false,
777
    //    modal: true,
778
    //    width: 400
779
    //});
780 771
    dialog.addClass("reveal-modal large");
781 772

  
782
    //$('button',dialog).button();
783 773
    setupTips(dialog);
784 774

  
785 775
    $('#ds_type').change(function(){
......
805 795
          case 'ceph':
806 796
            select_ceph();
807 797
            break;
798
          case 'custom':
799
            select_custom();
800
            break;
808 801
        }
809 802
    });
810 803

  
811 804

  
812 805
    $('#create_datastore_submit',dialog).click(function(){
813
        var context = $( "#create_datastore_form", dialog);
806
        var context         = $( "#create_datastore_form", dialog);
814 807
        var name            = $('#name',context).val();
815 808
        var cluster_id      = $('#cluster_id',context).val();
816 809
        var system          = $('#sys_ds',context).is(':checked');
......
826 819
        var base_iqn        = $('#base_iqn',context).val();
827 820
        var vg_name         = $('#vg_name',context).val();
828 821

  
829

  
830

  
831 822
        if (!name){
832 823
            notifyError("Please provide a name");
833 824
            return false;
......
882 873

  
883 874
function select_filesystem(){
884 875
    $('select#ds_mad').val('fs');
876
    $('select#tm_mad').val('shared');
885 877
    $('select#ds_mad').attr('disabled', 'disabled');
886 878
    $('select#tm_mad').children('option').each(function() {
887 879
      var value_str = $(this).val();
......
901 893
function select_vmware_fs(){
902 894
    $('select#ds_mad').val('vmware');
903 895
    $('select#ds_mad').attr('disabled', 'disabled');
896
    $('select#tm_mad').val('shared');
904 897
    $('select#tm_mad').children('option').each(function() {
905 898
      var value_str = $(this).val();
906 899
      $(this).attr('disabled', 'disabled');
......
927 920
}
928 921

  
929 922
function select_iscsi(){
923
    $('select#ds_mad').val('iscsi');
924
    $('select#ds_mad').attr('disabled', 'disabled');
925
    $('select#tm_mad').val('iscsi');
926
    $('select#tm_mad').attr('disabled', 'disabled');
930 927
    $('label[for="host"],input#host').fadeIn();
931 928
    $('label[for="base_iqn"],input#base_iqn').fadeIn();
932 929
    $('label[for="vg_name"],input#vg_name').fadeIn();
......
967 964
    });
968 965
}
969 966

  
967
function select_custom(){
968
    hide_all(dialog);
969
    $('select#ds_mad').val('fs');
970
    $('select#tm_mad').val('shared');
971
}
972

  
970 973
function popUpCreateDatastoreDialog(){
971 974
    $('select#cluster_id',$create_datastore_dialog).html(clusters_sel());
972 975
    $create_datastore_dialog.reveal();
......
1009 1012
      dataTable_datastores.fnFilter( $(this).val() );
1010 1013
    })
1011 1014

  
1012
    //dataTable_datastores.fnClearTable();
1013
    //addElement([
1014
    //    spinner,
1015
    //    '','','','','','','','',''],dataTable_datastores);
1016 1015
    Sunstone.runAction("Datastore.list");
1017 1016

  
1018 1017
    setupCreateDatastoreDialog();
src/sunstone/public/js/plugins/hosts-tab.js
879 879
        <div class="six columns">'
880 880
        + insert_extended_template_table(host_info.TEMPLATE,
881 881
                                         "Host",
882
                                         host_info.ID) +
882
                                         host_info.ID,
883
                                         "Monitoring Attributes") +
883 884
        '</div>\
884 885
      </div>'
885 886
    }
src/sunstone/public/js/plugins/vnets-tab.js
793 793
        </div>\
794 794
        <div class="six columns">'
795 795
            + insert_permissions_table("Network",
796
                                                 vn_info.ID,
797
                                                 vn_info.UNAME,
798
                                                 vn_info.GNAME,
799
                                                 vn_info.UID,
800
                                                 vn_info.GID)
796
                                       vn_info.ID,
797
                                       vn_info.UNAME,
798
                                       vn_info.GNAME,
799
                                       vn_info.UID,
800
                                       vn_info.GID)
801 801
            + insert_extended_template_table(vn_info.TEMPLATE,
802 802
                                                       "Network",
803
                                                       vn_info.ID) +
803
                                                       vn_info.ID,
804
                                                       "Configuration Attributes") +
804 805
        '</div>\
805 806
      </div>';
806 807

  

Also available in: Unified diff