summaryrefslogtreecommitdiff
path: root/src/static/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/static/js')
-rw-r--r--src/static/js/dashboard.js77
-rw-r--r--src/static/js/playbook_status.js77
2 files changed, 154 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
diff --git a/src/static/js/playbook_status.js b/src/static/js/playbook_status.js
new file mode 100644
index 0000000..3816dce
--- /dev/null
+++ b/src/static/js/playbook_status.js
@@ -0,0 +1,77 @@
+// Setup dxGrid with data from Django
+function PlaybookStatusGrid(query_result) {
+ console.log("in here");
+ console.log(query_result);
+ $("#PlaybookGridContainer").dxDataGrid({
+ dataSource: query_result,
+ 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: "fields.fuze_spm_site_name",
+ dataType: "string",
+ caption: "Fuze Site Name"
+ },
+ {
+ dataField: "fields.fuze_spm_site_id",
+ dataType: "datetime",
+ caption: "Fuze Site Id"
+ },
+ {
+ dataField: "fields.cluster_name",
+ dataType: "datetime",
+ caption: "Cluster Name",
+ cellTemplate: function(container, options) {
+ $('<a/>').addClass('dx-link')
+ .text(options.data.fields.cluster_name)
+ .on('dxclick', function() {
+ window.open('/dashboard/cluster/' + options.data.fields.cluster_name)
+ })
+ .appendTo(container);
+ }
+ },
+ {
+ dataField: "fields.playbook_name",
+ dataType: "datetime",
+ caption: "Playbook",
+ cellTemplate: function(container, options) {
+ $('<a/>').addClass('dx-link')
+ .text(options.data.fields.playbook_name)
+ .on('dxclick', function() {
+ window.open('/dashboard/playbook/' + options.data.fields.playbook_name)
+ })
+ .appendTo(container);
+ }
+ },
+ {
+ dataField: "fields.status",
+ dataType: "datetime",
+ caption: "Status"
+ },
+ {
+ dataField: "fields.created_at",
+ dataType: "datetime",
+ format: "M/d/yyyy, HH:mm",
+ caption: "Update at"
+ }
+ ]
+ });
+}; \ No newline at end of file