浏览代码

HUE-8962 [core] Remove the frontend embedded mode

This removes the use of the IS_EMBEDDED and DEV_EMBEDDED flags in the UI.
Johan Ahlen 6 年之前
父节点
当前提交
76e452b67e
共有 53 个文件被更改,包括 199 次插入1052 次删除
  1. 1 1
      .eslintrc.js
  2. 1 3
      Gruntfile.js
  3. 6 6
      apps/filebrowser/src/filebrowser/templates/listdir_components.mako
  4. 6 6
      apps/jobsub/src/jobsub/templates/designs.mako
  5. 3 11
      apps/metastore/src/metastore/templates/metastore.mako
  6. 1 1
      apps/rdbms/src/rdbms/templates/execute.mako
  7. 5 8
      desktop/conf.dist/hue.ini
  8. 12 15
      desktop/conf/pseudo-distributed.ini.tmpl
  9. 0 6
      desktop/core/src/desktop/conf.py
  10. 1 5
      desktop/core/src/desktop/js/apps/notebook/notebook.js
  11. 1 7
      desktop/core/src/desktop/js/apps/notebook2/notebook.js
  12. 1 3
      desktop/core/src/desktop/js/hue.js
  13. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.hdfs.autocomplete.js
  14. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.hiveautocomplete.js
  15. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.huedatatable.js
  16. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.notify.js
  17. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.scrollleft.js
  18. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.scrollup.js
  19. 1 1
      desktop/core/src/desktop/js/jquery/plugins/jquery.tableextender.js
  20. 0 3
      desktop/core/src/desktop/js/jquery/plugins/jquery.tableextender2.js
  21. 1 1
      desktop/core/src/desktop/js/ko/bindings/ko.clickToCopy.js
  22. 1 1
      desktop/core/src/desktop/js/ko/bindings/ko.templateContextMenu.js
  23. 1 10
      desktop/core/src/desktop/js/ko/bindings/ko.templatePopover.js
  24. 1 1
      desktop/core/src/desktop/js/ko/bindings/ko.tooltip.js
  25. 2 2
      desktop/core/src/desktop/js/ko/components/assist/ko.assistDbPanel.js
  26. 26 28
      desktop/core/src/desktop/js/ko/components/assist/ko.assistPanel.js
  27. 1 3
      desktop/core/src/desktop/js/ko/components/assist/ko.rightAssistPanel.js
  28. 2 2
      desktop/core/src/desktop/js/ko/components/contextPopover/ko.contextPopover.js
  29. 1 1
      desktop/core/src/desktop/js/ko/components/ko.createDirectoryModal.js
  30. 1 1
      desktop/core/src/desktop/js/ko/components/ko.deleteDocModal.js
  31. 1 1
      desktop/core/src/desktop/js/ko/components/ko.historyPanel.js
  32. 3 3
      desktop/core/src/desktop/js/ko/components/ko.jobBrowserLinks.js
  33. 7 48
      desktop/core/src/desktop/js/onePageViewModel.js
  34. 1 1
      desktop/core/src/desktop/js/sql/sqlWorkerHandler.js
  35. 24 60
      desktop/core/src/desktop/js/utils/hueUtils.js
  36. 0 16
      desktop/core/src/desktop/static/desktop/css/hue-bootstrap-embedded.css
  37. 0 429
      desktop/core/src/desktop/static/desktop/css/hue-embedded.css
  38. 2 2
      desktop/core/src/desktop/static/desktop/js/ace.extended.js
  39. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.blueprint.js
  40. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.hiveautocomplete.js
  41. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.huedatatable.js
  42. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.notify.js
  43. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.scrollleft.js
  44. 1 1
      desktop/core/src/desktop/static/desktop/js/jquery.scrollup.js
  45. 0 33
      desktop/core/src/desktop/static/desktop/less/hue-bootstrap-embedded.less
  46. 0 110
      desktop/core/src/desktop/static/desktop/less/hue-embedded.less
  47. 2 3
      desktop/core/src/desktop/templates/common_header_footer_components.mako
  48. 2 2
      desktop/core/src/desktop/templates/document_browser.mako
  49. 1 4
      desktop/core/src/desktop/templates/global_js_constants.mako
  50. 6 86
      desktop/core/src/desktop/templates/hue.mako
  51. 1 1
      desktop/core/src/desktop/templates/sql_syntax_dropdown.mako
  52. 2 2
      desktop/libs/dashboard/src/dashboard/templates/common_search.mako
  53. 59 113
      desktop/libs/notebook/src/notebook/templates/editor_components.mako

+ 1 - 1
.eslintrc.js

@@ -5,7 +5,7 @@ const hueGlobals = [
   // global_js_constants.mako
   'AUTOCOMPLETE_TIMEOUT', 'CACHEABLE_TTL', 'CSRF_TOKEN', 'DOCUMENT_TYPES', 'DROPZONE_HOME_DIR',
   'ENABLE_SQL_SYNTAX_CHECK', 'HAS_MULTI_CLUSTER', 'HAS_CATALOG', 'HAS_OPTIMIZER', 'HAS_WORKLOAD_ANALYTICS',
-  'HUE_CONTAINER', 'HUE_I18n', 'HUE_VERSION', 'IS_EMBEDDED', 'IS_K8S_ONLY', 'IS_NEW_INDEXER_ENABLED', 'IS_S3_ENABLED',
+  'HUE_I18n', 'HUE_VERSION', 'IS_K8S_ONLY', 'IS_NEW_INDEXER_ENABLED', 'IS_S3_ENABLED',
   'isIE11', 'KO_DATERANGEPICKER_LABELS', 'LOGGED_USERGROUPS', 'LOGGED_USERNAME', 'METASTORE_PARTITION_LIMIT',
   'USER_HOME_DIR', 'WorkerGlobalScope',
 

+ 1 - 3
Gruntfile.js

@@ -35,8 +35,6 @@ module.exports = function(grunt) {
           javascriptEnabled: true
         },
         files: {
-          'desktop/core/src/desktop/static/desktop/css/hue-bootstrap-embedded.css': 'desktop/core/src/desktop/static/desktop/less/hue-bootstrap-embedded.less',
-          'desktop/core/src/desktop/static/desktop/css/hue-embedded.css': 'desktop/core/src/desktop/static/desktop/less/hue-embedded.less',
           'desktop/core/src/desktop/static/desktop/css/home.css': 'desktop/core/src/desktop/static/desktop/less/home.less',
           'desktop/core/src/desktop/static/desktop/css/hue.css': 'desktop/core/src/desktop/static/desktop/less/hue.less',
           'desktop/core/src/desktop/static/desktop/css/hue3-extra.css': 'desktop/core/src/desktop/static/desktop/less/hue3-extra.less',
@@ -102,4 +100,4 @@ module.exports = function(grunt) {
       }
     },
   });
-};
+};

+ 6 - 6
apps/filebrowser/src/filebrowser/templates/listdir_components.mako

@@ -868,7 +868,7 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
         showContextMenu: function (row, e) {
           var cm = $('.context-menu'),
             actions = $('#ch-dropdown'),
-            rect = document.querySelector(HUE_CONTAINER).getBoundingClientRect();
+            rect = document.querySelector('body').getBoundingClientRect();
 
           e.stopPropagation();
 
@@ -1059,7 +1059,7 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
       self.isAdls = ko.pureComputed(function () {
         return self.currentPath().toLowerCase().indexOf('adl:/') === 0;
       });
-      
+
       self.isABFS = ko.pureComputed(function () {
         return self.currentPath().toLowerCase().indexOf('abfs://') === 0;
       });
@@ -1129,7 +1129,7 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
       self.isS3Root = ko.pureComputed(function () {
         return self.isS3() && self.currentPath().toLowerCase() === 's3a://';
       });
-      
+
       self.isABFSRoot = ko.pureComputed(function () {
         return self.isABFS() && self.currentPath().toLowerCase() === 'abfs://';
       });
@@ -2019,17 +2019,17 @@ from filebrowser.conf import ENABLE_EXTRACT_UPLOADED_ARCHIVE
 
     $(document).ready(function () {
       // hide context menu
-      $(HUE_CONTAINER).on('click', function (e) {
+      $('body').on('click', function (e) {
         hideContextMenu();
       });
 
-      $(HUE_CONTAINER).on('contextmenu', function (e) {
+      $('body').on('contextmenu', function (e) {
         if ($.inArray(e.toElement, $('.table-huedatatable *')) === -1) {
           hideContextMenu();
         }
       });
 
-      $(HUE_CONTAINER).on('contextmenu', '.context-menu', function (e) {
+      $('body').on('contextmenu', '.context-menu', function (e) {
         hideContextMenu();
       });
 

+ 6 - 6
apps/jobsub/src/jobsub/templates/designs.mako

@@ -922,22 +922,22 @@ $(document).ready(function(e) {
       }
     );
   });
-  $(HUE_CONTAINER).on('click', '#edit-design', function() {
+  $('body').on('click', '#edit-design', function() {
     routie('edit-design/' + designs.selectedDesign().id());
   });
-  $(HUE_CONTAINER).on('click', '#trash-designs', function() {
+  $('body').on('click', '#trash-designs', function() {
     $('#trashWf').modal('show');
   });
-  $(HUE_CONTAINER).on('click', '#destroy-designs', function() {
+  $('body').on('click', '#destroy-designs', function() {
     $('#destroyWf').modal('show');
   });
-  $(HUE_CONTAINER).on('click', '#purge-trashed-designs', function() {
+  $('body').on('click', '#purge-trashed-designs', function() {
     $('#purgeWf').modal('show');
   });
-  $(HUE_CONTAINER).on('click', '#restore-designs', function() {
+  $('body').on('click', '#restore-designs', function() {
     $('#restoreWf').modal('show');
   });
-  $(HUE_CONTAINER).on('click', '#copy-designs', function() {
+  $('body').on('click', '#copy-designs', function() {
     designs.isLoading(true);
     designs.cloneDesigns();
   });

+ 3 - 11
apps/metastore/src/metastore/templates/metastore.mako

@@ -18,7 +18,7 @@ from django.utils.html import escape
 from django.utils.translation import ugettext as _
 
 from desktop import conf
-from desktop.conf import USE_NEW_EDITOR, IS_EMBEDDED
+from desktop.conf import USE_NEW_EDITOR
 from desktop.lib.i18n import smart_unicode
 from desktop.views import commonheader, commonfooter, _ko
 from beeswax.conf import LIST_PARTITIONS_LIMIT
@@ -258,11 +258,7 @@ ${ components.menubar(is_embeddable) }
         <!-- /ko -->
         <!-- ko if: details.properties.format !== 'kudu' -->
         <div>
-          % if IS_EMBEDDED.get():
-            <span data-bind="attr: {'title': path_location}">${_('location')}</span>
-          % else:
-            <a href="javascript: void(0);" data-bind="storageContextPopover: { path: hdfs_link.replace('/filebrowser/view=', ''), offset: { left: 5 } }"> ${_('location')}</a>
-          % endif
+          <a href="javascript: void(0);" data-bind="storageContextPopover: { path: hdfs_link.replace('/filebrowser/view=', ''), offset: { left: 5 } }"> ${_('location')}</a>
         </div>
       <!-- /ko -->
     </div>
@@ -479,11 +475,7 @@ ${ components.menubar(is_embeddable) }
           <div class="metastore-property">
             <div>${ _('Location') }</div>
             <div>
-              % if IS_EMBEDDED.get():
-                <span data-bind="attr: { 'title': location }"> ${_('Location')}</span>
-              % else:
-                <a href="javascript: void(0);" data-bind="storageContextPopover: { path: hdfs_link.replace('/filebrowser/view=', ''), offset: { left: 5 } }"> ${_('Location')}</a>
-              % endif
+              <a href="javascript: void(0);" data-bind="storageContextPopover: { path: hdfs_link.replace('/filebrowser/view=', ''), offset: { left: 5 } }"> ${_('Location')}</a>
             </div>
           </div>
         </div>

+ 1 - 1
apps/rdbms/src/rdbms/templates/execute.mako

@@ -428,7 +428,7 @@ ${ commonshare() | n,unicode }
 
       var pos = cm.cursorCoords();
       $(".CodeMirror-spinner").remove();
-      $("<i class='fa fa-spinner fa-spin CodeMirror-spinner'></i>").css("top", pos.top + "px").css("left", (pos.left - 4) + "px").appendTo(HUE_CONTAINER);
+      $("<i class='fa fa-spinner fa-spin CodeMirror-spinner'></i>").css("top", pos.top + "px").css("left", (pos.left - 4) + "px").appendTo('body');
 
       if ($.totalStorage('rdbms_tables_' + viewModel.server().name() + "_" + viewModel.database()) == null) {
         CodeMirror.showHint(cm, AUTOCOMPLETE_SET);

+ 5 - 8
desktop/conf.dist/hue.ini

@@ -44,9 +44,6 @@
   # Enable development mode, where notably static files are not cached.
   ## dev=false
 
-  # Enable embedded development mode, where the page will be rendered inside a container div element.
-  ## dev_embedded=false
-
   # Enable or disable database debug mode.
   ## database_logging=false
 
@@ -894,7 +891,7 @@
     # [[[hive]]]
     #   name=Hive
     #   interface=hiveserver2
-    
+
     # [[[llap]]]
     #   name=LLAP
     #   interface=hiveserver2
@@ -1154,15 +1151,15 @@
 
   # Host where LLAP is running
   ## llap_server_host = localhost
-  
+
   # Main Port where LLAP runs
   ## llap_server_port = 10500
-  
+
   # Port where LLAP Thrift server runs on
   ## llap_server_thrift_port = 10501
-  
+
   # Alternatively, use Service Discovery for LLAP (Hive Server Interactive) and/or Hiveserver2, this will override server and thrift port
-  
+
   # Whether to use Service Discovery for LLAP
   ## hive_discovery_llap = true
 

+ 12 - 15
desktop/conf/pseudo-distributed.ini.tmpl

@@ -48,9 +48,6 @@
   # Enable development mode, where notably static files are not cached.
   dev=true
 
-  # Enable embedded development mode, where the page will be rendered inside a container div element.
-  ## dev_embedded=false
-
   # Enable or disable database debug mode.
   ## database_logging=false
 
@@ -1136,44 +1133,44 @@
 
   # Port where HiveServer2 Thrift server runs on.
   ## hive_server_port=10000
-  
+
   # Host where LLAP is running
   ## llap_server_host = localhost
-  
+
   # Main Port where LLAP runs
   ## llap_server_port = 10500
-  
+
   # Port where LLAP Thrift server runs on
   ## llap_server_thrift_port = 10501
-  
+
   # Alternatively, use Service Discovery for LLAP (Hive Server Interactive) and/or Hiveserver2, this will override server and thrift port
-  
-  # Whether to use Service Discovery for LLAP 
+
+  # Whether to use Service Discovery for LLAP
   ## hive_discovery_llap = true
-  
+
   # is llap (hive server interactive) running in an HA configuration (more than 1)
   # important as the zookeeper structure is different
   ## hive_discovery_llap_ha = false
-  
+
   # Shortcuts to finding LLAP znode Key
   # Non-HA - hiveserver-interactive-site - hive.server2.zookeeper.namespace ex hive2 = /hive2
   # HA-NonKerberized - <llap_app_name>_llap ex app name llap0 = /llap0_llap
   # HA-Kerberized - <llap_app_name>_llap-sasl ex app name llap0 = /llap0_llap-sasl
   ## hive_discovery_llap_znode = /hiveserver2-hive2
-  
+
   # Whether to use Service Discovery for HiveServer2
   ## hive_discovery_hs2 = true
-  
+
   # Hiveserver2 is hive-site hive.server2.zookeeper.namespace ex hiveserver2 = /hiverserver2
   ## hive_discovery_hiveserver2_znode = /hiveserver2
-  
+
   # Applicable only for LLAP HA
   # To keep the load on zookeeper to a minimum
   # ---- we cache the LLAP activeEndpoint for the cache_timeout period
   # ---- we cache the hiveserver2 endpoint for the length of session
   # configurations to set the time between zookeeper checks
   ## cache_timeout = 60
-  
+
   # Host where Hive Metastore Server (HMS) is running.
   # If Kerberos security is enabled, the fully-qualified domain name (FQDN) is required.
   ## hive_metastore_host=localhost

+ 0 - 6
desktop/core/src/desktop/conf.py

@@ -1503,12 +1503,6 @@ DEV = Config("dev",
    help=_("Enable development mode, where notably static files are not cached.")
 )
 
-DEV_EMBEDDED = Config("dev_embedded",
-   type=coerce_bool,
-   default=False,
-   help=_("Enable embedded development mode, where the page will be rendered inside a container div element.")
-)
-
 DISPLAY_APP_SWITCHER = Config(
   key='display_app_switcher',
   help=_('Enable or disable the upper left app switcher menu.'),

+ 1 - 5
desktop/core/src/desktop/js/apps/notebook/notebook.js

@@ -184,11 +184,7 @@ class Notebook {
         self.historyFilter() === '' &&
         !vm.isNotificationManager()
       ) {
-        self
-          .snippets()[0]
-          .currentQueryTab(
-            typeof IS_EMBEDDED !== 'undefined' && IS_EMBEDDED ? 'queryHistory' : 'savedQueries'
-          );
+        self.snippets()[0].currentQueryTab('savedQueries');
       }
     });
     self.historyFilter = ko.observable('');

+ 1 - 7
desktop/core/src/desktop/js/apps/notebook2/notebook.js

@@ -123,13 +123,7 @@ class Notebook {
         self.historyFilter() === '' &&
         !vm.isNotificationManager()
       ) {
-        self
-          .snippets()[0]
-          .currentQueryTab(
-            typeof window.IS_EMBEDDED !== 'undefined' && window.IS_EMBEDDED
-              ? 'queryHistory'
-              : 'savedQueries'
-          );
+        self.snippets()[0].currentQueryTab('savedQueries');
       }
     });
     self.historyFilter = ko.observable('');

+ 1 - 3
desktop/core/src/desktop/js/hue.js

@@ -125,9 +125,7 @@ $(document).ready(() => {
   ko.applyBindings(sidePanelViewModel, $('.context-panel')[0]);
 
   const topNavViewModel = new TopNavViewModel(onePageViewModel);
-  if (!window.IS_EMBEDDED) {
-    ko.applyBindings(topNavViewModel, $('.top-nav')[0]);
-  }
+  ko.applyBindings(topNavViewModel, $('.top-nav')[0]);
 
   const sidebarViewModel = new SideBarViewModel(onePageViewModel, topNavViewModel);
   ko.applyBindings(sidebarViewModel, $('.hue-sidebar')[0]);

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.hdfs.autocomplete.js

@@ -66,7 +66,7 @@ Plugin.prototype.init = function() {
       .html(
         '<div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p><ul class="unstyled"></ul></p></div></div>'
       )
-      .appendTo($(HUE_CONTAINER));
+      .appendTo($('body'));
   }
 
   function setHueBreadcrumbCaretAtEnd(element) {

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.hiveautocomplete.js

@@ -96,7 +96,7 @@ Plugin.prototype.init = function() {
       .html(
         '<div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><ul class="unstyled"></ul></div></div>'
       )
-      .appendTo(window.HUE_CONTAINER);
+      .appendTo('body');
   }
 
   $el.wrap('<div class="inline">');

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.huedatatable.js

@@ -200,7 +200,7 @@ $.fn.hueDataTable = function(oInit) {
           opacity: 0.85
         })
         .addClass('hueAnchor hue-datatable-search')
-        .appendTo(HUE_CONTAINER);
+        .appendTo('body');
       search.html(
         '<input type="text"> <i class="fa fa-chevron-up pointer muted"></i> <i class="fa fa-chevron-down pointer muted"></i> &nbsp; <span></span> &nbsp; <i class="fa fa-times pointer inactive-action"></i>'
       );

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.notify.js

@@ -137,7 +137,7 @@ Plugin.prototype.show = function() {
       });
       el.show();
     }
-    el.appendTo(HUE_CONTAINER);
+    el.appendTo('body');
   }
 };
 

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.scrollleft.js

@@ -63,7 +63,7 @@ Plugin.prototype.setupScrollLeft = function() {
       .addClass('hueAnchor hueAnchorScroller')
       .attr('href', 'javascript:void(0)')
       .html("<i class='fa fa-fw fa-chevron-left'></i>")
-      .appendTo(HUE_CONTAINER);
+      .appendTo('body');
   }
 
   $(_this.element).attr('jHueLeftScrollified', 'true');

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.scrollup.js

@@ -66,7 +66,7 @@ Plugin.prototype.setupScrollUp = function() {
       .addClass('hueAnchor hueAnchorScroller')
       .attr('href', 'javascript:void(0)')
       .html("<i class='fa fa-fw fa-chevron-up'></i>")
-      .appendTo(HUE_CONTAINER);
+      .appendTo('body');
   }
 
   $(_this.element).attr('jHueScrollified', 'true');

+ 1 - 1
desktop/core/src/desktop/js/jquery/plugins/jquery.tableextender.js

@@ -143,7 +143,7 @@ Plugin.prototype.init = function() {
       )
       .appendTo(jHueTableExtenderNavigator);
 
-    jHueTableExtenderNavigator.appendTo(HUE_CONTAINER);
+    jHueTableExtenderNavigator.appendTo('body');
 
     $(_this.element)
       .find('tbody')

+ 0 - 3
desktop/core/src/desktop/js/jquery/plugins/jquery.tableextender2.js

@@ -243,9 +243,6 @@ Plugin.prototype.repositionHeader = function() {
   if (typeof pos === 'function') {
     pos = pos();
   }
-  if (window.IS_EMBEDDED) {
-    pos = $('.hue-embedded-container').offset().top;
-  }
   let isFixed = false;
   if (pos > -1) {
     if (self.$element.offset().top < pos) {

+ 1 - 1
desktop/core/src/desktop/js/ko/bindings/ko.clickToCopy.js

@@ -23,7 +23,7 @@ ko.bindingHandlers.clickToCopy = {
       const $input = $('<textarea>')
         .css({ opacity: 0 })
         .val(ko.unwrap(valueAccessor()))
-        .appendTo(window.HUE_CONTAINER)
+        .appendTo('body')
         .select();
       document.execCommand('copy');
       $input.remove();

+ 1 - 1
desktop/core/src/desktop/js/ko/bindings/ko.templateContextMenu.js

@@ -40,7 +40,7 @@ ko.bindingHandlers.templateContextMenu = {
             '" class="hue-context-menu" data-bind="template: { name: \'' +
             options.template +
             '\', data: viewModel, afterRender: afterRender }"></ul>'
-        ).appendTo(window.HUE_CONTAINER);
+        ).appendTo('body');
       } else {
         ko.cleanNode($menu[0]);
       }

+ 1 - 10
desktop/core/src/desktop/js/ko/bindings/ko.templatePopover.js

@@ -28,7 +28,7 @@ ko.bindingHandlers.templatePopover = {
     if (!$container.length) {
       $container = $('<div>')
         .attr('id', 'popover-container')
-        .appendTo(window.HUE_CONTAINER);
+        .appendTo('body');
       $('<div>')
         .addClass('temp-content')
         .hide()
@@ -92,15 +92,6 @@ ko.bindingHandlers.templatePopover = {
         $element.attr('title', triggerTitle);
       }
       const $tip = $element.data('popover').$tip;
-      if (window.HUE_CONTAINER !== 'body') {
-        $tip.css({ position: 'fixed', 'z-index': 2000 });
-        $tip.appendTo(window.HUE_CONTAINER);
-
-        $tip.offset({
-          left: $element.offset().left + $element.outerWidth(true) + 10,
-          top: $element.offset().top + $element.outerHeight(true) / 2 - $tip.outerHeight(true) / 2
-        });
-      }
       ko.cleanNode($tip.get(0));
       ko.applyBindings(viewModel, $tip.get(0));
       $tip.find('.close-popover, .close-template-popover').click(event => {

+ 1 - 1
desktop/core/src/desktop/js/ko/bindings/ko.tooltip.js

@@ -24,7 +24,7 @@ ko.bindingHandlers.tooltip = {
   update: function(element, valueAccessor) {
     const local = ko.utils.unwrapObservable(valueAccessor());
     const options = {
-      container: window.HUE_CONTAINER
+      container: 'body'
     };
 
     $(element).tooltip('destroy');

+ 2 - 2
desktop/core/src/desktop/js/ko/components/assist/ko.assistDbPanel.js

@@ -63,7 +63,7 @@ const ASSIST_TABLE_TEMPLATES = `
           'Insert at cursor'
         )}</a></li>
         <!-- /ko -->
-        <!-- ko if: !window.IS_EMBEDDED && catalogEntry.path.length <=2 -->
+        <!-- ko if: catalogEntry.path.length <=2 -->
         <li><a href="javascript:void(0);" data-bind="click: openInMetastore"><i class="fa fa-fw fa-table"></i> ${I18n(
           'Open in Browser'
         )}</a></li>
@@ -358,7 +358,7 @@ const TEMPLATE =
     <div class="assist-db-header-actions">
       <!-- ko ifnot: loading -->
       <span class="assist-tables-counter">(<span data-bind="text: filteredEntries().length"></span>)</span>
-      <!-- ko if: window.ENABLE_NEW_CREATE_TABLE && !window.IS_EMBEDDED && (sourceType === 'hive' || sourceType === 'impala') -->
+      <!-- ko if: window.ENABLE_NEW_CREATE_TABLE && (sourceType === 'hive' || sourceType === 'impala') -->
       <!-- ko if: typeof databaseName !== 'undefined' -->
         <a class="inactive-action" data-bind="hueLink: window.HUE_URLS.IMPORTER_CREATE_TABLE + databaseName + '/?sourceType=' + sourceType + '&namespace=' + assistDbNamespace.namespace.id" title="${I18n(
           'Create table'

+ 26 - 28
desktop/core/src/desktop/js/ko/components/assist/ko.assistPanel.js

@@ -209,36 +209,34 @@ class AssistPanel {
             }
           }
 
-          if (!window.IS_EMBEDDED) {
-            const documentsPanel = new AssistInnerPanel({
-              panelData: {
-                name: 'hue-assist-documents-panel',
-                params: {
-                  user: params.user
-                }
-              },
-              name: I18n('Documents'),
-              type: 'documents',
-              icon: 'fa-files-o',
-              iconSvg: '#hi-documents',
-              minHeight: 50,
-              rightAlignIcon: true,
-              visible:
-                params.visibleAssistPanels && params.visibleAssistPanels.indexOf('documents') !== -1
-            });
+          const documentsPanel = new AssistInnerPanel({
+            panelData: {
+              name: 'hue-assist-documents-panel',
+              params: {
+                user: params.user
+              }
+            },
+            name: I18n('Documents'),
+            type: 'documents',
+            icon: 'fa-files-o',
+            iconSvg: '#hi-documents',
+            minHeight: 50,
+            rightAlignIcon: true,
+            visible:
+              params.visibleAssistPanels && params.visibleAssistPanels.indexOf('documents') !== -1
+          });
 
-            panels.push(documentsPanel);
+          panels.push(documentsPanel);
 
-            huePubSub.subscribe('assist.show.documents', docType => {
-              huePubSub.publish('left.assist.show');
-              if (self.visiblePanel() !== documentsPanel) {
-                self.visiblePanel(documentsPanel);
-              }
-              if (docType) {
-                documentsPanel.panelData.setTypeFilter(docType);
-              }
-            });
-          }
+          huePubSub.subscribe('assist.show.documents', docType => {
+            huePubSub.publish('left.assist.show');
+            if (self.visiblePanel() !== documentsPanel) {
+              self.visiblePanel(documentsPanel);
+            }
+            if (docType) {
+              documentsPanel.panelData.setTypeFilter(docType);
+            }
+          });
 
           if (window.HAS_GIT) {
             panels.push(

+ 1 - 3
desktop/core/src/desktop/js/ko/components/assist/ko.rightAssistPanel.js

@@ -146,9 +146,7 @@ class RightAssistPanel {
       // TODO: Get these dynamically from langref and functions modules when moved to webpack
       this.functionsTabAvailable(type === 'hive' || type === 'impala' || type === 'pig');
       this.langRefTabAvailable(type === 'hive' || type === 'impala');
-      this.editorAssistantTabAvailable(
-        (!window.IS_EMBEDDED || window.EMBEDDED_ASSISTANT_ENABLED) && isSqlDialect
-      );
+      this.editorAssistantTabAvailable(window.EMBEDDED_ASSISTANT_ENABLED && isSqlDialect);
       this.dashboardAssistantTabAvailable(type === 'dashboard');
       this.schedulesTabAvailable(false);
       if (type !== 'dashboard') {

+ 2 - 2
desktop/core/src/desktop/js/ko/components/contextPopover/ko.contextPopover.js

@@ -439,7 +439,7 @@ const SUPPORT_TEMPLATES = `
               )}" class="fa fa-external-link"></i> ${I18n('Dashboard')}
             </a>
           <!-- /ko -->
-          <!-- ko if: !window.IS_EMBEDDED && catalogEntry().getSourceType() !== 'solr' && openActionsEnabled() -->
+          <!-- ko if: catalogEntry().getSourceType() !== 'solr' && openActionsEnabled() -->
           <a class="inactive-action pointer" data-bind="click: openInTableBrowser">
             <i style="font-size: 11px;" title="${I18n(
               'Open in Table Browser...'
@@ -930,7 +930,7 @@ huePubSub.subscribe('context.popover.show', details => {
   const $contextPopover = $(
     '<div id="contextPopover" data-bind="component: { name: \'context-popover\', params: $data }" />'
   );
-  $(HUE_CONTAINER).append($contextPopover);
+  $('body').append($contextPopover);
   ko.applyBindings(details, $contextPopover[0]);
   huePubSub.publish('context.popover.shown');
 });

+ 1 - 1
desktop/core/src/desktop/js/ko/components/ko.createDirectoryModal.js

@@ -58,7 +58,7 @@ componentUtils.registerComponent('create-directory', undefined, TEMPLATE).done((
     $createDirectoryModal = $(
       '<div id="createDirectoryModal" data-bind="component: { name: \'create-directory\', params: $data }" data-keyboard="true" class="modal hide fade" tabindex="-1"/>'
     );
-    $(window.HUE_CONTAINER).append($createDirectoryModal);
+    $('body').append($createDirectoryModal);
 
     ko.applyBindings(docViewModel, $createDirectoryModal[0]);
   });

+ 1 - 1
desktop/core/src/desktop/js/ko/components/ko.deleteDocModal.js

@@ -86,7 +86,7 @@ componentUtils.registerComponent('delete-entry', undefined, TEMPLATE).done(() =>
     $deleteEntriesModal = $(
       '<div id="deleteEntriesModal" data-bind="component: { name: \'delete-entry\', params: $data }" data-keyboard="true" class="modal hide fade" tabindex="-1"/>'
     );
-    $(window.HUE_CONTAINER).append($deleteEntriesModal);
+    $('body').append($deleteEntriesModal);
 
     ko.applyBindings(docViewModel, $deleteEntriesModal[0]);
   });

+ 1 - 1
desktop/core/src/desktop/js/ko/components/ko.historyPanel.js

@@ -203,7 +203,7 @@ class HistoryPanel {
     self.editorViewModel.newNotebook();
 
     self.$toggleElement;
-    const $container = $(HUE_CONTAINER);
+    const $container = $('body');
 
     self.reposition = function() {
       self.top(self.$toggleElement.offset().top + self.$toggleElement.height() + 15 + 'px');

+ 3 - 3
desktop/core/src/desktop/js/ko/components/ko.jobBrowserLinks.js

@@ -34,7 +34,7 @@ const TEMPLATE = `
       <a class="btn btn-flat" style="padding-right: 4px" title="${I18n(
         'Job browser'
       )}" data-bind="hueLink: '/jobbrowser#!jobs', click: function() { huePubSub.publish('hide.jobs.panel'); }">
-        <span>${I18n(window.IS_EMBEDDED || window.IS_MULTICLUSTER_ONLY ? 'Queries' : 'Jobs')}</span>
+        <span>${I18n(window.IS_MULTICLUSTER_ONLY ? 'Queries' : 'Jobs')}</span>
       </a>
     <!-- /ko -->
     <button class="btn btn-flat btn-toggle-jobs-panel" title="${I18n(
@@ -52,7 +52,7 @@ class JobBrowserPanel {
   constructor(params) {
     const self = this;
 
-    const $container = $(window.HUE_CONTAINER);
+    const $container = $('body');
     const $jobsPanel = $('#jobsPanel');
     const $toggle = $('.btn-toggle-jobs-panel');
 
@@ -179,7 +179,7 @@ class JobBrowserPanel {
       }
     });
 
-    if (!window.IS_EMBEDDED && !window.IS_K8S_ONLY) {
+    if (!window.IS_K8S_ONLY) {
       checkJobBrowserStatusIdx = window.setTimeout(checkJobBrowserStatus, 10);
 
       huePubSub.subscribe('check.job.browser', checkYarnBrowserStatus);

+ 7 - 48
desktop/core/src/desktop/js/onePageViewModel.js

@@ -183,10 +183,7 @@ class OnePageViewModel {
     const loadScripts = function(scriptUrls) {
       const promises = [];
       while (scriptUrls.length) {
-        const scriptUrl =
-          typeof window.adaptHueEmbeddedUrls !== 'undefined'
-            ? window.adaptHueEmbeddedUrls(scriptUrls.shift())
-            : scriptUrls.shift();
+        const scriptUrl = scriptUrls.shift();
         if (loadedJs.indexOf(scriptUrl) !== -1) {
           continue;
         }
@@ -200,9 +197,6 @@ class OnePageViewModel {
       if (loadedCss.indexOf(cssFile) === -1) {
         loadedCss.push(cssFile);
         $.ajaxSetup({ cache: true });
-        if (typeof window.adaptHueEmbeddedUrls !== 'undefined') {
-          $el.attr('href', window.adaptHueEmbeddedUrls($el.attr('href')));
-        }
         if (window.DEV) {
           $el.attr('href', $el.attr('href') + '?dev=' + Math.random());
         }
@@ -237,13 +231,6 @@ class OnePageViewModel {
         $(this).attr('href', link);
       });
 
-      if (typeof adaptHueEmbeddedUrls !== 'undefined') {
-        $rawHtml.find('img[src]').each(function() {
-          const $img = $(this);
-          $img.attr('src', window.adaptHueEmbeddedUrls($img.attr('src')));
-        });
-      }
-
       $rawHtml.unwrap('span');
 
       const scriptPromises = loadScripts(scriptsToLoad);
@@ -455,7 +442,7 @@ class OnePageViewModel {
     huePubSub.subscribe('assist.dropzone.complete', self.dropzoneComplete);
 
     // prepend /hue to all the link on this page
-    $(window.IS_EMBEDDED ? '.hue-embedded-container a[href]' : 'a[href]').each(function() {
+    $('a[href]').each(function() {
       let link = $(this).attr('href');
       if (link.startsWith('/') && !link.startsWith('/hue')) {
         link = window.HUE_BASE_URL + '/hue' + link;
@@ -463,37 +450,13 @@ class OnePageViewModel {
       $(this).attr('href', link);
     });
 
-    if (window.IS_EMBEDDED) {
-      page.base(window.location.pathname + window.location.search);
-      page.baseSearch = window.location.search.replace('?', '');
-      if (!window.location.hash) {
-        window.location.hash = '#!/editor?type=impala';
-      }
-      page({ hashbang: true });
-    } else {
-      page.base(window.HUE_BASE_URL + '/hue');
-    }
-
-    const getUrlParameter = function(name) {
-      if (window.IS_EMBEDDED) {
-        if (~window.location.hash.indexOf('?')) {
-          const paramString = window.location.hash.substring(window.location.hash.indexOf('?'));
-          const params = paramString.split('&');
-          for (let i = 0; i < params.length; i++) {
-            if (~params[i].indexOf(name + '=')) {
-              return params[i].substring(name.length + 2);
-            }
-          }
-        }
-        return '';
-      } else {
-        return window.location.getParameter(name) || '';
-      }
-    };
+    page.base(window.HUE_BASE_URL + '/hue');
+
+    const getUrlParameter = name => window.location.getParameter(name) || '';
 
     self.lastContext = null;
 
-    let pageMapping = [
+    const pageMapping = [
       { url: '/403', app: '403' },
       { url: '/500', app: '500' },
       { url: '/about/', app: 'admin_wizard' },
@@ -806,10 +769,6 @@ class OnePageViewModel {
       });
     });
 
-    if (typeof window.HUE_EMBEDDED_PAGE_MAPPINGS !== 'undefined') {
-      pageMapping = pageMapping.concat(window.HUE_EMBEDDED_PAGE_MAPPINGS);
-    }
-
     pageMapping.forEach(mapping => {
       page(
         mapping.url,
@@ -836,7 +795,7 @@ class OnePageViewModel {
 
     huePubSub.subscribe('open.link', href => {
       if (href) {
-        const prefix = window.IS_EMBEDDED ? '' : '/hue';
+        const prefix = '/hue';
         if (href.startsWith('/')) {
           if (window.HUE_BASE_URL.length && href.startsWith(window.HUE_BASE_URL)) {
             page(href);

+ 1 - 1
desktop/core/src/desktop/js/sql/sqlWorkerHandler.js

@@ -61,7 +61,7 @@ let registered = false;
 
 export default {
   registerWorkers: function() {
-    if (!window.IS_EMBEDDED && !registered && window.Worker) {
+    if (!registered && window.Worker) {
       // It can take a while before the worker is active
       const whenWorkerIsReady = function(worker, message) {
         message.hueBaseUrl = window.HUE_BASE_URL;

+ 24 - 60
desktop/core/src/desktop/js/utils/hueUtils.js

@@ -149,16 +149,6 @@ const changeURL = (newURL, params) => {
     }
   }
 
-  if (typeof IS_EMBEDDED !== 'undefined' && IS_EMBEDDED) {
-    let search = window.location.search;
-    if (extraSearch) {
-      search += (search ? '&' : '?') + extraSearch;
-    }
-    newURL = window.location.pathname + search + '#!' + newURL.replace('/hue', '');
-    window.history.pushState(null, null, newURL);
-    return;
-  }
-
   const hashSplit = newURL.split('#');
   const base =
     hashSplit[0].length && hashSplit[0].indexOf(window.HUE_BASE_URL) !== 0
@@ -181,57 +171,31 @@ const replaceURL = newURL => {
 };
 
 const changeURLParameter = (param, value) => {
-  if (typeof IS_EMBEDDED !== 'undefined' && IS_EMBEDDED) {
-    const currentUrl = window.location.hash.replace('#!', '');
-    const parts = currentUrl.split('?');
-    const path = parts[0];
-    let search = parts.length > 1 ? parts[1] : '';
-    if (~search.indexOf(param + '=' + value)) {
-      return;
-    }
-    if (~search.indexOf(param + '=')) {
-      if (!value) {
-        search = search.replace(new RegExp(param + '=[^&]*&?'), '');
-      } else {
-        search = search.replace(new RegExp(param + '=[^&]*'), param + '=' + value);
-      }
-    } else if (value) {
-      if (search) {
-        search += '&';
-      }
-      search += param + '=' + value;
-    } else {
-      return;
+  let newSearch = '';
+  if (window.location.getParameter(param, true) !== null) {
+    newSearch += '?';
+    window.location.search
+      .replace(/\?/gi, '')
+      .split('&')
+      .forEach(p => {
+        if (p.split('=')[0] !== param) {
+          newSearch += p;
+        }
+      });
+    if (value) {
+      newSearch += (newSearch !== '?' ? '&' : '') + param + '=' + value;
     }
-
-    changeURL(search ? path + '?' + search : path);
   } else {
-    let newSearch = '';
-    if (window.location.getParameter(param, true) !== null) {
-      newSearch += '?';
-      window.location.search
-        .replace(/\?/gi, '')
-        .split('&')
-        .forEach(p => {
-          if (p.split('=')[0] !== param) {
-            newSearch += p;
-          }
-        });
-      if (value) {
-        newSearch += (newSearch !== '?' ? '&' : '') + param + '=' + value;
-      }
-    } else {
-      newSearch =
-        window.location.search +
-        (value ? (window.location.search.indexOf('?') > -1 ? '&' : '?') + param + '=' + value : '');
-    }
-
-    if (newSearch === '?') {
-      newSearch = '';
-    }
+    newSearch =
+      window.location.search +
+      (value ? (window.location.search.indexOf('?') > -1 ? '&' : '?') + param + '=' + value : '');
+  }
 
-    changeURL(window.location.pathname + newSearch);
+  if (newSearch === '?') {
+    newSearch = '';
   }
+
+  changeURL(window.location.pathname + newSearch);
 };
 
 const removeURLParameter = param => {
@@ -298,7 +262,7 @@ const waitForVariable = (variable, callback, timeout) => {
 
 const scrollbarWidth = () => {
   const $parent = $('<div style="width:50px;height:50px;overflow:auto"><div/></div>').appendTo(
-    HUE_CONTAINER
+    'body'
   );
   const $children = $parent.children();
   const width = $children.innerWidth() - $children.height(99).innerWidth();
@@ -441,7 +405,7 @@ const getFileBrowseButton = (
   _btn.click(e => {
     e.preventDefault();
     if (!isNestedModal) {
-      $(window.HUE_CONTAINER).addClass('modal-open');
+      $('body').addClass('modal-open');
     }
 
     function callFileChooser() {
@@ -532,7 +496,7 @@ const getFileBrowseButton = (
       }
       if (!isNestedModal) {
         $('#chooseFile').on('hidden', () => {
-          $(window.HUE_CONTAINER).removeClass('modal-open');
+          $('body').removeClass('modal-open');
           $('.modal-backdrop').remove();
         });
       }

文件差异内容过多而无法显示
+ 0 - 16
desktop/core/src/desktop/static/desktop/css/hue-bootstrap-embedded.css


文件差异内容过多而无法显示
+ 0 - 429
desktop/core/src/desktop/static/desktop/css/hue-embedded.css


+ 2 - 2
desktop/core/src/desktop/static/desktop/js/ace.extended.js

@@ -55,7 +55,7 @@ try {
     editor.showSpinner = function () {
       var _position = this.getCursorScreenPosition();
       if ($(".ace-spinner").length == 0) {
-        $("<i class='fa fa-spinner fa-spin ace-spinner'></i>").appendTo(HUE_CONTAINER);
+        $("<i class='fa fa-spinner fa-spin ace-spinner'></i>").appendTo('body');
       }
       $(".ace-spinner").css("top", _position.pageY + "px").css("left", (_position.pageX - 4) + "px").show();
     }
@@ -67,7 +67,7 @@ try {
     editor.showFileButton = function () {
       var _position = this.getCursorScreenPosition();
       if ($(".ace-inline-button").length == 0) {
-        $("<a class='btn btn-mini ace-inline-button'><i class='fa fa-ellipsis-h'></i></a>").appendTo(HUE_CONTAINER);
+        $("<a class='btn btn-mini ace-inline-button'><i class='fa fa-ellipsis-h'></i></a>").appendTo('body');
       }
       $(".ace-inline-button").css("top", _position.pageY + "px").css("left", (_position.pageX + 4) + "px").show();
       $(".ace-inline-button").off("click");

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.blueprint.js

@@ -101,7 +101,7 @@
     $("<div id='jHueBlueprintTooltip'>" + contents + "</div>").css({
       top: y + 5,
       left: x + 5
-    }).appendTo(HUE_CONTAINER).fadeIn(200);
+    }).appendTo('body').fadeIn(200);
   }
 
 

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.hiveautocomplete.js

@@ -84,7 +84,7 @@
       $("<div>").attr("id", "jHueGenericAutocomplete").addClass("jHueAutocomplete popover")
         .attr("style", "position:absolute;display:none;max-width:1000px;z-index:33000")
         .html('<div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><ul class="unstyled"></ul></div></div>')
-        .appendTo(HUE_CONTAINER);
+        .appendTo('body');
     }
 
     $el.wrap('<div class="inline">');

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.huedatatable.js

@@ -177,7 +177,7 @@
           'position': 'fixed',
           'bottom': '20px',
           'opacity': 0.85
-        }).addClass('hueAnchor hue-datatable-search').appendTo(HUE_CONTAINER);
+        }).addClass('hueAnchor hue-datatable-search').appendTo('body');
         search.html('<input type="text"> <i class="fa fa-chevron-up pointer muted"></i> <i class="fa fa-chevron-down pointer muted"></i> &nbsp; <span></span> &nbsp; <i class="fa fa-times pointer inactive-action"></i>');
 
         search.find('.fa-times').on('click', function () {

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.notify.js

@@ -113,7 +113,7 @@
         });
         el.show();
       }
-      el.appendTo(HUE_CONTAINER);
+      el.appendTo('body');
     }
   };
 

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.scrollleft.js

@@ -55,7 +55,7 @@
       $(document).off("click", "#jHueScrollLeftAnchor");
     }
     else {
-      link = $("<a/>").attr("id", "jHueScrollLeftAnchor").addClass("hueAnchor hueAnchorScroller").attr("href", "javascript:void(0)").html("<i class='fa fa-fw fa-chevron-left'></i>").appendTo(HUE_CONTAINER);
+      link = $("<a/>").attr("id", "jHueScrollLeftAnchor").addClass("hueAnchor hueAnchorScroller").attr("href", "javascript:void(0)").html("<i class='fa fa-fw fa-chevron-left'></i>").appendTo('body');
     }
 
     $(_this.element).attr("jHueLeftScrollified", "true");

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/jquery.scrollup.js

@@ -58,7 +58,7 @@
       $(document).off("click", "#jHueScrollUpAnchor");
     }
     else {
-      link = $("<a/>").attr("id", "jHueScrollUpAnchor").addClass("hueAnchor hueAnchorScroller").attr("href", "javascript:void(0)").html("<i class='fa fa-fw fa-chevron-up'></i>").appendTo(HUE_CONTAINER);
+      link = $("<a/>").attr("id", "jHueScrollUpAnchor").addClass("hueAnchor hueAnchorScroller").attr("href", "javascript:void(0)").html("<i class='fa fa-fw fa-chevron-up'></i>").appendTo('body');
     }
 
     $(_this.element).attr("jHueScrollified", "true");

+ 0 - 33
desktop/core/src/desktop/static/desktop/less/hue-bootstrap-embedded.less

@@ -1,33 +0,0 @@
-/*
- Licensed to Cloudera, Inc. under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  Cloudera, Inc. licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-
-.hue-embedded-container {
-  // From body definition in bootstrap2.css
-  margin: 0;
-  font-family: Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
-  font-size: 14px;
-  line-height: 20px;
-  color: #424242;
-  background-color: #eceff1;
-
-  // From html definition in bootstrap2.css
-  -webkit-font-smoothing: antialiased;
-  -moz-osx-font-smoothing: grayscale;
-
-  @import (less) "../ext/css/cui/bootstrap2.css";
-}

+ 0 - 110
desktop/core/src/desktop/static/desktop/less/hue-embedded.less

@@ -1,110 +0,0 @@
-/*
- Licensed to Cloudera, Inc. under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  Cloudera, Inc. licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-     http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-*/
-@import (reference) "cui/colors.less";
-@import (reference) "hue-mixins.less";
-
-@import (inline) "../ext/css/cui/cui.css";
-@import (inline) "../ext/css/cui/bootstrap-responsive2.css";
-@import (inline) "../css/jquery-ui.css";
-
-.hue-embedded-container {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  right: 0;
-  left: 0;
-  overflow: hidden;
-
-  .navbar {
-    padding-left: 0;
-    padding-right: 0;
-    z-index: auto;
-
-    .top-nav {
-      z-index: 999;
-    }
-  }
-
-  .hue-title-bar {
-    background-color: @cui-white !important;
-    border-bottom: none !important;
-
-    .navbar-inner {
-      border-bottom: none !important;
-    }
-  }
-
-  .modal {
-    right: auto;
-    bottom: auto;
-  }
-
-  .hueAnchor {
-    position: absolute !important;
-  }
-
-  * {
-    box-sizing: content-box;
-  }
-
-  .clearable {
-    border: 1px solid @cui-gray-600;
-    padding: 3px 18px 3px 4px;
-    border-radius: 3px;
-    background-size: 10px 10px;
-  }
-
-  .clearable.x {
-    background-position: right 5px center;
-  }
-
-  .clearable.onX {
-    cursor: pointer !important;
-  }
-
-  .app-header {
-    cursor: default !important;
-  }
-
-  @import "hue-assist.less";
-  @import "hue-autocomplete.less";
-  @import "hue-cui-overrides.less";
-  @import "hue-cross-version.less";
-  @import "hue4.less";
-  @import "home.less";
-}
-
-.modal-backdrop {
-  position: fixed;
-  top: 0;
-  right: 0;
-  bottom: 0;
-  left: 0;
-  z-index: 1040;
-  background-color: @cui-black;
-}
-
-.modal-backdrop.fade {
-  opacity: 0;
-}
-
-.modal-backdrop,
-.modal-backdrop.fade.in {
-  opacity: 0.8;
-  filter: alpha(opacity=80);
-}

+ 2 - 3
desktop/core/src/desktop/templates/common_header_footer_components.mako

@@ -18,7 +18,6 @@ from django.utils.translation import ugettext as _
 from django.template.defaultfilters import escape, escapejs
 
 from desktop import conf
-from desktop.conf import IS_EMBEDDED
 from desktop.lib.i18n import smart_unicode
 from desktop.views import _ko
 
@@ -404,7 +403,7 @@ from metadata.conf import has_optimizer, OPTIMIZER
         if ($('#login-modal').length > 0 && $('#login-modal').is(':hidden')) {
           $('#login-modal .link-message').hide();
           if (isAutoLogout) {
-            $(HUE_CONTAINER).children(':not(#login-modal)').addClass('blurred');
+            $('body').children(':not(#login-modal)').addClass('blurred');
             $('#login-modal .auto-logged-out').show();
             $('#login-modal').modal({
               backdrop: 'static',
@@ -565,7 +564,7 @@ from metadata.conf import has_optimizer, OPTIMIZER
   }
 
 
-  %if collect_usage and not IS_EMBEDDED.get():
+  %if collect_usage:
 
     (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
     (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),

+ 2 - 2
desktop/core/src/desktop/templates/document_browser.mako

@@ -625,7 +625,7 @@ from desktop.views import _ko
                 }
 
               } else {
-                $('<div>').addClass('doc-browser-drag-select').appendTo(HUE_CONTAINER);
+                $('<div>').addClass('doc-browser-drag-select').appendTo('body');
               }
             },
             drag: function (event) {
@@ -757,4 +757,4 @@ from desktop.views import _ko
       });
     })();
   </script>
-</%def>
+</%def>

+ 1 - 4
desktop/core/src/desktop/templates/global_js_constants.mako

@@ -19,7 +19,7 @@
 
   from desktop import conf
   from desktop.auth.backend import is_admin;
-  from desktop.conf import APP_SWITCHER_ALTUS_BASE_URL, APP_SWITCHER_MOW_BASE_URL, DISPLAY_APP_SWITCHER, IS_EMBEDDED, IS_K8S_ONLY, IS_MULTICLUSTER_ONLY, USE_NEW_SIDE_PANELS, VCS
+  from desktop.conf import APP_SWITCHER_ALTUS_BASE_URL, APP_SWITCHER_MOW_BASE_URL, DISPLAY_APP_SWITCHER, IS_K8S_ONLY, IS_MULTICLUSTER_ONLY, USE_NEW_SIDE_PANELS, VCS
   from desktop.models import hue_version, _get_apps, get_cluster_config
 
   from beeswax.conf import LIST_PARTITIONS_LIMIT
@@ -95,13 +95,10 @@
   ## In the past was has_workload_analytics()
   window.HAS_WORKLOAD_ANALYTICS = '${ ENABLE_QUERY_ANALYSIS.get() }' === 'True';
 
-  window.HUE_CONTAINER = '${ IS_EMBEDDED.get() }' === 'True' ? '.hue-embedded-container' : 'body';
-
   window.SHOW_NOTEBOOKS = '${ SHOW_NOTEBOOKS.get() }' === 'True'
   window.SHOW_UPLOAD_BUTTON = '${ hasattr(SHOW_UPLOAD_BUTTON, 'get') and SHOW_UPLOAD_BUTTON.get() }' === 'True'
 
   window.IS_MULTICLUSTER_ONLY = '${ IS_MULTICLUSTER_ONLY.get() }' === 'True';
-  window.IS_EMBEDDED = '${ IS_EMBEDDED.get() }' === 'True';
   window.IS_K8S_ONLY = '${ IS_K8S_ONLY.get() }' === 'True';
   window.JB_HEADER_CHECK_INTERVAL_IN_MILLIS = 30000;
   window.JB_SINGLE_CHECK_INTERVAL_IN_MILLIS = 5000;

+ 6 - 86
desktop/core/src/desktop/templates/hue.mako

@@ -18,7 +18,7 @@
   from django.utils.translation import ugettext as _
 
   from desktop import conf
-  from desktop.conf import IS_EMBEDDED, DEV_EMBEDDED, IS_MULTICLUSTER_ONLY, has_multi_clusters
+  from desktop.conf import IS_MULTICLUSTER_ONLY, has_multi_clusters
   from desktop.views import _ko, commonshare, login_modal
   from desktop.lib.i18n import smart_unicode
   from desktop.models import PREFERENCE_IS_WELCOME_TOUR_SEEN, ANALYTIC_DB, hue_version, get_cluster_config
@@ -46,48 +46,14 @@
   <meta name="description" content="">
   <meta name="author" content="">
 
-% if DEV_EMBEDDED.get():
-  <style>
-    html {
-      height: 100%;
-      width: 100%;
-      margin: 0;
-      font-size: 1em;
-    }
-
-    body {
-      position: relative;
-      height: 100%;
-      width: 100%;
-      margin: 0;
-      padding: 0;
-      overflow: hidden;
-      background-color: pink;
-    }
-
-    .hue-embedded-container {
-      position: absolute !important;
-      top: 60px !important;
-      left: 0 !important;
-      bottom: 0 !important;
-      right: 0 !important;
-    }
-  </style>
-% endif
-
   <link href="${ static('desktop/css/roboto.css') }" rel="stylesheet">
   <link href="${ static('desktop/ext/css/font-awesome.min.css') }" rel="stylesheet">
-% if IS_EMBEDDED.get():
-  <link href="${ static('desktop/css/hue-bootstrap-embedded.css') }" rel="stylesheet">
-  <link href="${ static('desktop/css/hue-embedded.css') }" rel="stylesheet">
-% else:
   <link href="${ static('desktop/ext/css/cui/cui.css') }" rel="stylesheet">
   <link href="${ static('desktop/ext/css/cui/bootstrap2.css') }" rel="stylesheet">
   <link href="${ static('desktop/ext/css/cui/bootstrap-responsive2.css') }" rel="stylesheet">
   <link href="${ static('desktop/css/hue.css') }" rel="stylesheet">
   <link href="${ static('desktop/css/jquery-ui.css') }" rel="stylesheet">
   <link href="${ static('desktop/css/home.css') }" rel="stylesheet">
-% endif
   <link rel="stylesheet" href="${ static('desktop/ext/chosen/chosen.min.css') }">
   <link rel="stylesheet" href="${ static('desktop/ext/select2/select2.css') }">
 
@@ -98,40 +64,6 @@
   <link rel="stylesheet" href="${ static('desktop/ext/css/nv.d3.min.css') }">
   <link rel="stylesheet" href="${ static('desktop/css/nv.d3.css') }">
 
-  <script type="text/javascript">
-% if IS_EMBEDDED.get():
-  // Bootstrap 2.3.2 relies on the hide css class presence for modals but doesn't remove it when opened for fade type
-  // modals, a parent container might have it set to !important which will prevent the modal from showing. This
-  // redefines all .hide definitions to exclude .modal.fade
-  try {
-    for (var i = 0; i < document.styleSheets.length; i++) {
-      if (document.styleSheets[i] && document.styleSheets[i].cssRules) {
-        for (var j = document.styleSheets[i].cssRules.length - 1; j > 0; j--) {
-          if (document.styleSheets[i] && document.styleSheets[i].cssRules[j] && document.styleSheets[i].cssRules[j].selectorText === '.hide') {
-            var originalCssText = document.styleSheets[i].cssRules[j].cssText;
-            if (originalCssText.indexOf('!important') !== -1) {
-              document.styleSheets[i].deleteRule(j);
-              document.styleSheets[i].insertRule(originalCssText.replace('.hide', '.hide:not(.modal):not(.fade)'));
-            }
-          }
-        }
-      }
-    }
-  } catch (e) {
-    console.warn(e);
-  }
-
-  // Add modified URL for .clearable background
-  var originalClearableImgUrl = '${ static('desktop/art/clearField@2x.png') }';
-  var clearableImgUrl = typeof adaptHueEmbeddedUrls !== 'undefined' ? adaptHueEmbeddedUrls(originalClearableImgUrl) : originalClearableImgUrl;
-
-  var style = document.createElement('style');
-  style.type = 'text/css';
-  style.appendChild(document.createTextNode('.clearable { background: url(' + clearableImgUrl + ') no-repeat right -10px center; }'));
-  document.head.appendChild(style);
-% endif
-  </script>
-
   ${ commonHeaderFooterComponents.header_i18n_redirection() }
   <%
     global_constants_url = '/desktop/globalJsConstants.js?v=' + hue_version()
@@ -145,10 +77,6 @@
 
 <body>
 
-% if IS_EMBEDDED.get():
-<div class="hue-embedded-container">
-% endif
-
 % if is_demo:
   <ul class="side-labels unstyled">
     <li class="feedback"><a href="javascript:showClassicWidget()"><i class="fa fa-envelope-o"></i> ${_('Feedback')}</a></li>
@@ -191,16 +119,13 @@ ${ hueIcons.symbols() }
       </div>
     % endif
 
-    % if not IS_EMBEDDED.get():
     <nav class="navbar navbar-default">
       <div class="navbar-inner top-nav">
         <div class="top-nav-left">
-          % if not IS_EMBEDDED.get():
-            % if not (IS_MULTICLUSTER_ONLY.get() and get_cluster_config(user)['has_computes']):
-            <a class="hamburger hamburger-hue pull-left" data-bind="toggle: leftNavVisible, css: { 'is-active': leftNavVisible }">
-              <span class="hamburger-box"><span class="hamburger-inner"></span></span>
-            </a>
-            % endif
+          % if not (IS_MULTICLUSTER_ONLY.get() and get_cluster_config(user)['has_computes']):
+          <a class="hamburger hamburger-hue pull-left" data-bind="toggle: leftNavVisible, css: { 'is-active': leftNavVisible }">
+            <span class="hamburger-box"><span class="hamburger-inner"></span></span>
+          </a>
           % endif
 
           % if not IS_MULTICLUSTER_ONLY.get():
@@ -275,7 +200,6 @@ ${ hueIcons.symbols() }
       </div>
       <div id="mini_jobbrowser"></div>
     </div>
-    % endif
 
     <div class="content-wrapper">
       <div class="left-panel" data-bind="css: { 'side-panel-closed': !leftAssistVisible() }, visibleOnHover: { selector: '.hide-left-side-panel' }">
@@ -581,7 +505,7 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
       }
     };
 
-    % if is_demo or (not user_preferences.get(PREFERENCE_IS_WELCOME_TOUR_SEEN) and not IS_EMBEDDED.get()):
+    % if is_demo or not user_preferences.get(PREFERENCE_IS_WELCOME_TOUR_SEEN):
       $(document).on('keyup', closeTourOnEsc);
       $(document).on('click', '.shepherd-backdrop', tour.cancel);
       tour.start();
@@ -611,10 +535,6 @@ ${ smart_unicode(login_modal(request).content) | n,unicode }
 
 ${ commonHeaderFooterComponents.footer(messages) }
 
-% if IS_EMBEDDED.get():
-</div>
-% endif
-
 <div class="monospace-preload" style="opacity: 0; height: 0; width: 0;">
   ${ _('Hue and the Hue logo are trademarks of Cloudera, Inc.') }
   <b>Query. Explore. Repeat.</b>

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

@@ -120,7 +120,7 @@ from django.utils.translation import ugettext as _
       huePubSub.subscribe('sql.syntax.dropdown.show', function (details) {
         hideSyntaxDropdown();
         var $sqlSyntaxDropdown = $('<div id="sqlSyntaxDropdown" data-bind="component: { name: \'sql-syntax-dropdown\', params: $data }" />');
-        $(HUE_CONTAINER).append($sqlSyntaxDropdown);
+        $('body').append($sqlSyntaxDropdown);
         ko.applyBindings(details, $sqlSyntaxDropdown[0]);
       });
     })();

+ 2 - 2
desktop/libs/dashboard/src/dashboard/templates/common_search.mako

@@ -4146,11 +4146,11 @@ function loadSearch(collection, query, initial) {
   searchViewModel.isPlayerMode.subscribe(function(value) {
     if (value){
       $(".navigator").hide();
-      $(HUE_CONTAINER).css("paddingTop", "40px");
+      $('body').css("paddingTop", "40px");
     }
     else {
       $(".navigator").show();
-      $(HUE_CONTAINER).css("paddingTop", "80px");
+      $('body').css("paddingTop", "80px");
     }
   });
 

+ 59 - 113
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -23,7 +23,6 @@ from desktop import conf
 from desktop.auth.backend import is_admin
 from desktop.lib.i18n import smart_unicode
 from desktop.views import _ko, antixss
-from desktop.conf import IS_EMBEDDED
 from metadata.conf import has_optimizer, OPTIMIZER
 
 from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_BATCH_EXECUTE, ENABLE_EXTERNAL_STATEMENT, ENABLE_PRESENTATION
@@ -136,36 +135,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
         <ul class="nav editor-nav">
           <li class="app-header" style="display:none" data-bind="visible: true">
             <!-- ko if: editorMode -->
-              % if IS_EMBEDDED.get():
-                <span>
-                  <!-- ko template: { name: 'app-icon-template', data: { icon: editorType() } } --><!-- /ko -->
-                  <!-- ko switch: editorType() -->
-                  <!-- ko case: 'impala' -->Impala<!-- /ko -->
-                  <!-- ko case: 'rdbms' -->DB Query<!-- /ko -->
-                  <!-- ko case: 'pig' -->Pig<!-- /ko -->
-                  <!-- ko case: 'java' -->Java<!-- /ko -->
-                  <!-- ko case: 'spark2' -->Spark<!-- /ko -->
-                  <!-- ko case: 'sqoop1' -->Sqoop 1<!-- /ko -->
-                  <!-- ko case: 'distcp' -->DistCp<!-- /ko -->
-                  <!-- ko case: 'shell' -->Shell<!-- /ko -->
-                  <!-- ko case: 'mapreduce' -->MapReduce<!-- /ko -->
-                  <!-- ko case: ['beeswax', 'hive'] -->Hive<!-- /ko -->
-                  <!-- ko case: 'mapreduce' -->MapReduce<!-- /ko -->
-                  <!-- ko case: 'spark' -->Scala<!-- /ko -->
-                  <!-- ko case: 'pyspark' -->PySpark<!-- /ko -->
-                  <!-- ko case: 'r' -->R<!-- /ko -->
-                  <!-- ko case: 'jar' -->Spark Submit Jar<!-- /ko -->
-                  <!-- ko case: 'py' -->Spark Submit Python<!-- /ko -->
-                  <!-- ko case: 'solr' -->Solr SQL<!-- /ko -->
-                  <!-- ko case: 'kafkasql' -->Kafka SQL<!-- /ko -->
-                  <!-- ko case: 'markdown' -->Markdown<!-- /ko -->
-                  <!-- ko case: 'text' -->Text<!-- /ko -->
-                  <!-- ko case: 'clickhouse' -->ClickHouse<!-- /ko -->
-                  <!-- ko case: $default --><span data-bind="text: editorTypeTitle()"></span><!-- /ko -->
-                  <!-- /ko -->
-                </span>
-              % else:
-                <a data-bind="hueLink: '${ url('notebook:editor') }?type=' + editorType(), attr: { 'title': editorTypeTitle() + '${ _(' Editor') }'}" style="cursor: pointer">
+              <a data-bind="hueLink: '${ url('notebook:editor') }?type=' + editorType(), attr: { 'title': editorTypeTitle() + '${ _(' Editor') }'}" style="cursor: pointer">
               <!-- ko template: { name: 'app-icon-template', data: { icon: editorType() } } --><!-- /ko -->
 
               <!-- ko switch: editorType() -->
@@ -194,7 +164,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
               <!-- /ko -->
               <!-- ko component: { name: 'hue-favorite-app', params: { app: 'editor', interpreter: editorType() }} --><!-- /ko -->
               </a>
-              % endif
             <!-- /ko -->
             <!-- ko ifnot: editorMode -->
               <i class="fa fa-file-text-o app-icon" style="vertical-align: middle"></i>
@@ -203,7 +172,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
             <!-- /ko -->
           </li>
 
-          % if not IS_EMBEDDED.get():
           <!-- ko with: selectedNotebook -->
           <li class="no-horiz-padding">
             <a>&nbsp;</a>
@@ -240,7 +208,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
             </a>
           </li>
           <!-- /ko -->
-          % endif
         </ul>
       </div>
     </div>
@@ -250,7 +217,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
 
 <script type="text/html" id="notebook-menu-buttons-${ suffix }">
   <div class="pull-right margin-right-10">
-  % if ENABLE_PRESENTATION.get() and not IS_EMBEDDED.get():
+  % if ENABLE_PRESENTATION.get():
     <!-- ko with: selectedNotebook() -->
       <div class="btn-group">
         <a class="btn" data-bind="click: function() { isPresentationMode(!isPresentationMode()); },
@@ -272,78 +239,65 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
     <!-- /ko -->
   % endif
 
-    % if IS_EMBEDDED.get():
-      <div class="btn-group">
-        <a class="btn" rel="tooltip" data-bind="click: function() { newNotebook($root.editorType(), null, selectedNotebook() ? $root.selectedNotebook().snippets()[0].currentQueryTab() : null); }, attr: { 'title': '${ _('New ') }' +  editorTypeTitle() + '${ _(' Query') }' }">
-          <i class="fa fa-fw fa-file-o"></i>
-        </a>
-      </div>
-      <div class="btn-group">
-        <a class="btn" rel="tooltip" data-bind="css: {'active': $root.isContextPanelVisible }, click: function() { $root.isContextPanelVisible(!$root.isContextPanelVisible()); }">
-          <i class="fa fa-fw fa-cogs"></i>
-        </a>
-      </div>
-    % else:
-      <div class="btn-group">
-        <a class="btn" rel="tooltip" data-placement="bottom" data-loading-text="${ _("Saving...") }" data-bind="click: function() { if ($root.canSave() ) { saveNotebook() } else { $('#saveAsModal${ suffix }').modal('show');} }, attr: { title: $root.canSave() ? '${ _ko('Save') }' : '${ _ko('Save As') }' }">
-          <i class="fa fa-save"></i>
-        </a>
+    <div class="btn-group">
+      <a class="btn" rel="tooltip" data-placement="bottom" data-loading-text="${ _("Saving...") }" data-bind="click: function() { if ($root.canSave() ) { saveNotebook() } else { $('#saveAsModal${ suffix }').modal('show');} }, attr: { title: $root.canSave() ? '${ _ko('Save') }' : '${ _ko('Save As') }' }">
+        <i class="fa fa-save"></i>
+      </a>
 
-        <!-- ko if: $root.canSave -->
-        <a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript: void(0)"><span class="caret"></span></a>
-        <ul class="dropdown-menu pull-right">
-          <li>
-            <a class="pointer" data-bind="click: function() { $('#saveAsModal${ suffix }').modal('show'); }">
-              <i class="fa fa-fw fa-save"></i> ${ _('Save as...') }
-            </a>
-          </li>
-        </ul>
-        <!-- /ko -->
-      </div>
+      <!-- ko if: $root.canSave -->
+      <a class="btn dropdown-toggle" data-toggle="dropdown" href="javascript: void(0)"><span class="caret"></span></a>
+      <ul class="dropdown-menu pull-right">
+        <li>
+          <a class="pointer" data-bind="click: function() { $('#saveAsModal${ suffix }').modal('show'); }">
+            <i class="fa fa-fw fa-save"></i> ${ _('Save as...') }
+          </a>
+        </li>
+      </ul>
+      <!-- /ko -->
+    </div>
 
-      <!-- ko template: { ifnot: editorMode() || isPresentationMode(), name: 'notebook-actions' }--><!-- /ko -->
+    <!-- ko template: { ifnot: editorMode() || isPresentationMode(), name: 'notebook-actions' }--><!-- /ko -->
 
-      <!-- ko ifnot: isPresentationMode() -->
-      <div class="dropdown pull-right margin-left-10">
-        <a class="btn" data-toggle="dropdown" href="javascript: void(0)">
-          <i class="fa fa-fw fa-ellipsis-v"></i>
-        </a>
-        <ul class="dropdown-menu pull-right">
-          <li>
-          <!-- ko if: editorMode -->
-            <a href="javascript:void(0)" data-bind="click: function() { hueUtils.removeURLParameter('editor'); newNotebook($root.editorType(), null, selectedNotebook() ? $root.selectedNotebook().snippets()[0].currentQueryTab() : null); }, attr: { 'title': '${ _('New ') }' +  editorTypeTitle() + '${ _(' Query') }' }">
-              <i class="fa fa-fw fa-file-o"></i> ${ _('New') }
-            </a>
-          <!-- /ko -->
-          <!-- ko ifnot: editorMode -->
-            <a href="javascript:void(0)" data-bind="click: newNotebook">
-              <i class="fa fa-fw fa-file-o"></i> ${ _('New Notebook') }
-            </a>
-          <!-- /ko -->
-          </li>
-          <li>
-            <a href="javascript:void(0)" data-bind="publish: { 'assist.show.documents': editorMode() ? 'query-' + editorType() : editorType() }">
-              <svg class="hi hi-fw hi-bigger"><use xlink:href="#hi-documents"></use></svg> <span data-bind="text: editorMode() ? '${ _ko('Queries') }' : '${ _ko('Notebooks') }'"></span>
-            </a>
-          </li>
-          <li class="divider"></li>
-          <!-- ko if: $root.canSave -->
-          <li>
-            <a class="share-link pointer" data-bind="click: prepareShareModal,
+    <!-- ko ifnot: isPresentationMode() -->
+    <div class="dropdown pull-right margin-left-10">
+      <a class="btn" data-toggle="dropdown" href="javascript: void(0)">
+        <i class="fa fa-fw fa-ellipsis-v"></i>
+      </a>
+      <ul class="dropdown-menu pull-right">
+        <li>
+        <!-- ko if: editorMode -->
+          <a href="javascript:void(0)" data-bind="click: function() { hueUtils.removeURLParameter('editor'); newNotebook($root.editorType(), null, selectedNotebook() ? $root.selectedNotebook().snippets()[0].currentQueryTab() : null); }, attr: { 'title': '${ _('New ') }' +  editorTypeTitle() + '${ _(' Query') }' }">
+            <i class="fa fa-fw fa-file-o"></i> ${ _('New') }
+          </a>
+        <!-- /ko -->
+        <!-- ko ifnot: editorMode -->
+          <a href="javascript:void(0)" data-bind="click: newNotebook">
+            <i class="fa fa-fw fa-file-o"></i> ${ _('New Notebook') }
+          </a>
+        <!-- /ko -->
+        </li>
+        <li>
+          <a href="javascript:void(0)" data-bind="publish: { 'assist.show.documents': editorMode() ? 'query-' + editorType() : editorType() }">
+            <svg class="hi hi-fw hi-bigger"><use xlink:href="#hi-documents"></use></svg> <span data-bind="text: editorMode() ? '${ _ko('Queries') }' : '${ _ko('Notebooks') }'"></span>
+          </a>
+        </li>
+        <li class="divider"></li>
+        <!-- ko if: $root.canSave -->
+        <li>
+          <a class="share-link pointer" data-bind="click: prepareShareModal,
               css: {'isShared': isShared()}">
-              <i class="fa fa-fw fa-users"></i> ${ _('Share') }
-            </a>
-          </li>
-          <!-- /ko -->
-          <li>
-            <a class="pointer" data-bind="css: {'active': $root.isContextPanelVisible }, click: function() { $root.isContextPanelVisible(!$root.isContextPanelVisible()); }">
-              <i class="fa fa-fw fa-cogs"></i> ${ _('Session') }
-            </a>
-          </li>
-        </ul>
-      </div>
-      <!-- /ko -->
-    % endif
+            <i class="fa fa-fw fa-users"></i> ${ _('Share') }
+          </a>
+        </li>
+        <!-- /ko -->
+        <li>
+          <a class="pointer" data-bind="css: {'active': $root.isContextPanelVisible }, click: function() { $root.isContextPanelVisible(!$root.isContextPanelVisible()); }">
+            <i class="fa fa-fw fa-cogs"></i> ${ _('Session') }
+          </a>
+        </li>
+      </ul>
+    </div>
+    <!-- /ko -->
   </div>
 </script>
 
@@ -585,13 +539,11 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           % if conf.USE_DEFAULT_CONFIGURATION.get():
             <a class="inactive-action pointer margin-left-10" title="${ _('Save session settings as default') }" rel="tooltip" data-bind="click: function() { $parent.saveDefaultUserProperties($data) }"><i class="fa fa-save"></i> ${ _('Set as default settings') }</a>
           % endif
-          % if not IS_EMBEDDED.get():
           <!-- ko if: type() == 'impala' && typeof http_addr != 'undefined' -->
             <a class="margin-left-10" data-bind="attr: {'href': http_addr()}" target="_blank">
               <span data-bind="text: http_addr().replace(/^(https?):\/\//, '')"></span> <i class="fa fa-external-link"></i>
             </a>
           <!-- /ko -->
-          % endif
         </div>
         % if conf.USE_DEFAULT_CONFIGURATION.get():
         <div style="width:100%;">
@@ -627,7 +579,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
   <div class="snippet-log-container margin-bottom-10" data-bind="visible: showLogs">
     <div data-bind="delayedOverflow: 'slow', css: resultsKlass" style="margin-top: 5px; position: relative;">
       <a href="javascript: void(0)" class="inactive-action close-logs-overlay" data-bind="click: function(){ showLogs(false) }">&times;</a>
-      % if not IS_EMBEDDED.get():
       <ul data-bind="visible: jobs().length > 0, foreach: jobs" class="unstyled jobs-overlay">
         <li data-bind="attr: {'id': $data.name.substr(4)}">
           % if is_embeddable:
@@ -643,7 +594,6 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           <div class="clearfix"></div>
         </li>
       </ul>
-      % endif
       <span data-bind="visible: !$root.isPresentationMode() || !$root.isHidingCode()">
         <pre data-bind="visible: (!result.logs() || result.logs().length == 0) && jobs().length > 0" class="logs logs-bigger">${ _('No logs available at this moment.') }</pre>
         <pre data-bind="visible: result.logs() && result.logs().length > 0, text: result.logs, logScroller: result.logs, logScrollerVisibilityEvent: showLogs" class="logs logs-bigger logs-populated"></pre>
@@ -682,19 +632,15 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
           <a class="inactive-action" href="#queryHistory" data-toggle="tab">${_('Query History')}
             <div class="inline-block inactive-action margin-left-10 pointer visible-on-hover" title="${_('Search the query history')}" data-bind="click: function(data, e){ $parent.historyFilterVisible(!$parent.historyFilterVisible()); if ($parent.historyFilterVisible()) { window.setTimeout(function(){ $(e.target).parent().siblings('input').focus(); }, 0); } else { $parent.historyFilter('') }}"><i class="snippet-icon fa fa-search"></i></div>
             <input class="input-small inline-tab-filter" type="text" data-bind="visible: $parent.historyFilterVisible, clearable: $parent.historyFilter, valueUpdate:'afterkeydown'" placeholder="${ _('Search...') }">
-            % if not IS_EMBEDDED.get():
             <div class="inline-block inactive-action pointer visible-on-hover" title="${_('Clear the query history')}" data-target="#clearHistoryModal${ suffix }" data-toggle="modal" rel="tooltip" data-bind="visible: $parent.history().length > 0"><i class="snippet-icon fa fa-calendar-times-o"></i></div>
-            %endif
           </a>
         </li>
-        % if not IS_EMBEDDED.get():
         <li data-bind="click: function(){ currentQueryTab('savedQueries'); }, css: {'active': currentQueryTab() == 'savedQueries'}, onClickOutside: function () { if (queriesFilterVisible() && queriesFilter() === '') { queriesFilterVisible(false) } }">
           <a class="inactive-action" href="#savedQueries" data-toggle="tab">${_('Saved Queries')}
             <div class="inline-block inactive-action margin-left-10 pointer visible-on-hover" title="${_('Search the saved queries')}" data-bind="visible: !queriesHasErrors(), click: function(data, e){ queriesFilterVisible(!queriesFilterVisible()); if (queriesFilterVisible()) { window.setTimeout(function(){ $(e.target).parent().siblings('input').focus(); }, 0); } else { queriesFilter('') }}"><i class="snippet-icon fa fa-search"></i></div>
             <input class="input-small inline-tab-filter" type="text" data-bind="visible: queriesFilterVisible, clearable: queriesFilter, valueUpdate:'afterkeydown'" placeholder="${ _('Search...') }">
           </a>
         </li>
-        % endif
         % if ENABLE_QUERY_BUILDER.get():
         <!-- ko if: isSqlDialect -->
         <li data-bind="click: function(){ currentQueryTab('queryBuilderTab'); }, css: {'active': currentQueryTab() == 'queryBuilderTab'}"><a class="inactive-action" href="#queryBuilderTab" data-toggle="tab">${_('Query Builder')}</a></li>
@@ -970,7 +916,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
 </script>
 
 <script type="text/html" id="snippet-header-statement-type${ suffix }">
-  % if ENABLE_EXTERNAL_STATEMENT.get() and not IS_EMBEDDED.get():
+  % if ENABLE_EXTERNAL_STATEMENT.get():
   <!-- ko if: isSqlDialect() -->
     <span class="editor-header-title">${ _('Type') }</span>
     <div data-bind="component: { name: 'hue-drop-down', params: { value: statementType, entries: statementTypes, linkTitle: '${ _ko('Statement type') }' } }" style="display: inline-block"></div>
@@ -1945,7 +1891,7 @@ ${ sqlSyntaxDropdown.sqlSyntaxDropdown() }
       </a>
     </div>
 
-    % if conf.ENABLE_DOWNLOAD.get() and not IS_EMBEDDED.get():
+    % if conf.ENABLE_DOWNLOAD.get():
     <div data-bind="component: { name: 'downloadSnippetResults', params: { gridSideBtn: false, snippet: $data, notebook: $parent } }" style="display:inline-block;"></div>
     % endif
   </div>

部分文件因为文件数量过多而无法显示