list_files_incremental.php 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. <!-- Begin toolbar -->
  2. <div class="toolbar">
  3. <div class="toolbar-inner">
  4. <div class="toolbar-buttons">
  5. <?php if ($read_only !== "true") { ?>
  6. <?php if(str_starts_with($files[0]['path'],'/home/'.$user_plain) && $files[0]['path'] != '/home/'.$user_plain ){
  7. ?>
  8. <a class="button button-secondary" id="btn-back" href="/list/backup/incremental/?snapshot=<?= htmlentities($_GET["snapshot"]) ?>&browse=yes&folder=<?=htmlentities($files[0]['path'])?>/../&token=<?=$_SESSION["token"]?>"><i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?></a>
  9. <?php }else{
  10. ?>
  11. <a class="button button-secondary" id="btn-back" href="/list/backup/incremental/?token=<?=$_SESSION["token"]?>"><i class="fas fa-arrow-left icon-blue"></i><?= _("Back") ?></a>
  12. <?php
  13. }
  14. ?>
  15. <?php } ?>
  16. </div>
  17. <div class="toolbar-right">
  18. <?php if ($read_only !== "true") { ?>
  19. <form x-data x-bind="BulkEdit" action="/bulk/restore/" method="post">
  20. <input type="hidden" name="backup" value="<?=htmlentities($_GET["snapshot"]);?>"
  21. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  22. <select class="form-select" name="action">
  23. <option value=""><?= _("Apply to selected") ?></option>
  24. <option value="delete"><?= _("Restore Files") ?></option>
  25. </select>
  26. <button type="submit" class="toolbar-input-submit" title="<?= _("Apply to selected") ?>">
  27. <i class="fas fa-arrow-right"></i>
  28. </button>
  29. </form>
  30. <?php } ?>
  31. <div class="toolbar-search">
  32. <form action="/search/" method="get">
  33. <input type="hidden" name="token" value="<?= $_SESSION["token"] ?>">
  34. <input type="search" class="form-control js-search-input" name="q" value="<? echo isset($_POST['q']) ? htmlspecialchars($_POST['q']) : '' ?>" title="<?= _("Search") ?>">
  35. <button type="submit" class="toolbar-input-submit" title="<?= _("Search") ?>">
  36. <i class="fas fa-magnifying-glass"></i>
  37. </button>
  38. </form>
  39. </div>
  40. </div>
  41. </div>
  42. </div>
  43. <!-- End toolbar -->
  44. <div class="container">
  45. <h1 class="u-text-center u-hide-desktop u-mt20 u-pr30 u-mb20 u-pl30"><?= _("Files") ?></h1>
  46. <div class="units-table js-units-container">
  47. <div class="units-table-header">
  48. <div class="units-table-cell">
  49. <input type="checkbox" class="js-toggle-all-checkbox" title="<?= _("Select all") ?>" <?= $display_mode ?>>
  50. </div>
  51. <div class="units-table-cell"><?= _("Name") ?></div>
  52. <div class="units-table-cell"></div>
  53. <div class="units-table-cell u-text-center"><?= _("Type") ?></div>
  54. <div class="units-table-cell u-text-center"><?= _("Date") ?></div>
  55. </div>
  56. <?php
  57. foreach($files as $file){
  58. if($file['path'] != '/home/'.$user_plain){
  59. if($file['path'] != '/home/'.$user_plain && $file['path'] == $files[0]['path']){
  60. ?>
  61. <div class="units-table-row js-unit">
  62. <div class="units-table-cell">
  63. </div>
  64. <div class="units-table-cell units-table-heading-cell u-text-bold">
  65. <b><a href="/list/backup/incremental/?snapshot=<?= htmlentities($_GET["snapshot"]) ?>&browse=yes&folder=<?=htmlentities($files[0]['path'])?>/../&token=<?=$_SESSION["token"]?>"><i class="fas fa-folder icon-dim u-mr5"></i>..</a></b>
  66. </div>
  67. <div class="units-table-cell">
  68. </div>
  69. <div class="units-table-cell">
  70. <span class="u-hide-desktop u-text-bold"><?= _("Type") ?>:</span>
  71. <span class="u-text-bold">
  72. Directory
  73. </span>
  74. </div>
  75. <div class="units-table-cell">
  76. </div>
  77. </div>
  78. <?php
  79. }else{
  80. ?>
  81. <div class="units-table-row js-unit">
  82. <div class="units-table-cell">
  83. <div>
  84. <input id="check<?= $i ?>" class="ch-toggle" type="checkbox" name="files[]" value="<?=htmlentities($file['path'])?>">
  85. </div>
  86. </div>
  87. <div class="units-table-cell">
  88. <div>
  89. <?php if($file['type'] == 'dir'){
  90. if(str_starts_with($file['path'], '/home/'.$user_plain.'/conf')){
  91. ?>
  92. <b><i class="fas fa-folder icon-dim u-mr5"></i><?=$file['name']?></b>
  93. <?php
  94. }else{
  95. ?>
  96. <b><a href="/list/backup/incremental/?snapshot=<?= htmlentities($_GET["snapshot"]) ?>&browse=yes&folder=<?=htmlentities($file['path'])?>&token=<?=$_SESSION["token"]?>"><i class="fas fa-folder icon-dim u-mr5"></i><?=$file['name']?></a></b>
  97. <?php
  98. }
  99. }else{
  100. ?>
  101. <b><i class="fas fa-file icon-dim u-mr5"></i><?=$file['name']?></b>
  102. <?php
  103. }?>
  104. </div>
  105. </div>
  106. <div class="units-table-cell">
  107. <a href="/schedule/restore/incremental/?snapshot=<?= htmlentities($_GET["snapshot"]) ?>&type=file&object=<?=htmlentities($file['path'])?>&token=<?= $_SESSION["token"] ?>" title="<?= _("Restore") ?>">
  108. <i class="fas fa-arrow-rotate-left icon-green icon-dim u-mr5"></i>
  109. </a>
  110. </div>
  111. <div class="units-table-cell">
  112. <span class="u-hide-desktop u-text-bold"><?= _("Type") ?>:</span>
  113. <span class="u-text-bold">
  114. <?=getTransByType($file['type']);?>
  115. </span>
  116. </div>
  117. <div class="units-table-cell">
  118. <span class="u-hide-desktop u-text-bold"><?= _("Date / Time") ?>:</span>
  119. <span class="u-text-bold">
  120. <?=convert_datetime($file['ctime'], 'Y-m-d H:i:s');?>
  121. </span>
  122. </div>
  123. </div>
  124. <?php
  125. }
  126. }
  127. } ?>
  128. </div>
  129. </div>
  130. <footer class="app-footer">
  131. <div class="container app-footer-inner">
  132. <p>
  133. <?php printf(ngettext("%d item", "%d items", $i), $i); ?>
  134. </p>
  135. </div>
  136. </footer>