зеркало из https://github.com/mozilla/MozDef.git
clean up some old-style helper routines in support of #290
This commit is contained in:
Родитель
165a9e8cd5
Коммит
7d2842886a
|
@ -14,34 +14,35 @@ if (Meteor.isClient) {
|
|||
Session.set('alertsSearch',null);
|
||||
Session.set('alertsDisplayed',0);
|
||||
|
||||
Template.alertssummary.selectedalerts = function () {
|
||||
//console.log(moment().format(),Session.get('alertsSearch'));
|
||||
|
||||
Session.set('alertsDisplayed',
|
||||
alerts.find(Session.get('alertsSearch'),
|
||||
{limit: Session.get('alertsrecordlimit'),
|
||||
reactive:false}).count()
|
||||
);
|
||||
|
||||
//return just what's needed for the summary table
|
||||
return alerts.find(Session.get('alertsSearch'),
|
||||
{fields:{
|
||||
_id:1,
|
||||
esmetadata:1,
|
||||
utctimestamp:1,
|
||||
utcepoch:1,
|
||||
summary:1,
|
||||
severity:1,
|
||||
category:1,
|
||||
acknowledged:1,
|
||||
acknowledgedby:1,
|
||||
url:1
|
||||
},
|
||||
sort: {utcepoch: -1},
|
||||
limit: Session.get('alertsrecordlimit'),
|
||||
reactive:true})
|
||||
};
|
||||
|
||||
Template.alertssummary.helpers({
|
||||
selectedalerts: function () {
|
||||
//console.log(moment().format(),Session.get('alertsSearch'));
|
||||
|
||||
Session.set('alertsDisplayed',
|
||||
alerts.find(Session.get('alertsSearch'),
|
||||
{limit: Session.get('alertsrecordlimit'),
|
||||
reactive:false}).count()
|
||||
);
|
||||
|
||||
//return just what's needed for the summary table
|
||||
return alerts.find(Session.get('alertsSearch'),
|
||||
{fields:{
|
||||
_id:1,
|
||||
esmetadata:1,
|
||||
utctimestamp:1,
|
||||
utcepoch:1,
|
||||
summary:1,
|
||||
severity:1,
|
||||
category:1,
|
||||
acknowledged:1,
|
||||
acknowledgedby:1,
|
||||
url:1
|
||||
},
|
||||
sort: {utcepoch: -1},
|
||||
limit: Session.get('alertsrecordlimit'),
|
||||
reactive:true})
|
||||
}
|
||||
});
|
||||
|
||||
Template.alertssummary.events({
|
||||
"click .reset": function(e,t){
|
||||
|
|
|
@ -13,27 +13,30 @@ if (Meteor.isClient) {
|
|||
|
||||
//elastic search cluster template functions
|
||||
//return es health items
|
||||
Template.mozdefhealth.esclusterhealthitems = function () {
|
||||
return healthescluster.find();
|
||||
};
|
||||
Template.mozdefhealth.helpers({
|
||||
|
||||
esclusterhealthitems: function () {
|
||||
return healthescluster.find();
|
||||
},
|
||||
|
||||
Template.mozdefhealth.frontendhealthitems = function () {
|
||||
return healthfrontend.find({},
|
||||
frontendhealthitems: function () {
|
||||
return healthfrontend.find({},
|
||||
{fields:{},
|
||||
sort: {hostname: 1}
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
Template.mozdefhealth.esnodeshealthitems = function () {
|
||||
return healthesnodes.find({},
|
||||
esnodeshealthitems: function () {
|
||||
return healthesnodes.find({},
|
||||
{fields:{},
|
||||
sort: {hostname: 1}
|
||||
});
|
||||
};
|
||||
},
|
||||
|
||||
Template.mozdefhealth.eshotthreadshealthitems = function () {
|
||||
return healtheshotthreads.find();
|
||||
};
|
||||
eshotthreadshealthitems: function () {
|
||||
return healtheshotthreads.find();
|
||||
}
|
||||
});
|
||||
|
||||
Template.mozdefhealth.rendered = function () {
|
||||
var ringChartEPS = dc.pieChart("#ringChart-EPS");
|
||||
|
|
Загрузка…
Ссылка в новой задаче