summaryrefslogtreecommitdiff
path: root/src/dashboard/static/js/dashboard.js
blob: e171f596bad7605937bf545e83d5e661601cdefc (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
// Setup dxGrid with data from Django
function initInstallGrid(installs) {
    $("#gridContainer").dxDataGrid({
        dataSource: installs,
        showColumnLines: false,
        showRowLines: true,
        rowAlternationEnabled: true,
        columnAutoWidth: true,
        showBorders: true,
        searchPanel: {
            visible: true,
            width: 240,
            placeholder: "Search..."
        },
        groupPanel: {
            visible: true
        },
        paging: {
            pageSize: 50
        },
        pager: {
            showPageSizeSelector: true,
            allowedPageSizes: [5, 10, 20],
            showInfo: true
        },
        columns: [
            {
                dataField: "cluster__cluster_name",
                dataType: "string",
                caption: "Cluster Name"
            },
            {
                dataField: "date_completed",
                dataType: "datetime",
                format: "M/d/yyyy, HH:mm",
                caption: "Date Completed"
            },
            {
                dataField: "date_last_failed",
                dataType: "datetime",
                format: "M/d/yyyy, HH:mm",
                caption: "Date Last Failed"
            },
            {
                dataField: "date_scheduled",
                dataType: "datetime",
                format: "M/d/yyyy, HH:mm",
                caption: "Date Scheduled"
            },
            {
                dataField: "kirke_ticket_completed",
                dataType: "datetime",
                format: "M/d/yyyy, HH:mm",
                caption: "Kirke Ticket Completed"
            },
            {
                dataField: "kirke_ticket_number",
                dataType: "int",
                caption: "Kirke Ticket Number",
                cellTemplate: function (container, options) {
                    $('<a/>').addClass('dx-link')
                        .text(options.data.kirke_ticket_number)
                        .on('dxclick', function () {
                            window.open('https://kirke.verizon.com/changeRequest/' + options.data.kirke_ticket_number)
                        })
                        .appendTo(container);
                }
            },
            {
                dataField: "kirke_ticket_status",
                dataType: "string",
                caption: "Kirke Ticket Status"
            }
        ]
    });
};