Pārlūkot izejas kodu

HUE-5516 [responsive] Embeddable indexes

Enrico Berti 9 gadi atpakaļ
vecāks
revīzija
6e2aa77f0d

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

@@ -307,7 +307,7 @@ ${ hueIcons.symbols() }
         <li class="header" style="padding-left: 4px; border-bottom: 1px solid #DDD; padding-bottom: 3px;">${ _('Browse') }</li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('metastore') }">Tables</a></li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('collections') }">Collections</a></li>
-        <li><a href="javascript: void(0);">Indexes</a></li>
+        <li><a data-bind="click: function () { onePageViewModel.currentApp('indexes') }">Indexes</a></li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('jobbrowser') }">Jobs</a></li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('filebrowser') }">Files</a></li>
         <li><a data-bind="click: function () { onePageViewModel.currentApp('filebrowser_s3') }">S3</a></li>
@@ -370,6 +370,7 @@ ${ hueIcons.symbols() }
       <div id="embeddable_home" class="embeddable"></div>
       <div id="embeddable_indexer" class="embeddable"></div>
       <div id="embeddable_collections" class="embeddable"></div>
+      <div id="embeddable_indexes" class="embeddable"></div>
     </div>
 
     <div id="rightResizer" class="resizer" data-bind="visible: rightAssistVisible(), splitFlexDraggable : {
@@ -507,6 +508,7 @@ ${ assist.assistPanel() }
           home: '/home_embeddable',
           indexer: '/indexer/indexer/?is_embeddable=true',
           collections: '/search/admin/collections?is_embeddable=true',
+          indexes: '/indexer/?is_embeddable=true',
         };
 
         self.SKIP_CACHE = ['fileviewer'];

+ 7 - 1
desktop/libs/indexer/src/indexer/templates/collections.mako

@@ -21,8 +21,11 @@
 
 <%namespace name="actionbar" file="actionbar.mako" />
 
+%if not is_embeddable:
 ${ commonheader(_('Search Indexes'), "indexer", user, request, "29px") | n,unicode }
+%endif
 
+<div id="indexesComponents">
 <link rel="stylesheet" href="${ static('desktop/ext/chosen/chosen.min.css') }">
 <link rel="stylesheet" href="${ static('indexer/css/admin.css') }">
 
@@ -476,6 +479,7 @@ ${ commonheader(_('Search Indexes'), "indexer", user, request, "29px") | n,unico
 <!--/ Wizard -->
 <!--/ Edit collection page -->
 
+</div>
 
 <script src="${ static('desktop/ext/chosen/chosen.jquery.min.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/ext/js/jquery/plugins/jquery-ui-1.10.4.custom.min.js') }" type="text/javascript" charset="utf-8"></script>
@@ -631,8 +635,10 @@ routie({
 });
 
 vm.manage.fetchCollections();
-ko.applyBindings(vm);
+ko.applyBindings(vm, $('#indexesComponents')[0]);
 
 </script>
 
+%if not is_embeddable:
 ${ commonfooter(request, messages) | n,unicode }
+%endif

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

@@ -32,7 +32,9 @@ LOG = logging.getLogger(__name__)
 
 
 def collections(request, is_redirect=False):
-  return render('collections.mako', request, {})
+  return render('collections.mako', request, {
+    'is_embeddable': request.GET.get('is_embeddable', False),
+  })
 
 
 def indexes(request):