diff options
| author | ckonstanski <kostcarl@isu.edu> | 2026-07-30 17:56:41 -0600 |
|---|---|---|
| committer | ckonstanski <kostcarl@isu.edu> | 2026-07-30 17:56:41 -0600 |
| commit | cfb4bf6be1b18ec15cddbec1ea37e76176b1050b (patch) | |
| tree | 1bbe88bca7ea6282296a9cfb16b6e52bd16c6f38 /src/static/js/playbook_status.js | |
| parent | aeab73540c306e5f906bccc444c252d8ad2adc34 (diff) | |
initial commit
Diffstat (limited to 'src/static/js/playbook_status.js')
| -rw-r--r-- | src/static/js/playbook_status.js | 77 |
1 files changed, 77 insertions, 0 deletions
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 |
