瀏覽代碼

HUE-6213 [editor] Link to Impalad daemon can have a wrong https prefix

Romain Rigaux 8 年之前
父節點
當前提交
1e9443d

+ 1 - 2
desktop/libs/notebook/src/notebook/connectors/hiveserver2.py

@@ -174,7 +174,6 @@ class HS2Api(Api):
     }
 
     if not properties:
-
       config = None
       if USE_DEFAULT_CONFIGURATION.get():
         config = DefaultConfiguration.objects.get_configuration_for_user(app=lang, user=self.user)
@@ -829,7 +828,7 @@ DROP TABLE IF EXISTS `%(table)s`;
   def _get_impala_server_url(self, session):
     impala_settings = session.get_formatted_properties()
     http_addr = next((setting['value'] for setting in impala_settings if setting['key'].lower() == 'http_addr'), None)
-    return http_addr
+    return ('https://' if get_webserver_certificate_file() else 'http://') + http_addr
 
 
   def _get_impala_query_profile(self, server_url, query_id):

+ 1 - 1
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -575,7 +575,7 @@ from notebook.conf import ENABLE_QUERY_BUILDER, ENABLE_QUERY_SCHEDULING, ENABLE_
           <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
         <!-- ko if: type() == 'impala' && typeof http_addr != 'undefined' -->
-        <a class="margin-left-10" data-bind="attr: {'href': window.location.protocol + '//' + http_addr().replace(/^(https?):\/\//, '')}" target="_blank"><i class="fa fa-external-link"></i> <span data-bind="text: http_addr().replace(/^(https?):\/\//, '')"></span></a>
+        <a class="margin-left-10" data-bind="attr: {'href': http_addr()}" target="_blank"><i class="fa fa-external-link"></i> <span data-bind="text: http_addr().replace(/^(https?):\/\//, '')"></span></a>
         <!-- /ko -->
       </div>
       <div style="width:100%;">