Revision d289fb8f

View differences:

src/sunstone/etc/sunstone-views/admin.yaml
51 51
    instantiate_hide_cpu: false
52 52

  
53 53
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
54
    instanciate_cpu_factor: false
54
    instantiate_cpu_factor: false
55

  
56
    # True to show the option to make persistent a instance
57
    instantiate_persistent: true
55 58

  
56 59
    # True to show an input to specify the the VMs and Template path/folder where a vCenter VM will
57 60
    # deployed to
src/sunstone/etc/sunstone-views/admin_vcenter.yaml
51 51
    instantiate_hide_cpu: false
52 52

  
53 53
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
54
    instanciate_cpu_factor: false
54
    instantiate_cpu_factor: false
55

  
56
    # True to show the option to make persistent a instance
57
    instantiate_persistent: true
55 58

  
56 59
    # True to show an input to specify the the VMs and Template path/folder where a vCenter VM will
57 60
    # deployed to
src/sunstone/etc/sunstone-views/cloud.yaml
19 19
    instantiate_hide_cpu: false
20 20
    
21 21
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
22
    instanciate_cpu_factor: false
22
    instantiate_cpu_factor: false
23

  
24
    # True to show the option to make persistent a instance
25
    instantiate_persistent: true
23 26
tabs:
24 27
    provision-tab:
25 28
        panel_tabs:
src/sunstone/etc/sunstone-views/cloud_vcenter.yaml
19 19
    instantiate_hide_cpu: true
20 20
    
21 21
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
22
    instanciate_cpu_factor: false
22
    instantiate_cpu_factor: false
23

  
24
    # True to show the option to make persistent a instance
25
    instantiate_persistent: true
23 26
tabs:
24 27
    provision-tab:
25 28
        panel_tabs:
src/sunstone/etc/sunstone-views/groupadmin.yaml
51 51
    instantiate_hide_cpu: false
52 52

  
53 53
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
54
    instanciate_cpu_factor: false
54
    instantiate_cpu_factor: false
55

  
56
    # True to show the option to make persistent a instance
57
    instantiate_persistent: true
55 58

  
56 59
    # True to show an input to specify the the VMs and Template path/folder where a vCenter VM will
57 60
    # deployed to
src/sunstone/etc/sunstone-views/groupadmin_vcenter.yaml
51 51
    instantiate_hide_cpu: true
52 52

  
53 53
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
54
    instanciate_cpu_factor: false
54
    instantiate_cpu_factor: false
55

  
56
    # True to show the option to make persistent a instance
57
    instantiate_persistent: true
55 58

  
56 59
    # True to show an input to specify the the VMs and Template path/folder where a vCenter VM will
57 60
    # deployed to
src/sunstone/etc/sunstone-views/user.yaml
51 51
    instantiate_hide_cpu: false
52 52

  
53 53
    # False to not scale the CPU. Number [0, 1] to scale from VCPU
54
    instanciate_cpu_factor: false
54
    instantiate_cpu_factor: false
55

  
56
    # True to show the option to make persistent a instance
57
    instantiate_persistent: true
55 58

  
56 59
    # True to show an input to specify the the VMs and Template path/folder where a vCenter VM will
57 60
    # deployed to
src/sunstone/public/app/sunstone-config.js
156 156
    'enabledTabs': _config['view']['enabled_tabs'],
157 157
    'onedConf': _config['oned_conf'],
158 158
    'confirmVMActions': _config['view']['confirm_vms'],
159
    'scaleFactor': _config['view']['features']['instanciate_cpu_factor'],
159
    'scaleFactor': _config['view']['features']['instantiate_cpu_factor'],
160 160
    'filterView': _config['view']['filter_view'],
161 161

  
162 162
    "allTabs": function() {
src/sunstone/public/app/tabs/provision-tab.js
961 961
                disksContext.data("template_json", template_json);
962 962

  
963 963
                if (Config.provision.create_vm.isEnabled("disk_resize")) {
964
                  var pers = $("input.instantiate_pers", create_vm_context).prop("checked");
965
                  if(pers == undefined){
966
                    pers = false;
967
                  }
964 968
                  DisksResize.insert({
965 969
                    template_json: template_json,
966 970
                    disksContext: disksContext,
967
                    force_persistent: $("input.instantiate_pers", create_vm_context).prop("checked"),
971
                    force_persistent: pers,
968 972
                    cost_callback: _calculateCost
969 973
                  });
970 974
                } else {
src/sunstone/public/app/tabs/provision-tab/vms/create.hbs
29 29
    <div class="medium-6 columns">
30 30
      <input type="text" id="vm_name" class="provision-input" placeholder="{{tr "Virtual Machine Name"}}"/>
31 31
    </div>
32
    {{#isFeatureEnabled "instantiate_persistent"}}
32 33
    <div class="large-3 medium-6 columns">
33 34
      <div class="switch left">
34 35
        <input class="switch-input instantiate_pers" id="instantiate_pers" type="checkbox">
......
41 42
        {{{tip (tr "Creates a private persistent copy of the template plus any image defined in DISK, and instantiates that copy")}}}
42 43
      </label>
43 44
    </div>
45
    {{/isFeatureEnabled}}
44 46
    <div class="large-3 medium-6 columns">
45 47
      <button href="#" class="button success expanded" type="submit">{{tr "Create"}}</button>
46 48
      <div data-alert class="label alert-box-error" hidden></div>
src/sunstone/public/app/tabs/templates-tab/form-panels/create/wizard-tabs/general/capacity-inputs.js
135 135

  
136 136
    $("div.vcpu_input", context).html(input);
137 137

  
138
    if (Config.isFeatureEnabled("instanciate_cpu_factor")){
138
    if (Config.isFeatureEnabled("instantiate_cpu_factor")){
139 139
      $("div.vcpu_input input", context).on("change", function(){
140 140
        var vcpuValue = $("div.vcpu_input input", context).val();
141 141
        $("div.cpu_input input", context).val(vcpuValue * Config.scaleFactor);
src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate.js
88 88
  function _setup(context) {
89 89
    var that = this;
90 90

  
91
    $("input.instantiate_pers", context).on("change", function(){
92
      var persistent = $(this).prop('checked');
93

  
94
      if(persistent){
95
        $("#vm_n_times_disabled", context).show();
96
        $("#vm_n_times", context).hide();
97
      } else {
98
        $("#vm_n_times_disabled", context).hide();
99
        $("#vm_n_times", context).show();
100
      }
91
    if(Config.isFeatureEnabled("instantiate_persistent")){
92
      $("input.instantiate_pers", context).on("change", function(){
93
        var persistent = $(this).prop('checked');
94

  
95
        if(persistent){
96
          $("#vm_n_times_disabled", context).show();
97
          $("#vm_n_times", context).hide();
98
        } else {
99
          $("#vm_n_times_disabled", context).hide();
100
          $("#vm_n_times", context).show();
101
        }
101 102

  
102
      $.each(that.template_objects, function(index, template_json) {
103
        DisksResize.insert({
104
          template_json:    template_json,
105
          disksContext:     $(".disksContext"  + template_json.VMTEMPLATE.ID, context),
106
          force_persistent: persistent,
107
          cost_callback: that.calculateCost.bind(that)
103
        $.each(that.template_objects, function(index, template_json) {
104
          DisksResize.insert({
105
            template_json:    template_json,
106
            disksContext:     $(".disksContext"  + template_json.VMTEMPLATE.ID, context),
107
            force_persistent: persistent,
108
            cost_callback: that.calculateCost.bind(that)
109
          });
108 110
        });
109 111
      });
110
    });
112
    } else {
113
      $("#vm_n_times_disabled", context).hide();
114
      $("#vm_n_times", context).show();
115
    }
111 116
  }
112 117

  
113 118
  function _calculateCost(){
src/sunstone/public/app/tabs/templates-tab/form-panels/instantiate/html.hbs
21 21
  </div>
22 22
  <div class="row persistentContainer">
23 23
    <div class="large-12 large-centered columns">
24
      {{#isFeatureEnabled "instantiate_persistent"}}
24 25
      <div class="switch left">
25 26
        <input class="switch-input instantiate_pers" id="{{formPanelId}}instantiate_pers" type="checkbox">
26 27
        <label class="switch-paddle" for="{{formPanelId}}instantiate_pers">
......
31 32
        {{tr "Instantiate as persistent"}}
32 33
        {{{tip (tr "Creates a private persistent copy of the template plus any image defined in DISK, and instantiates that copy")}}}
33 34
      </label>
35
       {{/isFeatureEnabled}}
34 36
    </div>
35 37
  </div>
36 38
  <div class="row nameContainer">

Also available in: Unified diff