mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
Refactor datatable filtering options in web UI
This commit is contained in:
parent
98c4aafa14
commit
756af7becb
6 changed files with 39 additions and 29 deletions
|
|
@ -307,55 +307,60 @@ $(document).ready(function () {
|
|||
show: true,
|
||||
options: [
|
||||
{
|
||||
label: "HTTP",
|
||||
label: '<i class="bx bx-xs bx-window-alt"></i> HTTP',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / HTTP$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "SERVER_HTTP",
|
||||
label: '<i class="bx bx-xs bx-window-alt"></i> SERVER_HTTP',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / SERVER_HTTP$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "DEFAULT_SERVER_HTTP",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-window-alt"></i> DEFAULT_SERVER_HTTP',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / DEFAULT_SERVER_HTTP$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "MODSEC_CRS",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-shield-quarter"></i> MODSEC_CRS',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / MODSEC_CRS$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "MODSEC",
|
||||
label: '<i class="bx bx-xs bx-shield-alt-2"></i> MODSEC',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / MODSEC$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "STREAM",
|
||||
label: '<i class="bx bx-xs bx-network-chart"></i> STREAM',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / STREAM$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "SERVER_STREAM",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-network-chart"></i> SERVER_STREAM',
|
||||
value: function (rowData, rowIdx) {
|
||||
return / SERVER_STREAM$/.test(rowData[2].trim());
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "CRS_PLUGINS_BEFORE",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-shield-alt"></i> CRS_PLUGINS_BEFORE',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[2].includes("BEFORE");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "CRS_PLUGINS_AFTER",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-shield-alt"></i> CRS_PLUGINS_AFTER',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[2].includes("AFTER");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -405,19 +405,22 @@ $(document).ready(function () {
|
|||
show: true,
|
||||
options: [
|
||||
{
|
||||
label: "Up",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-up-arrow-alt text-success"></i> Up',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[4].includes("Up");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Down",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-down-arrow-alt text-danger"></i> Down',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[4].includes("Down");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Loading",
|
||||
label:
|
||||
'<i class="bx bx-xs bxs-hourglass text-warning"></i> Loading',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[4].includes("Loading");
|
||||
},
|
||||
|
|
@ -433,19 +436,19 @@ $(document).ready(function () {
|
|||
show: true,
|
||||
options: [
|
||||
{
|
||||
label: "Static",
|
||||
label: '<i class="bx bx-xs bx-microchip"></i> Static',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("Static");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Container",
|
||||
label: '<i class="bx bx-xs bxl-docker"></i> Container',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("Container");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Pod",
|
||||
label: '<i class="bx bx-xs bxl-kubernetes"></i> Pod',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("Pod");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -239,13 +239,13 @@ $(document).ready(function () {
|
|||
header: "Reload",
|
||||
options: [
|
||||
{
|
||||
label: '<i class="bx bx-sm bx-x text-danger"></i> No',
|
||||
label: '<i class="bx bx-xs bx-x text-danger"></i> No',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[4].includes("bx-x");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: '<i class="bx bx-sm bx-check text-success"></i> Yes',
|
||||
label: '<i class="bx bx-xs bx-check text-success"></i> Yes',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[4].includes("bx-check");
|
||||
},
|
||||
|
|
@ -262,14 +262,14 @@ $(document).ready(function () {
|
|||
header: "Last run state",
|
||||
options: [
|
||||
{
|
||||
label: '<i class="bx bx-sm bx-x text-danger"></i> Failed',
|
||||
label: '<i class="bx bx-xs bx-x text-danger"></i> Failed',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("bx-x");
|
||||
},
|
||||
},
|
||||
{
|
||||
label:
|
||||
'<i class="bx bx-sm bx-check text-success"></i> Success',
|
||||
'<i class="bx bx-xs bx-check text-success"></i> Success',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("bx-check");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -337,19 +337,20 @@ $(document).ready(function () {
|
|||
header: "Stream Support",
|
||||
options: [
|
||||
{
|
||||
label: "No",
|
||||
label: '<i class="bx bx-xs bx-x text-danger"></i> No',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("bx-x");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Yes",
|
||||
label: '<i class="bx bx-xs bx-check text-success"></i> Yes',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("bx-check");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Partial",
|
||||
label:
|
||||
'<i class="bx bx-xs bx-minus text-warning"></i> Partial',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[5].includes("bx-minus");
|
||||
},
|
||||
|
|
@ -365,25 +366,26 @@ $(document).ready(function () {
|
|||
show: true,
|
||||
options: [
|
||||
{
|
||||
label: "PRO",
|
||||
label:
|
||||
'<img src="/admin/img/diamond.svg" alt="Pro plugin" width="16px" height="12.9125px" class="mb-1"> PRO',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[6].includes("PRO");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "External",
|
||||
label: '<i class="bx bx-plug bx-xs"></i> External',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[6].includes("EXTERNAL");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "UI",
|
||||
label: '<i class="bx bx-cloud-upload bx-xs"></i> UI',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[6].includes("UI");
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Core",
|
||||
label: '<i class="bx bx-shield bx-xs"></i> Core',
|
||||
value: function (rowData, rowIdx) {
|
||||
return rowData[6].includes("CORE");
|
||||
},
|
||||
|
|
|
|||
|
|
@ -298,11 +298,11 @@ $(function () {
|
|||
show: true,
|
||||
options: [
|
||||
{
|
||||
label: "Online",
|
||||
label: '<i class="bx bx-xs bx-globe"></i> Online',
|
||||
value: (rowData) => rowData[2].includes("Online"),
|
||||
},
|
||||
{
|
||||
label: "Draft",
|
||||
label: '<i class="bx bx-xs bx-file-blank"></i> Draft',
|
||||
value: (rowData) => rowData[2].includes("Draft"),
|
||||
},
|
||||
],
|
||||
|
|
|
|||
|
|
@ -168,7 +168,7 @@
|
|||
<div id="selected-services-convert" class="mb-3"></div>
|
||||
</div>
|
||||
<div class="modal-footer justify-content-center">
|
||||
<button type="submit" class="btn btn-outline-success me-2">Convert services</button>
|
||||
<button type="submit" class="btn btn-outline-primary me-2">Convert services</button>
|
||||
<button type="reset"
|
||||
class="btn btn-outline-secondary"
|
||||
data-bs-dismiss="modal">Cancel</button>
|
||||
|
|
|
|||
Loading…
Reference in a new issue