1
13693261870
2022-09-16 58d012f11dd34564d81b4eb3a6099eb689876597
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
$('#myTabs a').click(function (e) {
    e.preventDefault()
    $(this).tab('show')
})
 
var authnEvents = (function () {
 
    var getData = function () {
        $.getJSON(urls.getEvents, function (data) {
            authnEventsTable(data);
        });
    };
 
    var authnEventsTable = function (jsonData) {
        var t = $('#authnEventsTable').DataTable({
            "order": [[2, "desc"]],
            retrieve: true,
            columnDefs: [
                {
                    "targets": 0,
                    render: function (data, type, full, meta) {
                        return '<span class="glyphicon glyphicon-flash" aria-hidden="true">&nbsp;</span>' + data;
                    }
                },
            ]
        });
        for (var i = 0; i < jsonData.length; i++) {
            var rec = jsonData[i];
            
            var type = rec.type.split(".")
            t.row.add([
                type[type.length-1],
                rec.principalId,
                new Date(rec.creationTime),
                new Date(rec.timestamp),
                rec.properties.agent,
                rec.clientIpAddress,
                rec.serverIpAddress,
                rec.properties.geoLatitude == undefined ? "" : Number(rec.properties.geoLatitude).toFixed(2),
                rec.properties.geoLongitude == undefined ? "" : Number(rec.properties.geoLongitude).toFixed(2),
                rec.properties.geoAccuracy == undefined ? "" : Number(rec.properties.geoAccuracy).toFixed(2)
            ]).draw(false);
            
        }
    };
 
    // initialization *******
    (function init() {
        getData();
    })();
})();