浏览代码

[beeswax] Disable HDFS in the assist

This page structure is so different compared to the other ones and I don't think it's worth the effort to make HDFS work here as well.
Johan Ahlen 10 年之前
父节点
当前提交
8655a46
共有 2 个文件被更改,包括 8 次插入5 次删除
  1. 4 3
      apps/beeswax/src/beeswax/templates/execute.mako
  2. 4 2
      desktop/core/src/desktop/templates/assist.mako

+ 4 - 3
apps/beeswax/src/beeswax/templates/execute.mako

@@ -44,11 +44,12 @@ ${ layout.menubar(section='query') }
     <div class="tab-content">
       <div class="tab-pane active" id="navigatorTab">
         <div class="card card-small card-tab">
-          <div class="card-body" style="margin-top: 0;">
+          <div class="card-body" style="margin-top: 0; height: 100%; ">
             <div class="assist" data-bind="component: {
               name: 'assist-panel',
               params: {
                 user: HIVE_AUTOCOMPLETE_USER,
+                onlySql: true,
                 sourceTypes: editorViewModel.sqlSourceTypes,
                 activeSourceType: snippetType,
                 navigationSettings: {
@@ -1314,8 +1315,8 @@ $(document).ready(function () {
 
   resizeNavigator = function () {
     $(".resizer").css("height", ($(window).height() - 150) + "px");
-    $("#navigator .card").css("min-height", ($(window).height() - 150) + "px");
-    $(".table-container").css("max-height", ($(window).height() - 280) + "px").css("overflow-y", "auto");
+    $("#navigator .card").css("height", ($(window).height() - 150) + "px");
+    $(".table-container").css("max-height", ($(window).height() - 180) + "px").css("overflow-y", "auto");
   };
 
   $("#expandResults").on("click", function(){

+ 4 - 2
desktop/core/src/desktop/templates/assist.mako

@@ -300,7 +300,7 @@ from desktop.views import _ko
       <!-- ko template: { if: showingDb() && ! showingHdfs(), name: 'assist-db-panel' } --><!-- /ko -->
       <!-- ko template: { if: ! showingDb() && showingHdfs(), name: 'assist-hdfs-panel' } --><!-- /ko -->
     </div>
-    <div style="position: absolute; bottom: 2px; left: 2px;width: 100%; border-top: 1px solid #F1F1F1;padding-top:3px">
+    <div data-bind="visible: ! onlySql" style="display: none; position: absolute; bottom: 2px; left: 2px;width: 100%; border-top: 1px solid #F1F1F1; padding-top:3px; background-color: #FFF;">
       <div class="inactive-action assist-type-switch" data-bind="click: function () { showingDb(!showingDb()) }, css: { 'blue': showingDb }, attr: { 'title': showingDb() ? '${ _('Hide Databases') }' : '${ _('Show Databases') }' }">
         <i class="fa fa-database"></i>
       </div>
@@ -435,6 +435,7 @@ from desktop.views import _ko
       /**
        * @param {Object} params
        * @param {Object[]} params.sourceTypes - All the available SQL source types
+       * @param {boolean} params.onlySql - For the old query editors
        * @param {string} params.sourceTypes[].name - Example: Hive SQL
        * @param {string} params.sourceTypes[].type - Example: hive
        * @param {string} [params.activeSourceType] - Example: hive
@@ -452,8 +453,9 @@ from desktop.views import _ko
           errorLoadingTablePreview: "${ _('There was a problem loading the table preview.') }"
         };
 
+        self.onlySql = params.onlySql;
         self.showingDb = ko.observable(true);
-        self.showingHdfs = ko.observable(true);
+        self.showingHdfs = ko.observable(! self.onlySql);
 
         var assistHelper = new AssistHelper(i18n, params.user);
         self.sources = ko.observableArray();