Browse Source

HUE-8638 [core] Remove dead webworker code for embedded mode

Johan Ahlen 7 years ago
parent
commit
97199482f1

+ 1 - 1
desktop/core/src/desktop/static/desktop/js/ko.hue-bindings.js

@@ -4064,7 +4064,7 @@
 
     return {
       registerWorkers: function () {
-        if (!registered && window.Worker) {
+        if (!window.IS_EMBEDDED && !registered && window.Worker) {
           // It can take a while before the worker is active
           var whenWorkerIsReady = function (worker, message) {
             if (!worker.isReady) {

+ 4 - 9
desktop/core/src/desktop/templates/ace_sql_syntax_worker.mako

@@ -18,17 +18,12 @@
   from desktop import conf
 %>
 
-var scriptPrefix = '';
-% if conf.IS_EMBEDDED.get():
-  scriptPrefix = location.href.substring(0, location.href.indexOf('/desktop/workers/'));
-% endif
-
 % if conf.DEV.get():
-importScripts(scriptPrefix + '${ static('desktop/js/autocomplete/sqlParseSupport.js') }' + '?' + Math.random());
-importScripts(scriptPrefix + '${ static('desktop/js/autocomplete/sqlSyntaxParser.js') }' + '?' + Math.random());
+importScripts('${ static('desktop/js/autocomplete/sqlParseSupport.js') }' + '?' + Math.random());
+importScripts('${ static('desktop/js/autocomplete/sqlSyntaxParser.js') }' + '?' + Math.random());
 % else:
-importScripts(scriptPrefix + '${ static('desktop/js/autocomplete/sqlParseSupport.js') }');
-importScripts(scriptPrefix + '${ static('desktop/js/autocomplete/sqlSyntaxParser.js') }');
+importScripts('${ static('desktop/js/autocomplete/sqlParseSupport.js') }');
+importScripts('${ static('desktop/js/autocomplete/sqlSyntaxParser.js') }');
 % endif
 
 (function () {

+ 1 - 2
desktop/libs/notebook/src/notebook/urls.py

@@ -45,7 +45,6 @@ urlpatterns = [
   url(r'^editor_m/?$', notebook_views.editor_m, name='editor_m'),
   url(r'^browse/(?P<database>\w+)/(?P<table>\w+)/(?P<partition_spec>.+?)?$', notebook_views.browse, name='browse'),
   url(r'^execute_and_watch/?$', notebook_views.execute_and_watch, name='execute_and_watch'),
-  url(r'^workers_embedded$', notebook_views.workers_embedded, name='workers_embedded'),
 ]
 
 # APIs
@@ -61,7 +60,7 @@ urlpatterns += [
   url(r'^api/cancel_statement/?$', notebook_api.cancel_statement, name='cancel_statement'),
   url(r'^api/close_statement/?$', notebook_api.close_statement, name='close_statement'),
   url(r'^api/get_logs/?$', notebook_api.get_logs, name='get_logs'),
-
+  
   url(r'^api/explain/?$', notebook_api.explain, name='explain'),
   url(r'^api/format/?$', notebook_api.format, name='format'),
   url(r'^api/get_external_statement/?$', notebook_api.get_external_statement, name='get_external_statement'),

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

@@ -93,14 +93,12 @@ def notebook(request, is_embeddable=False):
       'is_yarn_mode': is_yarn_mode,
   })
 
-@xframe_options_exempt
-def workers_embedded(request):
-  return render('workers_embedded.mako', request, {})
 
 @check_document_access_permission()
 def notebook_embeddable(request):
   return notebook(request, True)
 
+
 @check_editor_access_permission()
 @check_document_access_permission()
 def editor(request, is_mobile=False, is_embeddable=False):