list_backup.php 7.1 KB

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