list_backup.php 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <?php if ($read_only !== "true") { ?>
  6. <a href="/schedule/backup/?token=<?= $_SESSION["token"] ?>" class="button button-secondary"><i class="fas fa-circle-plus icon-green"></i><?= _("Create Backup") ?></a>
  7. <a href="/list/backup/exclusions/" class="button button-secondary"><i class="fas fa-folder-minus icon-orange"></i><?= _("Backup Exclusions") ?></a>
  8. <?php } ?>
  9. </div>
  10. <div class="toolbar-right">
  11. <?php if ($read_only !== "true") { ?>
  12. <form x-data x-bind="BulkEdit" action="/bulk/backup/" method="post">
  13. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  14. <select class="form-select" name="action">
  15. <option value=""><?= _("Apply to selected") ?></option>
  16. <option value="delete"><?= _("Delete") ?></option>
  17. </select>
  18. <button type="submit" class="toolbar-input-submit" title="<?= _("Apply to selected") ?>">
  19. <i class="fas fa-arrow-right"></i>
  20. </button>
  21. </form>
  22. <?php } ?>
  23. <div class="toolbar-search">
  24. <form action="/search/" method="get">
  25. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  26. <input type="search" class="form-control js-search-input" name="q" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?= _("Search") ?>">
  27. <button type="submit" class="toolbar-input-submit" title="<?= _("Search") ?>">
  28. <i class="fas fa-magnifying-glass"></i>
  29. </button>
  30. </form>
  31. </div>
  32. </div>
  33. </div>
  34. </div>
  35. <!-- End toolbar -->
  36. <div class="container">
  37. <h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Backups") ?></h1>
  38. <div class="units-table js-units-container">
  39. <div class="units-table-header">
  40. <div class="units-table-cell">
  41. <input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>" <?= $display_mode ?>>
  42. </div>
  43. <div class="units-table-cell"><?= _("File Name") ?></div>
  44. <div class="units-table-cell"></div>
  45. <div class="units-table-cell u-text-center"><?= _("Date") ?></div>
  46. <div class="units-table-cell u-text-center"><?= _("Size") ?></div>
  47. <div class="units-table-cell u-text-center"><?= _("Type") ?></div>
  48. <div class="units-table-cell u-text-center"><?= _("Runtime") ?></div>
  49. </div>
  50. <!-- Begin user backup list item loop -->
  51. <?php
  52. foreach ($data as $key => $value) {
  53. ++$i;
  54. $web = _('No');
  55. $dns = _('No');
  56. $mail = _('No');
  57. $db = _('No');
  58. $cron = _('No');
  59. $udir = _('No');
  60. if (!empty($data[$key]['WEB'])) $web = _('Yes');
  61. if (!empty($data[$key]['DNS'])) $dns = _('Yes');
  62. if (!empty($data[$key]['MAIL'])) $mail = _('Yes');
  63. if (!empty($data[$key]['DB'])) $db = _('Yes');
  64. if (!empty($data[$key]['CRON'])) $cron = _('Yes');
  65. if (!empty($data[$key]['UDIR'])) $udir = _('Yes');
  66. ?>
  67. <div class="units-table-row animate__animated animate__fadeIn js-unit">
  68. <div class="units-table-cell">
  69. <div>
  70. <input id="check<?= $i ?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="backup[]" value="<?= $key ?>" <?= $display_mode ?>>
  71. <label for="check<?= $i ?>" class="u-hide-desktop"><?= _("Select") ?></label>
  72. </div>
  73. </div>
  74. <div class="units-table-cell units-table-heading-cell u-text-bold">
  75. <span class="u-hide-desktop"><?= _("File Name") ?>:</span>
  76. <?php if ($read_only === "true") { ?>
  77. <?= $key ?>
  78. <?php } else { ?>
  79. <a href="/list/backup/?backup=<?= $key ?>&token=<?= $_SESSION["token"] ?>" title="<?= _("Restore") ?>">
  80. <?= $key ?>
  81. </a>
  82. <?php } ?>
  83. </div>
  84. <div class="units-table-cell">
  85. <?php if (!($_SESSION["userContext"] === "admin" && $_SESSION["look"] === "admin" && $read_only === "true")) { ?>
  86. <ul class="units-table-row-actions">
  87. <li class="units-table-row-action shortcut-d" data-key-action="href">
  88. <a
  89. class="units-table-row-action-link"
  90. href="/download/backup/?backup=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
  91. title="<?= _("Download") ?>"
  92. >
  93. <i class="fas fa-file-arrow-down icon-lightblue"></i>
  94. <span class="u-hide-desktop"><?= _("Download") ?></span>
  95. </a>
  96. </li>
  97. <?php if ($read_only !== "true") { ?>
  98. <li class="units-table-row-action shortcut-enter" data-key-action="href">
  99. <a
  100. class="units-table-row-action-link data-controls"
  101. href="/list/backup/?backup=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
  102. title="<?= _("Restore") ?>"
  103. >
  104. <i class="fas fa-arrow-rotate-left icon-green"></i>
  105. <span class="u-hide-desktop"><?= _("Restore") ?></span>
  106. </a>
  107. </li>
  108. <li class="units-table-row-action shortcut-delete" data-key-action="js">
  109. <a
  110. class="units-table-row-action-link data-controls js-confirm-action"
  111. href="/delete/backup/?backup=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
  112. title="<?= _("Delete") ?>"
  113. data-confirm-title="<?= _("Delete") ?>"
  114. data-confirm-message="<?= sprintf(_("Are you sure you want to delete backup %s?"), $key) ?>"
  115. >
  116. <i class="fas fa-trash icon-red"></i>
  117. <span class="u-hide-desktop"><?= _("Delete") ?></span>
  118. </a>
  119. </li>
  120. <?php } ?>
  121. </ul>
  122. <?php } ?>
  123. </div>
  124. <div class="units-table-cell u-text-center-desktop">
  125. <span class="u-hide-desktop u-text-bold"><?= _("Date") ?>:</span>
  126. <span class="u-text-bold">
  127. <?= translate_date($data[$key]["DATE"]) ?>
  128. </span>
  129. </div>
  130. <div class="units-table-cell u-text-center-desktop">
  131. <span class="u-hide-desktop u-text-bold"><?= _("Size") ?>:</span>
  132. <span class="u-text-bold">
  133. <?= humanize_usage_size($data[$key]["SIZE"]) ?>
  134. </span>
  135. <span class="u-text-small">
  136. <?= humanize_usage_measure($data[$key]["SIZE"]) ?>
  137. </span>
  138. </div>
  139. <div class="units-table-cell u-text-center-desktop">
  140. <span class="u-hide-desktop u-text-bold"><?= _("Type") ?>:</span>
  141. <?= $data[$key]["TYPE"] ?>
  142. </div>
  143. <div class="units-table-cell u-text-center-desktop">
  144. <span class="u-hide-desktop u-text-bold"><?= _("Runtime") ?>:</span>
  145. <?= humanize_time($data[$key]["RUNTIME"]) ?>
  146. </div>
  147. </div>
  148. <?php } ?>
  149. </div>
  150. </div>
  151. <footer class="app-footer">
  152. <div class="container app-footer-inner">
  153. <p>
  154. <?php printf(ngettext("%d backup", "%d backups", $i), $i); ?>
  155. </p>
  156. </div>
  157. </footer>