80 lines
1.5 KiB
JavaScript
80 lines
1.5 KiB
JavaScript
/**
|
|
* R3.Query.Logins.VPN
|
|
* @param apiComponent
|
|
* @constructor
|
|
*/
|
|
R3.Query.Logins.VPN = function(
|
|
apiComponent
|
|
) {
|
|
|
|
__RUNTIME_COMPONENT__;
|
|
|
|
R3.Query.Logins.call(
|
|
this,
|
|
apiComponent,
|
|
true
|
|
);
|
|
|
|
};
|
|
|
|
R3.Query.Logins.VPN.prototype = Object.create(R3.Query.Logins.prototype);
|
|
R3.Query.Logins.VPN.prototype.constructor = R3.Query.Logins.VPN;
|
|
|
|
/**
|
|
* Updates the instance with the current state
|
|
*/
|
|
R3.Query.Logins.VPN.prototype.createInstance = function() {
|
|
|
|
this.instance = true;
|
|
|
|
__CREATE_INSTANCE__;
|
|
|
|
};
|
|
|
|
/**
|
|
* Updates the instance with the current state
|
|
*/
|
|
R3.Query.Logins.VPN.prototype.updateInstance = function(property) {
|
|
|
|
R3.Query.Logins.prototype.updateInstance.call(this, property);
|
|
|
|
};
|
|
|
|
R3.Query.Logins.VPN.prototype.parse = function(data) {
|
|
|
|
|
|
this.columns = [
|
|
{
|
|
type : 'string',
|
|
name : 'User'
|
|
},
|
|
{
|
|
type : 'string',
|
|
name : 'Country'
|
|
},
|
|
{
|
|
type : 'string',
|
|
name : 'City'
|
|
},
|
|
{
|
|
type : 'datetime',
|
|
name : 'Time'
|
|
}
|
|
];
|
|
|
|
this.rows = data.hits.hits.reduce(
|
|
function(result, hit) {
|
|
var row = [
|
|
hit._source.username,
|
|
hit._source.source_geo.country,
|
|
hit._source.source_geo.city,
|
|
new Date(hit._source.timestamp)
|
|
];
|
|
result.push(row);
|
|
return result;
|
|
},
|
|
[]
|
|
);
|
|
|
|
};
|