Bläddra i källkod

HUE-5510 [responsive] Embeddable indexer

Enrico Berti 9 år sedan
förälder
incheckning
c50cffe

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

@@ -39,7 +39,6 @@ ${ commonheader(_("Metastore"), app_name, user, request) | n,unicode }
 <script src="${ static('desktop/js/ko.editable.js') }"></script>
 <script src="${ static('desktop/ext/js/bootstrap-editable.min.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('beeswax/js/stats.utils.js') }"></script>
-<script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/js/jquery.huedatatable.js') }"></script>
 
 ${ assist.assistJSModels() }

+ 0 - 1
apps/security/src/security/templates/hive.mako

@@ -564,7 +564,6 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
 
 <script src="${ static('security/js/hive.ko.js') }" type="text/javascript" charset="utf-8"></script>
 
-<script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/js/jquery.filechooser.js') }" type="text/javascript" charset="utf-8"></script>
 
 

+ 0 - 1
apps/security/src/security/templates/sentry.mako

@@ -619,7 +619,6 @@ ${ tree.import_templates(itemClick='$root.assist.setPath', iconClick='$root.assi
 
 <script src="${ static('security/js/sentry.ko.js') }" type="text/javascript" charset="utf-8"></script>
 
-<script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/js/jquery.filechooser.js') }" type="text/javascript" charset="utf-8"></script>
 
 

+ 1 - 0
desktop/core/src/desktop/templates/common_header.mako

@@ -198,6 +198,7 @@ if USE_NEW_EDITOR.get():
   <script src="${ static('desktop/js/hue.utils.js') }"></script>
   <script src="${ static('desktop/ext/js/jquery/jquery-2.1.1.min.js') }"></script>
   <script src="${ static('desktop/js/jquery.migration.js') }"></script>
+  <script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
   <script src="${ static('desktop/js/jquery.hdfsautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
   <script src="${ static('desktop/js/jquery.filechooser.js') }"></script>
   <script src="${ static('desktop/js/jquery.selector.js') }"></script>

+ 3 - 0
desktop/core/src/desktop/templates/responsive.mako

@@ -367,6 +367,7 @@ ${ hueIcons.symbols() }
       <div id="embeddable_filebrowser_s3" class="embeddable"></div>
       <div id="embeddable_fileviewer" class="embeddable"></div>
       <div id="embeddable_home" class="embeddable"></div>
+      <div id="embeddable_indexer" class="embeddable"></div>
     </div>
 
     <div id="rightResizer" class="resizer" data-bind="visible: rightAssistVisible(), splitFlexDraggable : {
@@ -425,6 +426,7 @@ ${ hueIcons.symbols() }
 
 <script src="${ static('desktop/js/jquery.nicescroll.js') }"></script>
 
+<script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/js/jquery.hdfsautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/js/jquery.filechooser.js') }"></script>
 <script src="${ static('desktop/js/jquery.selector.js') }"></script>
@@ -501,6 +503,7 @@ ${ assist.assistPanel() }
           filebrowser_s3: '/filebrowser/view=S3A://?is_embeddable=true',
           fileviewer: 'filebrowser/view=',
           home: '/home_embeddable',
+          indexer: '/indexer/indexer/?is_embeddable=true',
         };
 
         self.SKIP_CACHE = ['fileviewer'];

+ 14 - 9
desktop/libs/indexer/src/indexer/templates/indexer.mako

@@ -23,10 +23,9 @@
 <%namespace name="actionbar" file="actionbar.mako" />
 <%namespace name="assist" file="/assist.mako" />
 
+%if not is_embeddable:
 ${ commonheader(_("Solr Indexes"), "search", user, request, "60px") | n,unicode }
-<span class="notebook">
 
-<script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/ext/js/jquery/plugins/jquery-ui-1.10.4.custom.min.js') }"></script>
 <script src="${ static('desktop/js/jquery.huedatatable.js') }"></script>
 <script src="${ static('desktop/ext/js/d3.v3.js') }" type="text/javascript" charset="utf-8"></script>
@@ -43,8 +42,11 @@ ${ assist.assistJSModels() }
 
 <link rel="stylesheet" href="${ static('notebook/css/notebook.css') }">
 <link rel="stylesheet" href="${ static('notebook/css/notebook-layout.css') }">
-<link rel="stylesheet" href="${ static('desktop/css/wizard.css') }">
 
+${ assist.assistPanel() }
+%endif
+
+<link rel="stylesheet" href="${ static('desktop/css/wizard.css') }">
 <style type="text/css">
 % if conf.CUSTOM.BANNER_TOP_HTML.get():
   .show-assist {
@@ -113,8 +115,7 @@ ${ assist.assistJSModels() }
 
 </style>
 
-${ assist.assistPanel() }
-
+<span id="indexerComponents" class="notebook">
 <div class="navbar navbar-inverse navbar-fixed-top">
   <div class="navbar-inner">
     <div class="container-fluid">
@@ -131,16 +132,17 @@ ${ assist.assistPanel() }
   </div>
 </div>
 
+%if not is_embeddable:
 <a title="${_('Toggle Assist')}" class="pointer show-assist" data-bind="visible: !$root.isLeftPanelVisible() && $root.assistAvailable(), click: function() { $root.isLeftPanelVisible(true); }">
   <i class="fa fa-chevron-right"></i>
 </a>
-
+%endif
 
 <div class="main-content">
   <div class="vertical-full container-fluid" data-bind="style: { 'padding-left' : $root.isLeftPanelVisible() ? '0' : '20px' }">
     <div class="vertical-full">
       <div class="vertical-full row-fluid panel-container">
-
+        %if not is_embeddable:
         <div class="assist-container left-panel" data-bind="visible: $root.isLeftPanelVisible() && $root.assistAvailable()">
           <a title="${_('Toggle Assist')}" class="pointer hide-assist" data-bind="click: function() { $root.isLeftPanelVisible(false) }">
             <i class="fa fa-chevron-left"></i>
@@ -165,7 +167,7 @@ ${ assist.assistPanel() }
             }"></div>
         </div>
         <div class="resizer" data-bind="visible: $root.isLeftPanelVisible() && $root.assistAvailable(), splitDraggable : { appName: 'notebook', leftPanelVisible: $root.isLeftPanelVisible }"><div class="resize-bar">&nbsp;</div></div>
-
+        %endif
         <div class="content-panel">
           <div style="margin: 10px; margin-bottom: 100px">
           <!-- ko template: 'create-index-wizard' --><!-- /ko -->
@@ -1004,7 +1006,7 @@ ${ assist.assistPanel() }
         }
       }
       viewModel = new IndexerViewModel(options);
-      ko.applyBindings(viewModel);
+      ko.applyBindings(viewModel, $('#indexerComponents')[0]);
 
       var draggableMeta = {};
       huePubSub.subscribe('draggable.text.meta', function (meta) {
@@ -1058,4 +1060,7 @@ ${ assist.assistPanel() }
   })();
 </script>
 </span>
+
+%if not is_embeddable:
 ${ commonfooter(request, messages) | n,unicode }
+%endif

+ 1 - 0
desktop/libs/indexer/src/indexer/views.py

@@ -54,6 +54,7 @@ def indexer(request):
     index['isSelected'] = False
 
   return render('indexer.mako', request, {
+      'is_embeddable': request.GET.get('is_embeddable', False),
       'indexes_json': json.dumps(indexes),
       'fields_json' : json.dumps([field.name for field in FIELD_TYPES]),
       'operators_json' : json.dumps([operator.to_dict() for operator in OPERATORS]),

+ 0 - 2
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -170,8 +170,6 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
 <script src="${ static('desktop/js/ace/ext-language_tools.js') }"></script>
 <script src="${ static('desktop/js/ace.extended.js') }"></script>
 
-<script src="${ static('desktop/js/jquery.hiveautocomplete.js') }" type="text/javascript" charset="utf-8"></script>
-
 <script type="text/x-mathjax-config">
   MathJax.Hub.Config({
     showProcessingMessages: false,