diff --git a/cp/resources/views/partials/js-contacts.twig b/cp/resources/views/partials/js-contacts.twig index 171ca93..28074a9 100644 --- a/cp/resources/views/partials/js-contacts.twig +++ b/cp/resources/views/partials/js-contacts.twig @@ -44,20 +44,36 @@ ajaxResponse:function(url, params, response){ return response.records; }, - layout:"fitColumns", - responsiveLayout: "hide", + layout:"fitDataFill", + responsiveLayout: "collapse", + responsiveLayoutCollapseStartOpen:false, + resizableColumns:false, columns:[ - {title:"Identifier", field:"identifier", headerSort:true, formatter: contactLinkFormatter}, - {title:"Email", field:"email", headerSort:true, responsive:0}, - {title:"Phone", field:"voice", headerSort:true, responsive:0}, - {title:"Status", field:"contact_status", formatter: statusFormatter, headerSort:false, download:false}, - {title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", cellClick:function(e, cell){ e.stopPropagation(); }}, + {formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false, responsive:0}, + {title:"Identifier", field:"identifier", width:200, headerSort:true, formatter: contactLinkFormatter, responsive:0}, + {title:"Email", field:"email", width:300, minWidth:200, headerSort:true, responsive:2}, + {title:"Phone", field:"voice", width:300, minWidth:200, headerSort:true, responsive:2}, + {title:"Status", field:"contact_status", width:300, minWidth:200, formatter: statusFormatter, headerSort:false, download:false, responsive:2}, + {title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick:function(e, cell){ e.stopPropagation(); }}, ], }); var searchInput = document.getElementById("search-input"); - searchInput.addEventListener("input", function(){ - table.setFilter("identifier", "like", searchInput.value); - }); + searchInput.addEventListener("input", function () { + var term = searchInput.value.toLowerCase(); + + if (term) { // Only apply filter when there's a term to search for + table.setFilter(function (data) { + return ( + String(data.identifier).toLowerCase().includes(term) || + String(data.email).toLowerCase().includes(term) || + String(data.voice).toLowerCase().includes(term) || + String(data.contact_status).toLowerCase().includes(term) + ); + }); + } else { + table.clearFilter(); // Clear the filter when the search box is emptied + } + }); }); function updateRecord(id) { diff --git a/cp/resources/views/partials/js-dash.twig b/cp/resources/views/partials/js-dash.twig index 26ed1c6..49e6cb3 100644 --- a/cp/resources/views/partials/js-dash.twig +++ b/cp/resources/views/partials/js-dash.twig @@ -1,595 +1 @@ - - - - - - - - - - - - - - - - - - - + \ No newline at end of file diff --git a/cp/resources/views/partials/js-domains.twig b/cp/resources/views/partials/js-domains.twig index f8782bd..e19f9af 100644 --- a/cp/resources/views/partials/js-domains.twig +++ b/cp/resources/views/partials/js-domains.twig @@ -48,22 +48,36 @@ ajaxResponse:function(url, params, response){ return response.records; }, - layout:"fitColumns", - responsiveLayout: "hide", + layout:"fitDataFill", + responsiveLayout: "collapse", + responsiveLayoutCollapseStartOpen:false, + resizableColumns:false, columns:[ - {title:"Name", field:"name", headerSort:true, formatter: domainLinkFormatter}, - {title:"Registrant", field:"registrant.identifier", headerSort:true, responsive:0}, - {title:"Creation Date", field:"crdate", headerSort:true, responsive:0}, - {title:"Expiration Date", field:"exdate", headerSort:true}, - {title:"Status", field:"domain_status", formatter: statusFormatter, headerSort:false, download:false}, - {title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", cellClick:function(e, cell){ e.stopPropagation(); }}, + {formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false, responsive:0}, + {title:"Name", field:"name", width:150, headerSort:true, formatter: domainLinkFormatter, responsive:0}, + {title:"Registrant", width:200, field:"registrant.identifier", headerSort:true, responsive:2}, + {title:"Creation Date", width:250, field:"crdate", headerSort:true, responsive:2}, + {title:"Expiration Date", width:250, field:"exdate", headerSort:true, responsive:2}, + {title:"Status", width:200, field:"domain_status", formatter: statusFormatter, headerSort:false, download:false, responsive:2}, + {title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick:function(e, cell){ e.stopPropagation(); }}, ], }); var searchInput = document.getElementById("search-input"); - searchInput.addEventListener("input", function(){ - table.setFilter("name", "like", searchInput.value); + searchInput.addEventListener("input", function () { + var term = searchInput.value; + + table.setFilter(function (data) { + // Convert data fields to strings and check if they include the term + return ( + String(data.name).toLowerCase().includes(term.toLowerCase()) || + String(data['registrant.identifier']).toLowerCase().includes(term.toLowerCase()) || + String(data.crdate).toLowerCase().includes(term.toLowerCase()) || + String(data.exdate).toLowerCase().includes(term.toLowerCase()) || + String(data.domain_status).toLowerCase().includes(term.toLowerCase()) + ); }); }); + }); function updateRecord(id) { console.log("Updating record with ID: " + id); diff --git a/cp/resources/views/partials/js-hosts.twig b/cp/resources/views/partials/js-hosts.twig index 0bb52c9..b27cbef 100644 --- a/cp/resources/views/partials/js-hosts.twig +++ b/cp/resources/views/partials/js-hosts.twig @@ -44,19 +44,34 @@ ajaxResponse:function(url, params, response){ return response.records; }, - layout:"fitColumns", - responsiveLayout: "hide", + layout:"fitDataFill", + responsiveLayout: "collapse", + responsiveLayoutCollapseStartOpen:false, + resizableColumns:false, columns:[ - {title:"Name", field:"name", headerSort:true, formatter: hostLinkFormatter}, - {title:"Creation Date", field:"crdate", headerSort:true, responsive:0}, - {title:"Status", field:"host_status", formatter: statusFormatter, headerSort:false, download:false}, - {title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", cellClick:function(e, cell){ e.stopPropagation(); }}, + {formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false, responsive:0}, + {title:"Name", field:"name", width:200, headerSort:true, formatter: hostLinkFormatter, responsive:0}, + {title:"Creation Date", field:"crdate", width:300, minWidth:200, headerSort:true, responsive:2}, + {title:"Status", field:"host_status", width:300, minWidth:200, formatter: statusFormatter, headerSort:false, download:false, responsive:2}, + {title: "Actions", formatter: actionsFormatter, headerSort: false, download:false, hozAlign: "center", responsive:0, cellClick:function(e, cell){ e.stopPropagation(); }}, ], }); var searchInput = document.getElementById("search-input"); - searchInput.addEventListener("input", function(){ - table.setFilter("identifier", "like", searchInput.value); - }); + searchInput.addEventListener("input", function () { + var term = searchInput.value.toLowerCase(); + + if (term) { // Only apply filter when there's a term to search for + table.setFilter(function (data) { + return ( + String(data.name).toLowerCase().includes(term) || + String(data.crdate).toLowerCase().includes(term) || + String(data.host_status).toLowerCase().includes(term) + ); + }); + } else { + table.clearFilter(); // Clear the filter when the search box is emptied + } + }); }); function updateRecord(id) { diff --git a/cp/resources/views/partials/js-logs.twig b/cp/resources/views/partials/js-logs.twig index 4a369e9..b06213f 100644 --- a/cp/resources/views/partials/js-logs.twig +++ b/cp/resources/views/partials/js-logs.twig @@ -15,27 +15,49 @@ ajaxResponse:function(url, params, response){ return response.records; }, - layout:"fitColumns", - responsiveLayout: "hide", + layout:"fitDataFill", + responsiveLayout: "collapse", + responsiveLayoutCollapseStartOpen:false, + resizableColumns:false, initialSort:[ {column:"cldate", dir:"desc"}, // sorting by the "cldate" field in descending order ], columns:[ - {title:"Date", field:"cldate", headerSort:true}, - {title:"Registrar", field:"registrar_id", headerSort:true}, + {formatter:"responsiveCollapse", width:30, minWidth:30, hozAlign:"center", resizable:false, headerSort:false, responsive:0}, + {title:"Date", field:"cldate", headerSort:true, responsive:0}, + {title:"Registrar", field:"registrar_id", headerSort:true, responsive:2}, {title:"Command", field:"cmd", headerSort:true, responsive:0}, {title:"Object Type", field:"obj_type", headerSort:true, responsive:0}, - {title:"Object", field:"obj_id", headerSort:true, responsive:0}, - {title:"Result", field:"code", headerSort:true}, - {title:"Message", field:"msg", headerSort:true, responsive:0, download:false}, - {title:"clTRID", field:"clTRID", headerSort:true, responsive:0, download:false}, - {title:"Milliseconds", field:"svmicrosecond", headerSort:false, download:false}, + {title:"Object", field:"obj_id", headerSort:true, responsive:2}, + {title:"Result", field:"code", headerSort:true, responsive:2}, + {title:"Message", field:"msg", headerSort:true, responsive:2, download:false}, + {title:"clTRID", field:"clTRID", headerSort:true, responsive:2, download:false}, + {title:"Milliseconds", field:"svmicrosecond", headerSort:false, download:false, responsive:2}, ], }); var searchInput = document.getElementById("search-input"); - searchInput.addEventListener("input", function(){ - table.setFilter("cmd", "like", searchInput.value); - }); + searchInput.addEventListener("input", function () { + var term = searchInput.value.toLowerCase(); + + if (term) { // Only apply the filter when there's a term to search for + table.setFilter(function (data) { + // Check if any of the fields contain the search term + return ( + String(data.cldate).toLowerCase().includes(term) || + String(data.registrar_id).toLowerCase().includes(term) || + String(data.cmd).toLowerCase().includes(term) || + String(data.obj_type).toLowerCase().includes(term) || + String(data.obj_id).toLowerCase().includes(term) || + String(data.code).toLowerCase().includes(term) || + String(data.msg).toLowerCase().includes(term) || + String(data.clTRID).toLowerCase().includes(term) || + String(data.svmicrosecond).toLowerCase().includes(term) + ); + }); + } else { + table.clearFilter(); // Clear the filter when the search box is emptied + } + }); }); function downloadCSV() { diff --git a/cp/resources/views/partials/js-overview.twig b/cp/resources/views/partials/js-overview.twig index 17ab94c..52967b5 100644 --- a/cp/resources/views/partials/js-overview.twig +++ b/cp/resources/views/partials/js-overview.twig @@ -6,30 +6,48 @@