list_ip.php 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  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="/edit/server/">
  6. <i class="fas fa-arrow-left icon-blue"></i><?= tohtml( _("Back")) ?>
  7. </a>
  8. <a href="/add/ip/" class="button button-secondary js-button-create">
  9. <i class="fas fa-circle-plus icon-green"></i><?= tohtml( _("Add IP Address")) ?>
  10. </a>
  11. </div>
  12. <div class="toolbar-right">
  13. <div class="toolbar-sorting">
  14. <button class="toolbar-sorting-toggle js-toggle-sorting-menu" type="button" title="<?= tohtml( _("Sort items")) ?>">
  15. <?= tohtml( _("Sort by")) ?>:
  16. <span class="u-text-bold">
  17. <?= tohtml( _("Date")) ?> <i class="fas fa-arrow-down-a-z"></i>
  18. </span>
  19. </button>
  20. <ul class="toolbar-sorting-menu js-sorting-menu u-hidden">
  21. <li data-entity="sort-date" data-sort-as-int="1">
  22. <span class="name <?php if ($_SESSION['userSortOrder'] === 'date') { echo 'active'; } ?>"><?= tohtml( _("Date")) ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span>
  23. </li>
  24. <li data-entity="sort-ip">
  25. <span class="name"><?= tohtml( _("IP Address")) ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span>
  26. </li>
  27. <li data-entity="sort-netmask">
  28. <span class="name"><?= tohtml( _("Netmask")) ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span>
  29. </li>
  30. <li data-entity="sort-interface">
  31. <span class="name"><?= tohtml( _("Interface")) ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span>
  32. </li>
  33. <li data-entity="sort-domains" data-sort-as-int="1">
  34. <span class="name"><?= tohtml( _("Domains")) ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span>
  35. </li>
  36. <li data-entity="sort-owner">
  37. <span class="name"><?= tohtml( _("Owner")) ?> <i class="fas fa-arrow-down-a-z"></i></span><span class="up"><i class="fas fa-arrow-up-a-z"></i></span>
  38. </li>
  39. </ul>
  40. <form x-data x-bind="BulkEdit" action="/bulk/ip/" method="post">
  41. <input type="hidden" name="token" value="<?= tohtml($_SESSION["token"]) ?>">
  42. <select class="form-select" name="action">
  43. <option value=""><?= tohtml( _("Apply to selected")) ?></option>
  44. <option value="reread IP"><?= tohtml( _("Refresh IP Addresses")) ?></option>
  45. <option value="delete"><?= tohtml( _("Delete")) ?></option>
  46. </select>
  47. <button type="submit" class="toolbar-input-submit" title="<?= tohtml( _("Apply to selected")) ?>">
  48. <i class="fas fa-arrow-right"></i>
  49. </button>
  50. </form>
  51. </div>
  52. </div>
  53. </div>
  54. </div>
  55. <!-- End toolbar -->
  56. <div class="container">
  57. <h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= tohtml( _("IP Addresses")) ?></h1>
  58. <div class="units-table js-units-container">
  59. <div class="units-table-header">
  60. <div class="units-table-cell">
  61. <input type="checkbox" class="js-toggle-all-checkbox" title="<?= tohtml( _("Select all")) ?>">
  62. </div>
  63. <div class="units-table-cell"><?= tohtml( _("IP Address")) ?></div>
  64. <div class="units-table-cell"></div>
  65. <div class="units-table-cell u-text-center"><?= tohtml( _("Netmask")) ?></div>
  66. <div class="units-table-cell u-text-center"><?= tohtml( _("Interface")) ?></div>
  67. <div class="units-table-cell u-text-center"><?= tohtml( _("Status")) ?></div>
  68. <div class="units-table-cell u-text-center"><?= tohtml( _("Domains")) ?></div>
  69. <div class="units-table-cell u-text-center"><?= tohtml( _("Owner")) ?></div>
  70. </div>
  71. <!-- Begin IP address list item loop -->
  72. <?php
  73. foreach ($data as $key => $value) {
  74. ++$i;
  75. ?>
  76. <div class="units-table-row js-unit"
  77. data-sort-ip="<?= tohtml(str_replace(".", "", $key)) ?>"
  78. data-sort-date="<?= tohtml(strtotime($data[$key]["DATE"] . " " . $data[$key]["TIME"])) ?>"
  79. data-sort-netmask="<?= tohtml(str_replace(".", "", $data[$key]["NETMASK"])) ?>"
  80. data-sort-interface="<?= tohtml($data[$key]["INTERFACE"]) ?>"
  81. data-sort-domains="<?= tohtml($data[$key]["U_WEB_DOMAINS"]) ?>"
  82. data-sort-owner="<?= tohtml($data[$key]["OWNER"]) ?>">
  83. <div class="units-table-cell">
  84. <div>
  85. <input id="check<?= tohtml($i) ?>" class="js-unit-checkbox" type="checkbox" title="<?= tohtml( _("Select")) ?>" name="ip[]" value="<?= tohtml($key) ?>">
  86. <label for="check<?= tohtml($i) ?>" class="u-hide-desktop"><?= tohtml( _("Select")) ?></label>
  87. </div>
  88. </div>
  89. <div class="units-table-cell units-table-heading-cell u-text-bold">
  90. <span class="u-hide-desktop"><?= tohtml( _("IP Address")) ?>:</span>
  91. <a href="/edit/ip/?<?= tohtml(http_build_query(["ip" => $key, "token" => $_SESSION['token']])) ?>" title="<?= tohtml( _("Edit IP Address")) ?>">
  92. <?= tohtml($key) ?> <?php if (!empty($data[$key]['NAT'])) echo ' → ' . $data[$key]['NAT'] . ''; ?>
  93. </a>
  94. </div>
  95. <div class="units-table-cell">
  96. <ul class="units-table-row-actions">
  97. <li class="units-table-row-action shortcut-enter" data-key-action="href">
  98. <a
  99. class="units-table-row-action-link"
  100. href="/edit/ip/?<?= tohtml(http_build_query(["ip" => $key, "token" => $_SESSION["token"]])) ?>"
  101. title="<?= tohtml( _("Edit IP Address")) ?>"
  102. >
  103. <i class="fas fa-pencil icon-orange"></i>
  104. <span class="u-hide-desktop"><?= tohtml( _("Edit IP Address")) ?></span>
  105. </a>
  106. </li>
  107. <li class="units-table-row-action shortcut-delete" data-key-action="js">
  108. <a
  109. class="units-table-row-action-link data-controls js-confirm-action"
  110. href="/delete/ip/?<?= tohtml(http_build_query(["ip" => $key, "token" => $_SESSION["token"]])) ?>"
  111. title="<?= tohtml( _("Delete")) ?>"
  112. data-confirm-title="<?= tohtml( _("Delete")) ?>"
  113. data-confirm-message="<?= tohtml(sprintf(_("Are you sure you want to delete IP address %s?"), $key)) ?>"
  114. >
  115. <i class="fas fa-trash icon-red"></i>
  116. <span class="u-hide-desktop"><?= tohtml( _("Delete")) ?></span>
  117. </a>
  118. </li>
  119. </ul>
  120. </div>
  121. <div class="units-table-cell u-text-center-desktop">
  122. <span class="u-hide-desktop u-text-bold"><?= tohtml( _("Netmask")) ?>:</span>
  123. <?= tohtml($data[$key]["NETMASK"]) ?>
  124. </div>
  125. <div class="units-table-cell u-text-center-desktop">
  126. <span class="u-hide-desktop u-text-bold"><?= tohtml( _("Interface")) ?>:</span>
  127. <?= tohtml($data[$key]["INTERFACE"]) ?>
  128. </div>
  129. <div class="units-table-cell u-text-bold u-text-center-desktop">
  130. <span class="u-hide-desktop"><?= tohtml( _("Status")) ?>:</span>
  131. <?= tohtml( _($data[$key]["STATUS"])) ?>
  132. </div>
  133. <div class="units-table-cell u-text-bold u-text-center-desktop">
  134. <span class="u-hide-desktop"><?= tohtml( _("Domains")) ?>:</span>
  135. <?= tohtml($data[$key]["U_WEB_DOMAINS"]) ?>
  136. </div>
  137. <div class="units-table-cell u-text-bold u-text-center-desktop">
  138. <span class="u-hide-desktop"><?= tohtml( _("Owner")) ?>:</span>
  139. <?= tohtml($data[$key]["OWNER"]) ?>
  140. </div>
  141. </div>
  142. <?php } ?>
  143. </div>
  144. <div class="units-table-footer">
  145. <p>
  146. <?php printf(ngettext("%d IP address", "%d IP addresses", $i), $i); ?>
  147. </p>
  148. </div>
  149. </div>