浏览代码

HUE-4110 [editor] Skeleton of running schedule actions

Romain Rigaux 9 年之前
父节点
当前提交
2d3f72a

+ 17 - 2
desktop/libs/notebook/src/notebook/static/notebook/js/notebook.ko.js

@@ -1837,7 +1837,7 @@
     };
     };
 
 
     self.loadScheduler = function() {
     self.loadScheduler = function() {
-      logGA('schedule');
+      logGA('schedule/edit');
       $.get("/oozie/editor/coordinator/new/", {
       $.get("/oozie/editor/coordinator/new/", {
         format: 'json'
         format: 'json'
       }, function (data) {
       }, function (data) {
@@ -1853,8 +1853,23 @@
         $(document).trigger("error", xhr.responseText);
         $(document).trigger("error", xhr.responseText);
       });
       });
     };
     };
-  }
 
 
+    self.viewSchedulerId = ko.observable('0000000-160519110441280-oozie-oozi-C');
+    self.viewScheduler = function() {
+      logGA('schedule/view');
+      $.get("/oozie/list_oozie_coordinator/" + self.viewSchedulerId(), {
+        format: 'json'
+      }, function (data) {
+        $("#schedulerViewer").text(ko.mapping.toJSON(data));
+
+        //var viewModel = new RunningCoordinatorModel(data.actions);
+        //ko.cleanNode($("#schedulerViewer")[0]);
+        //ko.applyBindings(viewModel, $("#schedulerViewer")[0]);
+      }).fail(function (xhr) {
+        $(document).trigger("error", xhr.responseText);
+      });
+    };
+  }
 
 
   function logGA(page) {
   function logGA(page) {
     if (typeof trackOnGA == 'function') {
     if (typeof trackOnGA == 'function') {

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

@@ -270,7 +270,7 @@ ${ hueIcons.symbols() }
 
 
            
            
 
 
-        <a class="btn pointer" title="${ _('Sessions') }" rel="tooltip" data-placement="bottom" data-bind="css: {'active': $root.isContextPanelVisible }, click: function() { $root.isContextPanelVisible(!$root.isContextPanelVisible()); }">
+        <a class="btn pointer" title="${ _('Context') }" rel="tooltip" data-placement="bottom" data-bind="css: {'active': $root.isContextPanelVisible }, click: function() { $root.isContextPanelVisible(!$root.isContextPanelVisible()); }">
           <i class="fa fa-cogs"></i>
           <i class="fa fa-cogs"></i>
         </a>
         </a>
       </div>
       </div>
@@ -1063,6 +1063,10 @@ ${ hueIcons.symbols() }
 
 
     ## To move to 'notification' panel
     ## To move to 'notification' panel
     <div class="tab-pane" id="scheduleActionsTab">
     <div class="tab-pane" id="scheduleActionsTab">
+      <input type="text" data-bind="value: viewSchedulerId, click: viewScheduler"></input>
+
+      <div id="schedulerViewer">
+      </div>
     </div>
     </div>
     % endif
     % endif