Revision dda2dffa

View differences:

src/sunstone/public/app/tabs/datastores-tab/form-panels/import.js
108 108
    var that = this;
109 109

  
110 110
    Sunstone.hideFormPanelLoading(TAB_ID);
111
    Sunstone.disableFormPanelSubmit(TAB_ID);
112 111

  
113 112
    this.vCenterDatastores.import(context);
114 113

  
src/sunstone/public/app/utils/vcenter/datastores.js
81 81
        $.each(response, function(datacenter_name, datastores){
82 82
          var content;
83 83
          if (datastores.length == 0) {
84
            content = 
84
            content =
85 85
              '<fieldset>' +
86 86
                '<legend>' +
87 87
                  '<ul class="menu simple">' +
......
100 100
            $(".vcenter_datacenter_list", context).append(content);
101 101
          } else {
102 102
            var tableId = "vcenter_datastore_table" + UniqueId.id();
103
            content = 
103
            content =
104 104
              '<fieldset>' +
105 105
                '<legend>' +
106 106
                  '<ul class="menu simple">' +
......
108 108
                      datacenter_name + ' ' + Locale.tr("DataCenter") +
109 109
                    '</li>' +
110 110
                    '<li> ' +
111
                      '<button class="button small success import_selected">' +
112
                         Locale.tr("Import Selected Datastores") +
113
                      '</button>' +
114
                    '</li>' +
115
                    '<li> ' +
116 111
                      '<button class="button small secondary clear_imported">' +
117 112
                         Locale.tr("Clear Imported Datastores") +
118 113
                      '</button>' +
......
195 190
              _recountCheckboxes($('table', newdiv));
196 191
            });
197 192

  
198
            context.off('click', '.import_selected');
199
            context.on('click', '.import_selected', function() {
200
              tableContext = $(this).closest('fieldset');
201
              _import(tableContext);
202
              return false;
203
            });
204

  
205 193
            context.off('click', '.clear_imported');
206 194
            context.on('click', '.clear_imported', function() {
207 195
              _fillVCenterDatastores(opts);
src/sunstone/public/app/utils/vcenter/images.js
43 43
  }
44 44

  
45 45
  /*
46
    Retrieve the list of images from a vCenter DS and fill 
46
    Retrieve the list of images from a vCenter DS and fill
47 47
    the container with them
48 48

  
49 49
    opts = {
......
77 77
        $(".vcenter_datacenter_list", context).html("");
78 78

  
79 79
        if (response.length == 0) {
80
          content = 
80
          content =
81 81
            '<fieldset>' +
82 82
              '<legend>' +
83 83
                '<ul class="menu simple">' +
......
96 96
          $(".vcenter_datacenter_list", context).append(content);
97 97
        } else {
98 98
          var tableId = "vcenter_image_table_" + UniqueId.id();
99
          content = 
99
          content =
100 100
            '<fieldset>' +
101 101
              '<legend>' +
102 102
                '<ul class="menu simple">' +
......
104 104
                    opts.vcenter_datastore + ' ' + Locale.tr("Datastore") +
105 105
                  '</li>' +
106 106
                  '<li> ' +
107
                    '<button class="button small success import_selected">' +
108
                       Locale.tr("Import Selected Images") +
109
                    '</button>' +
110
                  '</li>' +
111
                  '<li> ' +
112 107
                    '<button class="button small secondary clear_imported">' +
113 108
                       Locale.tr("Clear Imported Images") +
114 109
                    '</button>' +
......
148 143

  
149 144
              $(".check_item", trow).data("datastore_id", image.dsid)
150 145
              $(".check_item", trow).data("one_template", image.one)
151
            
146

  
152 147
            });
153 148

  
154 149
          var imageDataTable = new DomDataTable(
......
185 180
              _recountCheckboxes($('table', newdiv));
186 181
            });
187 182

  
188
          context.off('click', '.import_selected');
189
          context.on('click', '.import_selected', function() {
190
              tableContext = $(this).closest('fieldset');
191
              _import(tableContext);
192
              return false;
193
            });
194

  
195 183
          context.off('click', '.clear_imported');
196 184
          context.on('click', '.clear_imported', function() {
197 185
              _fillVCenterImages(opts);
......
256 244
            {
257 245
                error_message_str =  error_message_str + ". Please disable DATASTORE_CAPACITY_CHECK in /etc/one/oned.conf and restart OpenNebula "
258 246
            }
259
            
247

  
260 248
            $(".vcenter_image_result", image_context).html('<p style="font-size:12px" class="error-color">' +
261 249
                  (error_message_str || Locale.tr("Cannot contact server: is it running and reachable?")) +
262 250
                '</p>');
src/sunstone/public/app/utils/vcenter/networks.js
80 80
        $.each(response, function(datacenter_name, networks) {
81 81
          var content;
82 82
          if (networks.length == 0) {
83
            content = 
83
            content =
84 84
              '<fieldset>' +
85 85
                '<legend>' +
86 86
                  '<ul class="menu simple">' +
......
99 99
            $(".vcenter_datacenter_list", context).append(content);
100 100
          } else {
101 101
            var tableId = "vcenter_network_table_" + UniqueId.id();
102
            content = 
102
            content =
103 103
              '<fieldset>' +
104 104
                '<legend>' +
105 105
                  '<ul class="menu simple">' +
......
119 119
                      '</label>' +
120 120
                    '</li>' +
121 121
                    '<li> ' +
122
                      '<button class="button small success import_selected">' +
123
                         Locale.tr("Import Selected Networks") +
124
                      '</button>' +
125
                    '</li>' +
126
                    '<li> ' +
127 122
                      '<button class="button small secondary clear_imported">' +
128 123
                         Locale.tr("Clear Imported Networks") +
129 124
                      '</button>' +
......
166 161

  
167 162
            networksTable.addData(networks);
168 163

  
169
            context.off('click', '.import_selected');
170
            context.on('click', '.import_selected', function() {
171
              tableContext = $(this).closest('fieldset');
172
              _import(tableContext);
173
              return false;
174
            });
175

  
176 164
            context.off('click', '.clear_imported');
177 165
            context.on('click', '.clear_imported', function() {
178 166
              _fillVCenterNetworks(opts);
src/sunstone/public/app/utils/vcenter/templates.js
81 81
        $.each(response, function(datacenter_name, templates){
82 82
          var content;
83 83
          if (templates.length == 0) {
84
            content = 
84
            content =
85 85
              '<fieldset>' +
86 86
                '<legend>' +
87 87
                  '<ul class="menu simple">' +
......
100 100
            $(".vcenter_datacenter_list", context).append(content);
101 101
          } else {
102 102
            var tableId = "vcenter_template_table_" + UniqueId.id();
103
            content = 
103
            content =
104 104
              '<fieldset>' +
105 105
                '<legend>' +
106 106
                  '<ul class="menu simple">' +
......
120 120
                      '</label>' +
121 121
                    '</li>' +
122 122
                    '<li> ' +
123
                      '<button class="button small success import_selected">' +
124
                         Locale.tr("Import Selected Templates") +
125
                      '</button>' +
126
                    '</li>' +
127
                    '<li> ' +
128 123
                      '<button class="button small secondary clear_imported">' +
129 124
                         Locale.tr("Clear Imported Templates") +
130 125
                      '</button>' +
......
176 171

  
177 172
            templatesTable.addData(templates);
178 173

  
179
            context.off('click', '.import_selected');
180
            context.on('click', '.import_selected', function() {
181
              tableContext = $(this).closest('fieldset');
182
              _import(tableContext);
183
              return false;
184
            });
185

  
186 174
            context.off('click', '.clear_imported');
187 175
            context.on('click', '.clear_imported', function() {
188 176
              _fillVCenterTemplates(opts);
......
260 248
            userInputs.push('RESOURCE_POOL="' + rpUserInputs + '"');
261 249
          }
262 250
        }
263
        
251

  
264 252
        // Append new attrs and user inputs if necessary
265 253
        var template = $(this).data("one_template");
266 254

  

Also available in: Unified diff