소스 검색

HUE-6245 [cluster] Only show Job Browser if the cluster has a list of jobs

Romain Rigaux 8 년 전
부모
커밋
40826eb
2개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      desktop/core/src/desktop/models.py
  2. 1 1
      desktop/core/src/desktop/templates/hue.mako

+ 2 - 2
desktop/core/src/desktop/models.py

@@ -1618,7 +1618,7 @@ class ClusterConfig():
   def _get_editor(self):
     interpreters = []
 
-    if SHOW_NOTEBOOKS.get() and self.cluster_type != IMPALAUI:
+    if SHOW_NOTEBOOKS.get() and (self.cluster_type not in (DATAENG, IMPALAUI)):
       interpreters.append({
         'name': 'notebook',
         'type': 'notebook',
@@ -1657,7 +1657,7 @@ class ClusterConfig():
   def _get_dashboard(self):
     interpreters = [] # TODO Integrate SQL Dashboards and Solr 6 configs
 
-    if IS_DASHBOARD_ENABLED.get() and self.cluster_type != DATAENG and self.cluster_type != IMPALAUI:
+    if IS_DASHBOARD_ENABLED.get() and (self.cluster_type not in (DATAENG, IMPALAUI)):
       return {
         'name': 'dashboard',
         'displayName': _('Dashboard'),

+ 1 - 1
desktop/core/src/desktop/templates/hue.mako

@@ -1175,7 +1175,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
             self.quickCreateActions([]);
           }
 
-          self.hasJobBrowser(clusterConfig && clusterConfig['app_config'] && clusterConfig['app_config']['browser']);
+          self.hasJobBrowser(clusterConfig && clusterConfig['app_config'] && clusterConfig['app_config']['browser'] && (clusterConfig['app_config']['browser']['interpreter_names'].indexOf('yarn') != -1 || clusterConfig['app_config']['browser']['interpreter_names'].indexOf('dataeng') != -1));
         });
 
         var ClusterPanelViewModel = function() {