浏览代码

HUE-1176 [jb] Display notifications in live

Romain Rigaux 9 年之前
父节点
当前提交
3375f75

+ 10 - 6
desktop/core/src/desktop/templates/responsive.mako

@@ -207,7 +207,12 @@ ${ hueIcons.symbols() }
             <ul>
               <!-- ko foreach: editorVM.selectedNotebook().history -->
                 <li style="font-size: 15px; font-weight: 300">
-                  1hours ago <i class="fa fa-fighter-jet fa-fw"></i> <span data-bind="text: $data.name"> <span data-bind="text: $data.query"></span>
+                  <span data-bind="text: lastExecuted"></span>
+                  <i class="fa fa-fighter-jet fa-fw"></i>
+                  <span data-bind="text: status"></span>
+                  <span data-bind="text: name"></span>
+                  <span data-bind="text: 'statement'"></span>
+                  <span data-bind="text: uuid"></span>
                 </li>
               <!-- /ko -->
             </ul>
@@ -794,12 +799,11 @@ ${ assist.assistPanel() }
       TopNavViewModel.prototype.performSearch = function () {
       };
 
-
       self.editorVM = new EditorViewModel(null, '', {
         user: '${ user.username }',
         userId: ${ user.id },
         languages: [{name: "Java", type: "java"}, {name: "Hive SQL", type: "hive"}], // TODO reuse
-        is_history: true,
+        is_history: true, // Important
         snippetViewSettings: {
           java : {
             snippetIcon: 'fa-file-archive-o '
@@ -861,8 +865,8 @@ ${ assist.assistPanel() }
         var notebook = self.editorVM.selectedNotebook();
         notebook.history.unshift(
           notebook._makeHistoryRecord(
-            'url',
-            'data.handle.statement',
+            notebook.onSuccessUrl(),
+            notebook.snippets()[0].result.handle().statement || '',
             notebook.snippets()[0].lastExecuted(),
             notebook.snippets()[0].status(),
             notebook.name(),
@@ -870,7 +874,7 @@ ${ assist.assistPanel() }
           )
         );
 
-        self.historyPanelVisible(true);
+        topNavViewModel.historyPanelVisible(true);
       });
 
 

+ 1 - 0
desktop/libs/indexer/src/indexer/templates/importer.mako

@@ -1319,6 +1319,7 @@ ${ assist.assistPanel() }
             }
           });
           self.editorVM.editorMode(true);
+          self.editorVM.isHistory(true);
           ko.cleanNode($("#importerNotebook")[0]);
           ko.applyBindings(self.editorVM, $("#importerNotebook")[0]);
 

+ 1 - 0
desktop/libs/notebook/src/notebook/connectors/base.py

@@ -144,6 +144,7 @@ class Notebook(object):
           u'arguments': arguments,
           u'archives': archives,
           u'env_var': env_var,
+          'command_path': shell_command,
         }
     }))
     self._add_session(_data, 'shell')

+ 1 - 1
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -971,7 +971,7 @@ var EditorViewModel = (function() {
         self.statusForButtons('executed');
         stopLongOperationTimeout();
 
-        if (vm.editorMode() && data.history_id && window.location.pathname != '/indexer/importer/') {
+        if (vm.editorMode() && data.history_id && ! vm.isHistory()) {
           var url = '/notebook/editor' + (vm.isMobile() ? '_m' : '') + '?editor=' + data.history_id;
           if (vm.isResponsive()){
             url = vm.URLS.responsive + '&editor=' + data.history_id;