ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From atk...@apache.org
Subject ambari git commit: AMBARI-9338 RU tabs with logs for current task doesn't switch correctly. (atkach)
Date Mon, 26 Jan 2015 18:53:46 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 6a70baa2a -> ec99d7510


AMBARI-9338 RU tabs with logs for current task doesn't switch correctly. (atkach)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/ec99d751
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/ec99d751
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/ec99d751

Branch: refs/heads/trunk
Commit: ec99d75104343291b8f7629863f3efc66508c5b4
Parents: 6a70baa
Author: Andrii Tkach <atkach@hortonworks.com>
Authored: Mon Jan 26 20:32:04 2015 +0200
Committer: Andrii Tkach <atkach@hortonworks.com>
Committed: Mon Jan 26 20:32:04 2015 +0200

----------------------------------------------------------------------
 .../data/stack_versions/upgrade_task.json       | 230 +------------------
 .../main/admin/stack_upgrade/upgrade_task.hbs   |   8 +-
 .../admin/stack_upgrade/upgrade_task_view.js    |  28 +++
 .../stack_upgrade/upgrade_task_view_test.js     |  36 +++
 4 files changed, 72 insertions(+), 230 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ec99d751/ambari-web/app/assets/data/stack_versions/upgrade_task.json
----------------------------------------------------------------------
diff --git a/ambari-web/app/assets/data/stack_versions/upgrade_task.json b/ambari-web/app/assets/data/stack_versions/upgrade_task.json
index 09b9b67..b6411c2 100644
--- a/ambari-web/app/assets/data/stack_versions/upgrade_task.json
+++ b/ambari-web/app/assets/data/stack_versions/upgrade_task.json
@@ -28,237 +28,15 @@
                 "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
                 "exit_code" : 999,
                 "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
+                "id" : 124,
                 "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
                 "request_id" : 5,
                 "role" : "SERVICE_CHECK",
                 "stage_id" : 2,
                 "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
-                "structured_out" : null
-              }
-            }
-          ]
-        },
-        {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/1/upgrade_items/2",
-          "UpgradeItem" : {
-            "cluster_name" : "c1",
-            "group_id" : 1,
-            "request_id" : 5,
-            "stage_id" : 2
-          },
-          "tasks" : [
-            {
-              "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/1/upgrade_items/2/tasks/17",
-              "Tasks" : {
-                "attempt_cnt" : 0,
-                "cluster_name" : "c1",
-                "command" : "SERVICE_CHECK",
-                "command_detail" : "SERVICE_CHECK ZOOKEEPER",
-                "end_time" : 1418386843143,
-                "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
-                "exit_code" : 999,
-                "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
-                "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
-                "request_id" : 5,
-                "role" : "SERVICE_CHECK",
-                "stage_id" : 2,
-                "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
-                "structured_out" : null
-              }
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3",
-      "UpgradeGroup" : {
-        "group_id" : 3,
-        "request_id" : 5
-      },
-      "upgrade_items" : [
-        {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3/upgrade_items/3",
-          "UpgradeItem" : {
-            "cluster_name" : "c1",
-            "group_id" : 3,
-            "request_id" : 5,
-            "stage_id" : 3
-          },
-          "tasks" : [
-            {
-              "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3/upgrade_items/3/tasks/17",
-              "Tasks" : {
-                "attempt_cnt" : 0,
-                "cluster_name" : "c1",
-                "command" : "SERVICE_CHECK",
-                "command_detail" : "SERVICE_CHECK ZOOKEEPER",
-                "end_time" : 1418386843143,
-                "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
-                "exit_code" : 999,
-                "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
-                "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
-                "request_id" : 5,
-                "role" : "SERVICE_CHECK",
-                "stage_id" : 2,
-                "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
-                "structured_out" : null
-              }
-            }
-          ]
-        },
-        {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3/upgrade_items/4",
-          "UpgradeItem" : {
-            "cluster_name" : "c1",
-            "group_id" : 3,
-            "request_id" : 5,
-            "stage_id" : 4
-          },
-          "tasks" : [
-            {
-              "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3/upgrade_items/4/tasks/17",
-              "Tasks" : {
-                "attempt_cnt" : 0,
-                "cluster_name" : "c1",
-                "command" : "SERVICE_CHECK",
-                "command_detail" : "SERVICE_CHECK ZOOKEEPER",
-                "end_time" : 1418386843143,
-                "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
-                "exit_code" : 999,
-                "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
-                "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
-                "request_id" : 5,
-                "role" : "SERVICE_CHECK",
-                "stage_id" : 2,
-                "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
-                "structured_out" : null
-              }
-            }
-          ]
-        },
-        {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3/upgrade_items/5",
-          "UpgradeItem" : {
-            "cluster_name" : "c1",
-            "group_id" : 3,
-            "request_id" : 5,
-            "stage_id" : 5
-          },
-          "tasks" : [
-            {
-              "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/3/upgrade_items/5/tasks/17",
-              "Tasks" : {
-                "attempt_cnt" : 0,
-                "cluster_name" : "c1",
-                "command" : "SERVICE_CHECK",
-                "command_detail" : "SERVICE_CHECK ZOOKEEPER",
-                "end_time" : 1418386843143,
-                "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
-                "exit_code" : 999,
-                "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
-                "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
-                "request_id" : 5,
-                "role" : "SERVICE_CHECK",
-                "stage_id" : 2,
-                "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
-                "structured_out" : null
-              }
-            }
-          ]
-        }
-      ]
-    },
-    {
-      "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/4",
-      "UpgradeGroup" : {
-        "group_id" : 4,
-        "request_id" : 5
-      },
-      "upgrade_items" : [
-        {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/4/upgrade_items/6",
-          "UpgradeItem" : {
-            "cluster_name" : "c1",
-            "group_id" : 4,
-            "request_id" : 5,
-            "stage_id" : 6
-          },
-          "tasks" : [
-            {
-              "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/4/upgrade_items/6/tasks/17",
-              "Tasks" : {
-                "attempt_cnt" : 0,
-                "cluster_name" : "c1",
-                "command" : "SERVICE_CHECK",
-                "command_detail" : "SERVICE_CHECK ZOOKEEPER",
-                "end_time" : 1418386843143,
-                "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
-                "exit_code" : 999,
-                "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
-                "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
-                "request_id" : 5,
-                "role" : "SERVICE_CHECK",
-                "stage_id" : 2,
-                "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
-                "structured_out" : null
-              }
-            }
-          ]
-        },
-        {
-          "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/4/upgrade_items/7",
-          "UpgradeItem" : {
-            "cluster_name" : "c1",
-            "group_id" : 4,
-            "request_id" : 5,
-            "stage_id" : 7
-          },
-          "tasks" : [
-            {
-              "href" : "http://192.168.56.101:8080/api/v1/clusters/c1/upgrades/5/upgrade_groups/4/upgrade_items/7/tasks/17",
-              "Tasks" : {
-                "attempt_cnt" : 0,
-                "cluster_name" : "c1",
-                "command" : "SERVICE_CHECK",
-                "command_detail" : "SERVICE_CHECK ZOOKEEPER",
-                "end_time" : 1418386843143,
-                "error_log" : "/var/lib/ambari-agent/data/errors-17.txt",
-                "exit_code" : 999,
-                "host_name" : "dev01.hortonworks.com",
-                "id" : 17,
-                "output_log" : "/var/lib/ambari-agent/data/output-17.txt",
-                "request_id" : 5,
-                "role" : "SERVICE_CHECK",
-                "stage_id" : 2,
-                "start_time" : -1,
-                "status" : "ABORTED",
-                "stderr" : "",
-                "stdout" : "",
+                "status" : "IN_PROGRESS",
+                "stderr" : "ERROR",
+                "stdout" : "OUT LOG",
                 "structured_out" : null
               }
             }

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec99d751/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_task.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_task.hbs b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_task.hbs
index 60225c3..9192d3e 100644
--- a/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_task.hbs
+++ b/ambari-web/app/templates/main/admin/stack_upgrade/upgrade_task.hbs
@@ -24,11 +24,11 @@
 {{#if view.showContent}}
   <div class="task-details task-detail-info">
     <ul class="nav nav-tabs">
-      <li class="active"><a href="#tab1" data-toggle="tab">{{t common.stdout}}</a></li>
-      <li><a href="#tab2" data-toggle="tab">{{t common.stderr}}</a></li>
+      <li class="active"><a data-toggle="tab" {{bindAttr href="view.logTabIdLink"}}>{{t
common.stdout}}</a></li>
+      <li><a {{bindAttr href="view.errorTabIdLInk"}} data-toggle="tab">{{t common.stderr}}</a></li>
     </ul>
     <div class="tab-content">
-      <div class="tab-pane active" id="tab1">
+      <div class="tab-pane active" {{bindAttr id="view.logTabId"}}>
         <p>{{view.content.host_name}}</p>
         <div class="row-fluid">
           <p class="pull-left">{{view.content.output_log}}</p>
@@ -44,7 +44,7 @@
         <pre {{bindAttr class="view.outputLogOpened:hidden :stdout"}}>{{view.content.stdout}}</pre>
         {{view Ember.TextArea valueBinding="view.content.stdout" classBinding="view.outputLogOpened::hidden"
readonly="readonly"}}
       </div>
-      <div class="tab-pane" id="tab2">
+      <div class="tab-pane" {{bindAttr id="view.errorTabId"}}>
         <p>{{view.content.host_name}}</p>
         <div class="row-fluid">
           <p class="pull-left">{{view.content.error_log}}</p>

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec99d751/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js
index 7b85afd..467e72c 100644
--- a/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js
+++ b/ambari-web/app/views/main/admin/stack_upgrade/upgrade_task_view.js
@@ -67,6 +67,34 @@ App.upgradeTaskView = Em.View.extend({
    */
   taskDetailsProperties: ['status', 'stdout', 'stderr', 'error_log', 'host_name', 'output_log'],
 
+  /**
+   * @type {string}
+   */
+  logTabId: function () {
+    return this.get('elementId') + '-log-tab'
+  }.property(''),
+
+  /**
+   * @type {string}
+   */
+  errorTabId: function () {
+    return this.get('elementId') + '-error-tab'
+  }.property(''),
+
+  /**
+   * @type {string}
+   */
+  logTabIdLink: function () {
+    return '#' + this.get('logTabId');
+  }.property(''),
+
+  /**
+   * @type {string}
+   */
+  errorTabIdLInk: function () {
+    return '#' + this.get('errorTabId');
+  }.property(''),
+
   didInsertElement: function () {
     if (this.get('outsideView')) this.doPolling();
   },

http://git-wip-us.apache.org/repos/asf/ambari/blob/ec99d751/ambari-web/test/views/main/admin/stack_upgrade/upgrade_task_view_test.js
----------------------------------------------------------------------
diff --git a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_task_view_test.js b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_task_view_test.js
index 5a63da7..ca1d8ba 100644
--- a/ambari-web/test/views/main/admin/stack_upgrade/upgrade_task_view_test.js
+++ b/ambari-web/test/views/main/admin/stack_upgrade/upgrade_task_view_test.js
@@ -27,6 +27,42 @@ describe('App.upgradeTaskView', function () {
   });
   view.removeObserver('content.isExpanded', view, 'doPolling');
 
+  describe("#logTabId", function() {
+    it("", function() {
+      view.reopen({
+        elementId: 'elementId'
+      });
+      expect(view.get('logTabId')).to.equal('elementId-log-tab');
+    });
+  });
+
+  describe("#errorTabId", function() {
+    it("", function() {
+      view.reopen({
+        elementId: 'elementId'
+      });
+      expect(view.get('errorTabId')).to.equal('elementId-error-tab');
+    });
+  });
+
+  describe("#logTabIdLink", function() {
+    it("", function() {
+      view.reopen({
+        logTabId: 'elementId-log-tab'
+      });
+      expect(view.get('logTabIdLink')).to.equal('#elementId-log-tab');
+    });
+  });
+
+  describe("#errorTabIdLInk", function() {
+    it("", function() {
+      view.reopen({
+        errorTabId: 'elementId-error-tab'
+      });
+      expect(view.get('errorTabIdLInk')).to.equal('#elementId-error-tab');
+    });
+  });
+
   describe("#doPolling()", function () {
     beforeEach(function () {
       sinon.stub(view, 'getTaskDetails', Em.K);


Mime
View raw message