ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From xiw...@apache.org
Subject [1/2] ambari git commit: AMBARI-10584. Widget Browser: need to update api call because of api change.(XIWANG)
Date Sat, 18 Apr 2015 00:41:33 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk fc5b29f43 -> f69d157c8


AMBARI-10584. Widget Browser: need to update api call because of api change.(XIWANG)


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

Branch: refs/heads/trunk
Commit: f69d157c8d428f31a206ec9e92a66e43c3e4e980
Parents: 8719812
Author: Xi Wang <xiwang@apache.org>
Authored: Fri Apr 17 17:36:22 2015 -0700
Committer: Xi Wang <xiwang@apache.org>
Committed: Fri Apr 17 17:36:30 2015 -0700

----------------------------------------------------------------------
 .../controllers/main/service/info/summary.js    | 28 ++++++++++----------
 ambari-web/app/utils/ajax/ajax.js               |  4 +--
 .../app/views/main/service/info/summary.js      |  1 -
 3 files changed, 16 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f69d157c/ambari-web/app/controllers/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/controllers/main/service/info/summary.js b/ambari-web/app/controllers/main/service/info/summary.js
index 054ab31..9acf5ee 100644
--- a/ambari-web/app/controllers/main/service/info/summary.js
+++ b/ambari-web/app/controllers/main/service/info/summary.js
@@ -442,18 +442,18 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
     if (data.items[0] && data.items.length) {
       this.set("allSharedWidgets",
         data.items.filter(function (widget) {
-          return widget.Widgets.widget_type != "HEATMAP";
+          return widget.WidgetInfo.widget_type != "HEATMAP";
         }).map(function (widget) {
-          var widgetType = widget.Widgets.widget_type;
-          var widgetName = widget.Widgets.widget_name;
+          var widgetType = widget.WidgetInfo.widget_type;
+          var widgetName = widget.WidgetInfo.widget_name;
           return Em.Object.create({
-            id: widget.Widgets.id,
+            id: widget.WidgetInfo.id,
             widgetName: widgetName,
-            displayName: widget.Widgets.display_name,
-            description: widget.Widgets.description,
+            displayName: widget.WidgetInfo.display_name,
+            description: widget.WidgetInfo.description,
             widgetType: widgetType,
             iconPath: "/img/widget-" + widgetType.toLowerCase() + ".png",
-            serviceName: JSON.parse(widget.Widgets.metrics).mapProperty('service_name').uniq().join('-'),
+            serviceName: JSON.parse(widget.WidgetInfo.metrics).mapProperty('service_name').uniq().join('-'),
             added: addedWidgetsNames.contains(widgetName),
             isShared: true
           });
@@ -491,18 +491,18 @@ App.MainServiceInfoSummaryController = Em.Controller.extend({
     if (data.items[0] && data.items.length) {
       this.set("mineWidgets",
         data.items.filter(function (widget) {
-          return widget.Widgets.widget_type != "HEATMAP";
+          return widget.WidgetInfo.widget_type != "HEATMAP";
         }).map(function (widget) {
-          var widgetType = widget.Widgets.widget_type;
-          var widgetName = widget.Widgets.widget_name;
+          var widgetType = widget.WidgetInfo.widget_type;
+          var widgetName = widget.WidgetInfo.widget_name;
           return Em.Object.create({
-            id: widget.Widgets.id,
+            id: widget.WidgetInfo.id,
             widgetName: widgetName,
-            displayName: widget.Widgets.display_name,
-            description: widget.Widgets.description,
+            displayName: widget.WidgetInfo.display_name,
+            description: widget.WidgetInfo.description,
             widgetType: widgetType,
             iconPath: "/img/widget-" + widgetType.toLowerCase() + ".png",
-            serviceName: JSON.parse(widget.Widgets.metrics).mapProperty('service_name').uniq().join('-'),
+            serviceName: JSON.parse(widget.WidgetInfo.metrics).mapProperty('service_name').uniq().join('-'),
             added: addedWidgetsNames.contains(widgetName),
             isShared: false
           });

http://git-wip-us.apache.org/repos/asf/ambari/blob/f69d157c/ambari-web/app/utils/ajax/ajax.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/ajax/ajax.js b/ambari-web/app/utils/ajax/ajax.js
index 1657196..ff3253b 100644
--- a/ambari-web/app/utils/ajax/ajax.js
+++ b/ambari-web/app/utils/ajax/ajax.js
@@ -2407,12 +2407,12 @@ var urls = {
   },
 
   'widgets.all.shared.get': {
-    real: '/clusters/{clusterName}/widgets?Widgets/scope=CLUSTER&fields=*',
+    real: '/clusters/{clusterName}/widgets?WidgetInfo/scope=CLUSTER&fields=*',
     mock: '/data/widget_layouts/all_shared_widgets.json'
   },
 
   'widgets.all.mine.get': {
-    real: '/clusters/{clusterName}/widgets?Widgets/author={loginName}&fields=*',
+    real: '/clusters/{clusterName}/widgets?WidgetInfo/author={loginName}&fields=*',
     mock: '/data/widget_layouts/all_mine_widgets.json'
   },
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f69d157c/ambari-web/app/views/main/service/info/summary.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/main/service/info/summary.js b/ambari-web/app/views/main/service/info/summary.js
index d8df50e..41bfd31 100644
--- a/ambari-web/app/views/main/service/info/summary.js
+++ b/ambari-web/app/views/main/service/info/summary.js
@@ -600,7 +600,6 @@ App.MainServiceInfoSummaryView = Em.View.extend(App.UserPref, {
           }), self.get('controller.widgets'));
           //TODO bind to actual layout instance
           var layout = self.get('controller.widgetLayouts').objectAt(0);
-
           self.get('controller').saveLayout(widgets, layout);
         },
         activate: function (event, ui) {


Mime
View raw message