cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bfede...@apache.org
Subject git commit: updated refs/heads/master to 5b5d3d0
Date Thu, 20 Jun 2013 21:40:26 GMT
Updated Branches:
  refs/heads/master ae6e8b448 -> 5b5d3d0be


Zone chart: Update secondary storage link to show both sub-sections

-Show both 'secondary storage' and 'image stores' via dropdown on link
 to list view


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

Branch: refs/heads/master
Commit: 5b5d3d0be23da25d735d197558f6c7331f3b3c0c
Parents: ae6e8b4
Author: Brian Federle <brian.federle@citrix.com>
Authored: Thu Jun 20 14:40:00 2013 -0700
Committer: Brian Federle <brian.federle@citrix.com>
Committed: Thu Jun 20 14:40:00 2013 -0700

----------------------------------------------------------------------
 ui/scripts/system.js                      | 120 +++++++++++++++++--------
 ui/scripts/ui-custom/physicalResources.js |   6 +-
 2 files changed, 89 insertions(+), 37 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b5d3d0b/ui/scripts/system.js
----------------------------------------------------------------------
diff --git a/ui/scripts/system.js b/ui/scripts/system.js
index 227b67e..f5b2bdf 100644
--- a/ui/scripts/system.js
+++ b/ui/scripts/system.js
@@ -6845,49 +6845,99 @@
             secondaryStorage: function() {
               var listView = $.extend(
                 true, {},
-                cloudStack.sections.system.subsections['secondary-storage'].sections.secondaryStorage,
{
-                  listView: {
-                    dataProvider: function (args) {
-                      var searchByArgs = args.filterBy.search.value.length ?
-                        '&name=' + args.filterBy.search.value : '';
+                cloudStack.sections.system.subsections['secondary-storage'], {
+                  sections: {
+                    secondaryStorage: {
+                      listView: {
+                        dataProvider: function (args) {
+                          var searchByArgs = args.filterBy.search.value.length ?
+                            '&name=' + args.filterBy.search.value : '';
 
-                      var data = {
-                        type: 'SecondaryStorage',
-                        page: args.page,
-                        pageSize: pageSize,
-                        listAll: true
-                      };
+                          var data = {
+                            type: 'SecondaryStorage',
+                            page: args.page,
+                            pageSize: pageSize,
+                            listAll: true
+                          };
 
-                      $.ajax({
-                        url: createURL('listImageStores' + searchByArgs),
-                        data: data,
-                        success: function (json) {
-                          args.response.success({ data: json.listimagestoreresponse.imagestore
});
+                          $.ajax({
+                            url: createURL('listImageStores' + searchByArgs),
+                            data: data,
+                            success: function (json) {
+                              args.response.success({ data: json.listimagestoreresponse.imagestore
});
+                            },
+                            error: function (json) {
+                              args.response.error(parseXMLHttpResponse(json));
+                            }
+                          });
                         },
-                        error: function (json) {
-                          args.response.error(parseXMLHttpResponse(json));
+                        detailView: {
+                          updateContext: function (args) {
+                            var zone;
+
+                            $.ajax({
+                              url: createURL('listZones'),
+                              data: { id: args.context.secondarystorages[0].zoneid },
+                              async: false,
+                              success: function (json) {
+                                zone = json.listzonesresponse.zone[0];
+                              }
+                            });
+
+                            selectedZoneObj = zone;
+
+                            return {
+                              zones: [zone]
+                            };
+                          }
                         }
-                      });
+                      }                      
                     },
-                    detailView: {
-                      updateContext: function (args) {
-                        var zone;
+                    imageStores: {
+                      listView: {
+                        dataProvider: function (args) {
+                          var searchByArgs = args.filterBy.search.value.length ?
+                            '&name=' + args.filterBy.search.value : '';
 
-                        $.ajax({
-                          url: createURL('listZones'),
-                          data: { id: args.context.secondarystorages[0].zoneid },
-                          async: false,
-                          success: function (json) {
-                            zone = json.listzonesresponse.zone[0];
-                          }
-                        });
+                          var data = {
+                            type: 'SecondaryStorage',
+                            page: args.page,
+                            pageSize: pageSize,
+                            listAll: true
+                          };
 
-                        selectedZoneObj = zone;
+                          $.ajax({
+                            url: createURL('listImageStores' + searchByArgs),
+                            data: data,
+                            success: function (json) {
+                              args.response.success({ data: json.listimagestoreresponse.imagestore
});
+                            },
+                            error: function (json) {
+                              args.response.error(parseXMLHttpResponse(json));
+                            }
+                          });
+                        },
+                        detailView: {
+                          updateContext: function (args) {
+                            var zone;
 
-                        return {
-                          zones: [zone]
-                        };
-                      }
+                            $.ajax({
+                              url: createURL('listZones'),
+                              data: { id: args.context.secondarystorages[0].zoneid },
+                              async: false,
+                              success: function (json) {
+                                zone = json.listzonesresponse.zone[0];
+                              }
+                            });
+
+                            selectedZoneObj = zone;
+
+                            return {
+                              zones: [zone]
+                            };
+                          }
+                        }
+                      }                      
                     }
                   }
                 }

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/5b5d3d0b/ui/scripts/ui-custom/physicalResources.js
----------------------------------------------------------------------
diff --git a/ui/scripts/ui-custom/physicalResources.js b/ui/scripts/ui-custom/physicalResources.js
index 65b87e4..529adcf 100644
--- a/ui/scripts/ui-custom/physicalResources.js
+++ b/ui/scripts/ui-custom/physicalResources.js
@@ -20,7 +20,9 @@
       var target = args.sections.physicalResources.listView[targetID];
       var listViewArgs = $.isFunction(target) ? target() : target;
 
-      return $('<div>').listView(listViewArgs.listView ? listViewArgs : { listView:
listViewArgs });
+      return $('<div>').listView(
+        (listViewArgs.listView || listViewArgs.sections) ? listViewArgs : { listView: listViewArgs
}
+      );
     };
     var $dashboard = $('#template').find('.system-dashboard-view').clone();
     var getData = function() {
@@ -131,4 +133,4 @@
       return resourceChart(args);
     };
   };
-}(cloudStack, jQuery));
\ No newline at end of file
+}(cloudStack, jQuery));


Mime
View raw message