Ver código fonte

HUE-3294 [jobbrowser] First pass of integration of the workflow editor with the new layout

Enrico Berti 9 anos atrás
pai
commit
fae127eb37

+ 14 - 5
apps/jobbrowser/src/jobbrowser/templates/apps.mako

@@ -19,12 +19,14 @@
   from django.utils.translation import ugettext as _
 %>
 
+% if not is_embeddable:
 ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
-
 <%namespace name="assist" file="/assist.mako" />
+% endif
 
 <link rel="stylesheet" href="${ static('desktop/ext/css/basictable.css') }">
 <link rel="stylesheet" href="${ static('notebook/css/notebook.css') }">
+% if not is_embeddable:
 <link rel="stylesheet" href="${ static('notebook/css/notebook-layout.css') }">
 <style type="text/css">
 % if conf.CUSTOM.BANNER_TOP_HTML.get():
@@ -36,6 +38,7 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
   }
 % endif
 </style>
+% endif
 
 <script src="${ static('oozie/js/dashboard-utils.js') }" type="text/javascript" charset="utf-8"></script>
 <script src="${ static('desktop/ext/js/jquery/plugins/jquery.basictable.min.js') }"></script>
@@ -45,6 +48,8 @@ ${ commonheader("Job Browser", "jobbrowser", user, request) | n,unicode }
 <script src="${ static('desktop/ext/js/knockout-sortable.min.js') }"></script>
 <script src="${ static('desktop/js/ko.editable.js') }"></script>
 
+% if not is_embeddable:
+
 ${ assist.assistJSModels() }
 
 <script src="${ static('oozie/js/list-oozie-coordinator.ko.js') }"></script>
@@ -56,6 +61,7 @@ ${ assist.assistPanel() }
   <i class="fa fa-chevron-right"></i>
 </a>
 
+% endif
 
 <div class="navbar navbar-inverse navbar-fixed-top nokids">
     <div class="navbar-inner">
@@ -76,12 +82,12 @@ ${ assist.assistPanel() }
       </div>
     </div>
 </div>
-
+<div id="jobbrowser">
 <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>
@@ -105,7 +111,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 class="container-fluid">
@@ -188,6 +194,7 @@ ${ assist.assistPanel() }
     </div>
   </div>
 </div>
+</div>
 
 
 <script type="text/html" id="job-page">
@@ -432,7 +439,7 @@ ${ assist.assistPanel() }
       };
 
       viewModel = new JobBrowserViewModel(options, RunningCoordinatorModel);
-      ko.applyBindings(viewModel);
+      ko.applyBindings(viewModel, $('#jobbrowser')[0]);
 
       var loadHash = function () {
         var h = window.location.hash;
@@ -459,4 +466,6 @@ ${ assist.assistPanel() }
   })();
 </script>
 
+% if not is_embeddable:
 ${ commonfooter(request, messages) | n,unicode }
+% endif

+ 1 - 0
apps/jobbrowser/src/jobbrowser/views.py

@@ -104,6 +104,7 @@ def get_job(request, job_id):
 
 def apps(request):
   return render('apps.mako', request, {
+    'is_embeddable': request.GET.get('is_embeddable', False),
     'hiveserver2_impersonation_enabled': hiveserver2_impersonation_enabled()
   })
 

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

@@ -210,7 +210,7 @@ ${ hueIcons.symbols() }
         <li class="header">Browse</li>
         <li><a href="javascript: { ko.dataFor($('.page-content')[0]).currentApp('metastore') }">Metastore</a></li>
         <li><a href="javascript: void(0);">Indexes</a></li>
-        <li><a href="javascript: void(0);">Job Browser</a></li>
+        <li><a href="javascript: { ko.dataFor($('.page-content')[0]).currentApp('jobbrowser') }">Job Browser</a></li>
         <li><a href="javascript: void(0);">File Browser</a></li>
         <li><a href="javascript: void(0);">HBase</a></li>
         <li><a href="javascript: void(0);">Security</a></li>
@@ -259,6 +259,7 @@ ${ hueIcons.symbols() }
       <div id="embeddable_metastore" class="embeddable"></div>
       <div id="embeddable_search" class="embeddable"></div>
       <div id="embeddable_oozie_wf" class="embeddable"></div>
+      <div id="embeddable_jobbrowser" class="embeddable"></div>
     </div>
 
     <div id="rightResizer" class="resizer" data-bind="visible: rightAssistVisible(), splitFlexDraggable : {
@@ -367,7 +368,8 @@ ${ assist.assistPanel() }
           editor: '/notebook/editor_embeddable',
           metastore: '/metastore/tables/?is_embeddable=true',
           search: '/search/embeddable/new_search',
-          oozie_wf: '/oozie/editor/workflow/new/?is_embeddable=true'
+          oozie_wf: '/oozie/editor/workflow/new/?is_embeddable=true',
+          jobbrowser: '/jobbrowser/apps?is_embeddable=true'
         };
 
         self.embeddable_cache = {};