diff options
| author | ckonstanski <kostcarl@isu.edu> | 2026-07-30 18:17:14 -0600 |
|---|---|---|
| committer | ckonstanski <kostcarl@isu.edu> | 2026-07-30 18:17:14 -0600 |
| commit | 640ff61422bc0ee3966941b93d9889ddbbd38d77 (patch) | |
| tree | abf1c08f5d38ee53ec8b29dc4f425722517505e6 /src/dashboard/static/js | |
| parent | 22dae02a86c1fce71091bfa5289cf99abba1b217 (diff) | |
Diffstat (limited to 'src/dashboard/static/js')
| -rw-r--r-- | src/dashboard/static/js/dashboard.js | 76 | ||||
| -rw-r--r-- | src/dashboard/static/js/firmware_version.js | 60 | ||||
| -rw-r--r-- | src/dashboard/static/js/orchestration_workflow.js | 55 | ||||
| -rw-r--r-- | src/dashboard/static/js/playbook_status.js | 75 | ||||
| -rw-r--r-- | src/dashboard/static/js/utils.js | 14 | ||||
| -rw-r--r-- | src/dashboard/static/js/workflow_status.js | 55 |
6 files changed, 335 insertions, 0 deletions
diff --git a/src/dashboard/static/js/dashboard.js b/src/dashboard/static/js/dashboard.js new file mode 100644 index 0000000..e171f59 --- /dev/null +++ b/src/dashboard/static/js/dashboard.js @@ -0,0 +1,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" + } + ] + }); +};
\ No newline at end of file diff --git a/src/dashboard/static/js/firmware_version.js b/src/dashboard/static/js/firmware_version.js new file mode 100644 index 0000000..e050f57 --- /dev/null +++ b/src/dashboard/static/js/firmware_version.js @@ -0,0 +1,60 @@ +// Setup dxGrid with data from Django +function FirmwareVersionGrid(firmware_versions) { + $("#FirmwareGridContainer").dxDataGrid({ + dataSource: firmware_versions, + 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: "id", + dataType: "integer", + caption: "Server ID" + }, + { + dataField: "oam_hostname", + dataType: "string", + caption: "OAM Hostname" + }, + { + dataField: "ilo_host_address", + dataType: "string", + caption: "ilo Host Address" + }, + { + dataField: "intel_nic_firmware_version", + dataType: "string", + caption: "Firmware Version" + }, + { + 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: "Last failed on" + } + ] + }); +};
\ No newline at end of file diff --git a/src/dashboard/static/js/orchestration_workflow.js b/src/dashboard/static/js/orchestration_workflow.js new file mode 100644 index 0000000..b432cb9 --- /dev/null +++ b/src/dashboard/static/js/orchestration_workflow.js @@ -0,0 +1,55 @@ +// Setup dxGrid with data from Django +function OrchestrationGrid(workflows) { + console.log(workflows) + $("#WorkflowGridContainer").dxDataGrid({ + dataSource: workflows, + 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: "pk", + dataType: "integer", + caption: "Cluster" + }, + { + dataField: "fields.online", + dataType: "string", + caption: "Online" + }, + { + dataField: "fields.bmc", + dataType: "boolean", + caption: "BMC" + }, + { + dataField: "fields.wr_installed", + dataType: "boolean", + caption: "WR installed" + }, + { + dataField: "fields.created_at", + dataType: "datetime", + format: "M/d/yyyy, HH:mm", + caption: "Date Updated" + } + ] + }); +};
\ No newline at end of file diff --git a/src/dashboard/static/js/playbook_status.js b/src/dashboard/static/js/playbook_status.js new file mode 100644 index 0000000..9f4d051 --- /dev/null +++ b/src/dashboard/static/js/playbook_status.js @@ -0,0 +1,75 @@ +// Setup dxGrid with data from Django +function PlaybookStatusGrid(query_result) { + $("#PlaybookGridContainer").dxDataGrid({ + dataSource: query_result, + 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: "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 diff --git a/src/dashboard/static/js/utils.js b/src/dashboard/static/js/utils.js new file mode 100644 index 0000000..a5ef815 --- /dev/null +++ b/src/dashboard/static/js/utils.js @@ -0,0 +1,14 @@ +function set_navbar_focus(selected_tab){ + console.log("in set_navbar_focus") + console.log(selected_tab) + var nav = document.getElementById("nav"); + var nav_tabs = nav.childNodes; + + for (var i = 0; i < nav_tabs.length; i++) { + if (nav_tabs[i].id == selected_tab) { + nav_tabs[i].classList.add("active"); + } else { + nav_tabs[i].classList.remove("active"); + } + } +}
\ No newline at end of file diff --git a/src/dashboard/static/js/workflow_status.js b/src/dashboard/static/js/workflow_status.js new file mode 100644 index 0000000..b2224ee --- /dev/null +++ b/src/dashboard/static/js/workflow_status.js @@ -0,0 +1,55 @@ +// Setup dxGrid with data from Django +function WorkflowGrid(workflows) { + console.log(workflows) + $("#WorkflowGridContainer").dxDataGrid({ + dataSource: workflows, + 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: "pk", + dataType: "integer", + caption: "Cluster" + }, + { + dataField: "fields.online", + dataType: "string", + caption: "Online" + }, + { + dataField: "fields.bmc", + dataType: "boolean", + caption: "BMC" + }, + { + dataField: "fields.wr_installed", + dataType: "boolean", + caption: "WR installed" + }, + { + dataField: "fields.created_at", + dataType: "datetime", + format: "M/d/yyyy, HH:mm", + caption: "Date Updated" + } + ] + }); +};
\ No newline at end of file |
