Skip to content

Commit ef5924f

Browse files
committed
remove graph
1 parent 2d260a0 commit ef5924f

2 files changed

Lines changed: 49 additions & 49 deletions

File tree

OpenFlow/src/public/Controllers.ts

Lines changed: 48 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -667,55 +667,55 @@ module openflow {
667667
var chart: chartset = null;
668668
this.models = await this.api.Query("users", { _type: "user" }, null, null);
669669
if (!this.$scope.$$phase) { this.$scope.$apply(); }
670-
for (var i = 0; i < this.models.length; i++) {
671-
var user = this.models[i] as any;
672-
var d = new Date();
673-
// d.setMonth(d.getMonth() - 1);
674-
d.setDate(d.getDate() - 7);
675-
console.debug("get mapreduce for " + user.name);
676-
var stats = await this.api.MapReduce("audit",
677-
function map() {
678-
var startDate = new Date(this._created);
679-
this.count = 1;
680-
emit(startDate.toISOString().split('T')[0], this);
681-
}, function reduce(key, values) {
682-
var reducedObject = { count: 0, value: 0, avg: 0, minrun: 0, maxrun: 0, run: 0, _acl: [] };
683-
values.forEach(function (value) {
684-
reducedObject.count += value.count;
685-
reducedObject._acl = value._acl;
686-
});
687-
return reducedObject;
688-
}, function finalize(key, reducedValue) {
689-
if (reducedValue.count > 0) {
690-
reducedValue.avg = reducedValue.value / reducedValue.count;
691-
}
692-
return reducedValue;
693-
}, { userid: user._id, "_created": { "$gte": new Date(d.toISOString()) } }, { inline: 1 }, null);
694-
695-
chart = new chartset();
696-
chart.charttype = "line"
697-
chart.data = [];
698-
var days = daysBetween(d, new Date());
699-
for (var y = 0; y < days; y++) {
700-
var startDate = new Date(d);
701-
startDate.setDate(d.getDate() + y);
702-
var datestring = startDate.toISOString().split('T')[0];
703-
var exists = stats.filter(m => m._id == datestring);
704-
if (exists.length > 0) {
705-
chart.data.push(exists[0].value.count);
706-
} else {
707-
chart.data.push(0);
708-
}
709-
//chart.labels.push(datestring);
710-
if ((y % 2) == 0 || (days == 30 && y == 30)) {
711-
chart.labels.push(startDate.getDate().toString());
712-
} else {
713-
chart.labels.push("");
714-
}
715-
}
716-
user.chart = chart;
670+
// for (var i = 0; i < this.models.length; i++) {
671+
// var user = this.models[i] as any;
672+
// var d = new Date();
673+
// // d.setMonth(d.getMonth() - 1);
674+
// d.setDate(d.getDate() - 7);
675+
// console.debug("get mapreduce for " + user.name);
676+
// var stats = await this.api.MapReduce("audit",
677+
// function map() {
678+
// var startDate = new Date(this._created);
679+
// this.count = 1;
680+
// emit(startDate.toISOString().split('T')[0], this);
681+
// }, function reduce(key, values) {
682+
// var reducedObject = { count: 0, value: 0, avg: 0, minrun: 0, maxrun: 0, run: 0, _acl: [] };
683+
// values.forEach(function (value) {
684+
// reducedObject.count += value.count;
685+
// reducedObject._acl = value._acl;
686+
// });
687+
// return reducedObject;
688+
// }, function finalize(key, reducedValue) {
689+
// if (reducedValue.count > 0) {
690+
// reducedValue.avg = reducedValue.value / reducedValue.count;
691+
// }
692+
// return reducedValue;
693+
// }, { userid: user._id, "_created": { "$gte": new Date(d.toISOString()) } }, { inline: 1 }, null);
694+
695+
// chart = new chartset();
696+
// chart.charttype = "line"
697+
// chart.data = [];
698+
// var days = daysBetween(d, new Date());
699+
// for (var y = 0; y < days; y++) {
700+
// var startDate = new Date(d);
701+
// startDate.setDate(d.getDate() + y);
702+
// var datestring = startDate.toISOString().split('T')[0];
703+
// var exists = stats.filter(m => m._id == datestring);
704+
// if (exists.length > 0) {
705+
// chart.data.push(exists[0].value.count);
706+
// } else {
707+
// chart.data.push(0);
708+
// }
709+
// //chart.labels.push(datestring);
710+
// if ((y % 2) == 0 || (days == 30 && y == 30)) {
711+
// chart.labels.push(startDate.getDate().toString());
712+
// } else {
713+
// chart.labels.push("");
714+
// }
715+
// }
716+
// user.chart = chart;
717717

718-
}
718+
// }
719719
this.loading = false;
720720
if (!this.$scope.$$phase) { this.$scope.$apply(); }
721721
}

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0.0.265
1+
0.0.266

0 commit comments

Comments
 (0)