80 lines
1.3 KiB
JavaScript
80 lines
1.3 KiB
JavaScript
|
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @param options
|
||
|
* @constructor
|
||
|
*/
|
||
|
SOC.Query.AlertList = function(
|
||
|
options
|
||
|
) {
|
||
|
|
||
|
if (!options) {
|
||
|
options = {};
|
||
|
}
|
||
|
|
||
|
if (!options.path) {
|
||
|
options.path = '/alerts/_search';
|
||
|
}
|
||
|
|
||
|
if (!options.query) {
|
||
|
options.query = {
|
||
|
"version": false,
|
||
|
"size": 200,
|
||
|
"sort": [
|
||
|
{
|
||
|
"priority": {
|
||
|
"order": "asc",
|
||
|
"unmapped_type": "boolean"
|
||
|
},
|
||
|
"alert_type.keyword": {
|
||
|
"order": "asc",
|
||
|
"unmapped_type": "boolean"
|
||
|
}
|
||
|
}
|
||
|
],
|
||
|
"_source": {
|
||
|
"includes": ["*"]
|
||
|
},
|
||
|
"query": {
|
||
|
"bool": {
|
||
|
"must": [
|
||
|
{
|
||
|
"range": {
|
||
|
"timestamp": {
|
||
|
"format": "strict_date_optional_time",
|
||
|
"gte": "%QUERY_START",
|
||
|
"lt": "%QUERY_END"
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
]
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|
||
|
SOC.Query.call(
|
||
|
this,
|
||
|
options
|
||
|
);
|
||
|
};
|
||
|
|
||
|
SOC.Query.AlertList.prototype = Object.create(SOC.Query.prototype);
|
||
|
SOC.Query.AlertList.prototype.constructor = SOC.Query;
|
||
|
|
||
|
SOC.Query.AlertList.prototype.draw = function(divId, data) {
|
||
|
|
||
|
google.charts.load(
|
||
|
'current',
|
||
|
{
|
||
|
'packages': ['table']
|
||
|
}
|
||
|
);
|
||
|
|
||
|
google.charts.setOnLoadCallback(
|
||
|
this.drawTable(divId, data)
|
||
|
);
|
||
|
|
||
|
};
|