Browse Source

HUE-5183 [metastore] Improve import data modal

Enrico Berti 9 years ago
parent
commit
c836437

+ 1 - 1
apps/metastore/src/metastore/static/metastore/js/metastore.ko.js

@@ -577,9 +577,9 @@ var MetastoreViewModel = (function () {
 
 
   MetastoreTable.prototype.showImportData = function () {
   MetastoreTable.prototype.showImportData = function () {
     var self = this;
     var self = this;
+    $("#import-data-modal").empty().modal("show");
     $.get('/metastore/table/' + self.database.name + '/' + self.name + '/load', function (data) {
     $.get('/metastore/table/' + self.database.name + '/' + self.name + '/load', function (data) {
       $("#import-data-modal").html(data['data']);
       $("#import-data-modal").html(data['data']);
-      $("#import-data-modal").modal("show");
     }).fail(function (xhr, textStatus, errorThrown) {
     }).fail(function (xhr, textStatus, errorThrown) {
       $(document).trigger("error", xhr.responseText);
       $(document).trigger("error", xhr.responseText);
     });
     });

+ 1 - 1
apps/metastore/src/metastore/templates/metastore.mako

@@ -1157,7 +1157,7 @@ ${ components.menubar() }
     </form>
     </form>
   </div>
   </div>
 
 
-  <div id="import-data-modal" class="modal hide fade"></div>
+  <div id="import-data-modal" class="modal hide fade" style="display: block;width: 640px;margin-left: -320px!important;"></div>
 </div>
 </div>
 </span>
 </span>
 <script type="text/javascript" charset="utf-8">
 <script type="text/javascript" charset="utf-8">

+ 7 - 3
apps/metastore/src/metastore/templates/popups/load_data.mako

@@ -30,7 +30,7 @@ from django.utils.translation import ugettext as _
         <div class="control-group">
         <div class="control-group">
             ${comps.bootstrapLabel(load_form["path"])}
             ${comps.bootstrapLabel(load_form["path"])}
             <div class="controls">
             <div class="controls">
-                ${comps.field(load_form["path"], placeholder="/user/user_name/data_dir/file", klass="pathChooser input-xlarge", file_chooser=True, show_errors=True)}
+                ${comps.field(load_form["path"], placeholder="/user/user_name/data_dir/file", klass="pathChooser input-xxlarge", file_chooser=True, show_errors=True)}
             </div>
             </div>
         </div>
         </div>
 
 
@@ -40,7 +40,7 @@ from django.utils.translation import ugettext as _
             <div class="control-group">
             <div class="control-group">
                  ${comps.bootstrapLabel(load_form[pf])}
                  ${comps.bootstrapLabel(load_form[pf])}
                  <div class="controls">
                  <div class="controls">
-                   ${comps.field(load_form[pf], render_default=True, attrs={'klass': 'input-xlarge'})}
+                   ${comps.field(load_form[pf], render_default=True, attrs={'klass': 'input-xxlarge'})}
                 </div>
                 </div>
             </div>
             </div>
         % endfor
         % endfor
@@ -68,11 +68,15 @@ from django.utils.translation import ugettext as _
    #filechooser {
    #filechooser {
      display: none;
      display: none;
      min-height: 100px;
      min-height: 100px;
-     height: 250px;
+     height: 380px;
      overflow-y: auto;
      overflow-y: auto;
      margin-top: 10px;
      margin-top: 10px;
    }
    }
 
 
+   .modal-body {
+     max-height: 540px;
+   }
+
    .form-horizontal .controls {
    .form-horizontal .controls {
      margin-left: 0;
      margin-left: 0;
    }
    }