anmolbabu has posted comments on this change.

Change subject: ui-plugin : Trends Tab
......................................................................


Patch Set 27:

(3 comments)

http://gerrit.ovirt.org/#/c/25471/27/gluster-nagios-dashboard/src/js/trends.js
File gluster-nagios-dashboard/src/js/trends.js:

Line 87:                 if(isRestForHosts) {
Line 88:                     this.httpGet(treeItemType, treeEntity, 
relativeUrl, hosts, services, criteriaString);
Line 89:                 } else {
Line 90:                     this.httpGet(treeItemType, treeEntity, 
relativeUrl, services, hosts, criteriaString);
Line 91:                 }
> use services.js for fetching Clusters/Volumes/Hosts
Done
Line 92:             },
Line 93:             httpGet : function(selectedEntityType, selectedEntity, 
relativeUrl, restDataCollection, dataCollection, criteriaString) {
Line 94:                 var caller = this;
Line 95:                 $http({method: 'GET', url: relativeUrl, headers: 
{Accept: 'application/json'}}).success(function(data) {


Line 146:                 graphs = [];
Line 147:                 var today = new Date();
Line 148:                 var yesterday = new Date();
Line 149:                 yesterday.setDate(today.getDate() - 1);
Line 150:                 if(!$rootScope.startDate) {
> do we need to use rootScope here instead of $scope
yes bcoz,I am using global variable and setting it in start and stop time 
controllers.These variables get set whenever the date and time are set.And they 
are used here for obtaining the graph urls.As this would otherwise require 4 * 
1 = 4 more watch'es
Line 151:                     $rootScope.startDate = new Date(yesterday);
Line 152:                 }
Line 153:                 if(!$rootScope.startTime) {
Line 154:                     $rootScope.startTime = new Date(yesterday);


Line 174:                 for(var i = 0 ; i < urls.length ; i++) {
Line 175:                     tempUrls[i] = 
graphUtils.appendTimeToUrl(graphUtils.trimStartAndStopTimeFromUrl(urls[i]), 
graphUtils.formTimeInFormat(startDate), graphUtils.formTimeInFormat(endDate));
Line 176:                 }
Line 177:                 return tempUrls;
Line 178:             },
> can this be moved to utils?
Did you mean move this factory(dataManager) to the above graphUtils factory? I 
thought of having the core/reusable logic in graphUtils and the logic built 
over it in this factory(dataManager).
Line 179:             exposeTestDataFunction: function () {
Line 180:                 var caller = this;
Line 181:                 $window.setTestData = function (type, entityId, 
entityName, entityClusterId, pluginConfig) {
Line 182:                     treeItemType = type;


-- 
To view, visit http://gerrit.ovirt.org/25471
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Id7c00636e380da154f7f457066fe89475d04c9b4
Gerrit-PatchSet: 27
Gerrit-Project: samples-uiplugins
Gerrit-Branch: master
Gerrit-Owner: anmolbabu <anb...@redhat.com>
Gerrit-Reviewer: Kanagaraj M <kmayi...@redhat.com>
Gerrit-Reviewer: anmolbabu <anb...@redhat.com>
Gerrit-HasComments: Yes
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to