list_firewall_ipset.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <a class="button button-secondary button-back js-button-back" href="/list/firewall/">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?>
  7. </a>
  8. <a href="/add/firewall/ipset/" class="button button-secondary js-button-create">
  9. <i class="fas fa-circle-plus icon-green"></i><?= _("Add IP list") ?>
  10. </a>
  11. </div>
  12. <div class="toolbar-right">
  13. <form x-data x-bind="BulkEdit" action="/bulk/firewall/ipset/" method="post">
  14. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  15. <select class="form-select" name="action">
  16. <option value=""><?= _("Apply to selected") ?></option>
  17. <option value="delete"><?= _("Delete") ?></option>
  18. </select>
  19. <button type="submit" class="toolbar-input-submit" title="<?= _("Apply to selected") ?>">
  20. <i class="fas fa-arrow-right"></i>
  21. </button>
  22. </form>
  23. </div>
  24. </div>
  25. </div>
  26. <!-- End toolbar -->
  27. <div class="container">
  28. <h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("IPset IP Lists") ?></h1>
  29. <div class="units-table js-units-container">
  30. <div class="units-table-header">
  31. <div class="units-table-cell">
  32. <input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>">
  33. </div>
  34. <div class="units-table-cell"><?= _("IP List Name") ?></div>
  35. <div class="units-table-cell"></div>
  36. <div class="units-table-cell u-text-center"><?= _("Auto Update") ?></div>
  37. <div class="units-table-cell u-text-center"><?= _("IP Version") ?></div>
  38. <div class="units-table-cell u-text-center"><?= _("Date") ?></div>
  39. <div class="units-table-cell u-text-center"><?= _("Time") ?></div>
  40. </div>
  41. <!-- Begin firewall IP address list item loop -->
  42. <?php
  43. foreach ($data as $key => $value) {
  44. ++$i;
  45. $listname = $key;
  46. ?>
  47. <div class="units-table-row js-unit">
  48. <div class="units-table-cell">
  49. <div>
  50. <input id="check<?= $i ?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="setname[]" value="<?= $listname ?>">
  51. <label for="check<?= $i ?>" class="u-hide-desktop"><?= _("Select") ?></label>
  52. </div>
  53. </div>
  54. <div class="units-table-cell units-table-heading-cell u-text-bold">
  55. <span class="u-hide-desktop"><?= _("IP List Name") ?>:</span>
  56. <?= $listname ?>
  57. </div>
  58. <div class="units-table-cell">
  59. <ul class="units-table-row-actions">
  60. <li class="units-table-row-action shortcut-delete" data-key-action="js">
  61. <a
  62. class="units-table-row-action-link data-controls js-confirm-action"
  63. href="/delete/firewall/ipset/?listname=<?= $listname ?>&token=<?= $_SESSION["token"] ?>"
  64. title="<?= _("Delete") ?>"
  65. data-confirm-title="<?= _("Delete") ?>"
  66. data-confirm-message="<?= sprintf(_("Are you sure you want to delete IP list %s?"), $key) ?>"
  67. >
  68. <i class="fas fa-trash icon-red"></i>
  69. <span class="u-hide-desktop"><?= _("Delete") ?></span>
  70. </a>
  71. </li>
  72. </ul>
  73. </div>
  74. <div class="units-table-cell u-text-bold u-text-center-desktop">
  75. <span class="u-hide-desktop"><?= _("Auto Update") ?>:</span>
  76. <?php if ($data[$key]["AUTOUPDATE"] == "no") { ?>
  77. <i class="fas fa-circle-xmark icon-red" title="<?= _("Disabled") ?>"></i>
  78. <?php } else { ?>
  79. <i class="fas fa-circle-check icon-green" title="<?= _("Enabled") ?>"></i>
  80. <?php } ?>
  81. </div>
  82. <div class="units-table-cell u-text-center-desktop">
  83. <span class="u-hide-desktop u-text-bold"><?= _("IP Version") ?>:</span>
  84. <?= _($data[$key]["IP_VERSION"]) ?>
  85. </div>
  86. <div class="units-table-cell u-text-center-desktop">
  87. <span class="u-hide-desktop u-text-bold"><?= _("Date") ?>:</span>
  88. <time datetime="<?= _($data[$key]["DATE"]) ?>"><?= _($data[$key]["DATE"]) ?></time>
  89. </div>
  90. <div class="units-table-cell u-text-center-desktop">
  91. <span class="u-hide-desktop u-text-bold"><?= _("Time") ?>:</span>
  92. <?= $data[$key]["TIME"] ?>
  93. </div>
  94. </div>
  95. <?php } ?>
  96. </div>
  97. </div>
  98. <footer class="app-footer">
  99. <div class="container app-footer-inner">
  100. <p>
  101. <?php
  102. if ( $i == 0) {
  103. echo _('There are currently no IP lists defined.');
  104. } else {
  105. printf(ngettext('%d IP list', '%d IP lists', $i),$i);
  106. }
  107. ?>
  108. </p>
  109. </div>
  110. </footer>