Просмотр исходного кода

[editor] Add Impalad address to the session popup

Romain Rigaux 10 лет назад
Родитель
Сommit
09e7b6c
1 измененных файлов с 13 добавлено и 0 удалено
  1. 13 0
      desktop/libs/notebook/src/notebook/templates/editor_components.mako

+ 13 - 0
desktop/libs/notebook/src/notebook/templates/editor_components.mako

@@ -1015,6 +1015,19 @@ ${ login_modal(request).content | n,unicode }
             <!-- /ko -->
             <!-- ko foreach: sessions -->
               <h4 data-bind="text: $root.getSnippetName(type())" style="clear:left;"></h4>
+              <!-- ko if: type()== 'impala' && typeof properties != 'undefined' -->
+
+              <ul class="nav nav-list" style="border: none; padding: 0;">
+                <li class="nav-header">${ _('address')}</li>
+              </ul>
+              <div style="margin: 2px" data-bind="with: ko.utils.arrayFirst(properties(), function(item) { return item.key() == 'http_addr' });">
+                <a data-bind="attr: {'href': window.location.protocol + '//' + $data.value().replace(/^(https?):\/\//, '')}" target="_blank">
+                  <span data-bind="text: $data.value().replace(/^(https?):\/\//, '')"></span>
+                  <i class="fa fa-external-link"></i>
+                </a>
+              </div>
+
+              <!-- /ko -->
               <!-- ko if: ['pyspark', 'spark'].indexOf(type()) != -1 && typeof properties != 'undefined' -->
               <div style="display:block; width:100%;">
                 <!-- ko foreach: properties -->