list_backup.php 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. <div class="units-table js-units-container">
  38. <div class="units-table-header">
  39. <div class="units-table-cell">
  40. <input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>" <?= $display_mode ?>>
  41. </div>
  42. <div class="units-table-cell"><?= _("File Name") ?></div>
  43. <div class="units-table-cell"></div>
  44. <div class="units-table-cell u-text-center"><?= _("Date") ?></div>
  45. <div class="units-table-cell u-text-center"><?= _("Size") ?></div>
  46. <div class="units-table-cell u-text-center"><?= _("Type") ?></div>
  47. <div class="units-table-cell u-text-center"><?= _("Runtime") ?></div>
  48. </div>
  49. <!-- Begin user backup list item loop -->
  50. <?php
  51. foreach ($data as $key => $value) {
  52. ++$i;
  53. $web = _('No');
  54. $dns = _('No');
  55. $mail = _('No');
  56. $db = _('No');
  57. $cron = _('No');
  58. $udir = _('No');
  59. if (!empty($data[$key]['WEB'])) $web = _('Yes');
  60. if (!empty($data[$key]['DNS'])) $dns = _('Yes');
  61. if (!empty($data[$key]['MAIL'])) $mail = _('Yes');
  62. if (!empty($data[$key]['DB'])) $db = _('Yes');
  63. if (!empty($data[$key]['CRON'])) $cron = _('Yes');
  64. if (!empty($data[$key]['UDIR'])) $udir = _('Yes');
  65. ?>
  66. <div class="units-table-row animate__animated animate__fadeIn js-unit">
  67. <div class="units-table-cell">
  68. <div>
  69. <input id="check<?= $i ?>" class="js-unit-checkbox" type="checkbox" title="<?= _("Select") ?>" name="backup[]" value="<?= $key ?>" <?= $display_mode ?>>
  70. <label for="check<?= $i ?>" class="u-hide-desktop"><?= _("Select") ?></label>
  71. </div>
  72. </div>
  73. <div class="units-table-cell u-text-bold">
  74. <span class="u-hide-desktop"><?= _("File Name") ?>:</span>
  75. <?php if ($read_only === "true") { ?>
  76. <?= $key ?>
  77. <?php } else { ?>
  78. <a href="/list/backup/?backup=<?= $key ?>&token=<?= $_SESSION["token"] ?>" title="<?= _("Restore") ?>">
  79. <?= $key ?>
  80. </a>
  81. <?php } ?>
  82. </div>
  83. <div class="units-table-cell">
  84. <?php if (!($_SESSION["userContext"] === "admin" && $_SESSION["look"] === "admin" && $read_only === "true")) { ?>
  85. <ul class="units-table-row-actions">
  86. <li class="units-table-row-action shortcut-d" data-key-action="href">
  87. <a
  88. class="units-table-row-action-link"
  89. href="/download/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>"
  90. title="<?= _("Download") ?>"
  91. >
  92. <i class="fas fa-file-arrow-down icon-lightblue"></i>
  93. <span class="u-hide-desktop"><?= _("Download") ?></span>
  94. </a>
  95. </li>
  96. <?php if ($read_only !== 'true') { ?>
  97. <li class="units-table-row-action shortcut-enter" data-key-action="href">
  98. <a
  99. class="units-table-row-action-link data-controls"
  100. href="/list/backup/?backup=<?=$key?>&token=<?=$_SESSION['token']?>"
  101. title="<?= _("Restore") ?>"
  102. >
  103. <i class="fas fa-arrow-rotate-left icon-green"></i>
  104. <span class="u-hide-desktop"><?= _("Restore") ?></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/backup/?backup=<?= $key ?>&token=<?= $_SESSION["token"] ?>"
  111. title="<?= _("Delete") ?>"
  112. data-confirm-title="<?= _("Delete") ?>"
  113. data-confirm-message="<?= sprintf(_("Are you sure you want to delete backup %s?"), $key) ?>"
  114. >
  115. <i class="fas fa-trash icon-red"></i>
  116. <span class="u-hide-desktop"><?= _("Delete") ?></span>
  117. </a>
  118. </li>
  119. <?php } ?>
  120. </ul>
  121. <?php } ?>
  122. </div>
  123. <div class="units-table-cell u-text-center-desktop">
  124. <span class="u-hide-desktop u-text-bold"><?= _("Date") ?>:</span>
  125. <span class="u-text-bold">
  126. <?= translate_date($data[$key]["DATE"]) ?>
  127. </span>
  128. </div>
  129. <div class="units-table-cell u-text-center-desktop">
  130. <span class="u-hide-desktop u-text-bold"><?= _("Size") ?>:</span>
  131. <span class="u-text-bold">
  132. <?= humanize_usage_size($data[$key]["SIZE"]) ?>
  133. </span>
  134. <span class="u-text-small">
  135. <?= humanize_usage_measure($data[$key]["SIZE"]) ?>
  136. </span>
  137. </div>
  138. <div class="units-table-cell u-text-center-desktop">
  139. <span class="u-hide-desktop u-text-bold"><?= _("Type") ?>:</span>
  140. <?= $data[$key]["TYPE"] ?>
  141. </div>
  142. <div class="units-table-cell u-text-center-desktop">
  143. <span class="u-hide-desktop u-text-bold"><?= _("Runtime") ?>:</span>
  144. <?= humanize_time($data[$key]["RUNTIME"]) ?>
  145. </div>
  146. </div>
  147. <?php } ?>
  148. </div>
  149. </div>
  150. <footer class="app-footer">
  151. <div class="container app-footer-inner">
  152. <p>
  153. <?php printf(ngettext("%d backup", "%d backups", $i), $i); ?>
  154. </p>
  155. </div>
  156. </footer>