summaryrefslogtreecommitdiff
path: root/src/static/js/dashboard.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js/dashboard.js')
-rw-r--r--src/static/js/dashboard.js77
1 files changed, 77 insertions, 0 deletions
diff --git a/src/static/js/dashboard.js b/src/static/js/dashboard.js
new file mode 100644
index 0000000..e266bd3
--- /dev/null
+++ b/src/static/js/dashboard.js
@@ -0,0 +1,77 @@
+
+// Setup dxGrid with data from Django
+function initInstallGrid(installs) {
+ $("#gridContainer").dxDataGrid({
+ dataSource: installs,
+ showColumnLines: false,
+ showRowLines: true,
+ rowAlternationEnabled: true,
+ columnsAutoWidth: true,
+ showBorders: true,
+ searchPanel: {
+ visible: true,
+ width: 240,
+ placeholder: "Search..."
+ },
+ groupPanel: {
+ visible: true
+ },
+ paging: {
+ pageSize: 10
+ },
+ 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"
+ }
+ ]
+ });
+}; \ No newline at end of file