Browse Source

update snaps list

main
ghost 1 year ago
parent
commit
783c60fd25
  1. 45
      src/webui/explore.php

45
src/webui/explore.php

@ -1,9 +1,9 @@
<?php <?php
// Debug // Debug
ini_set('display_errors', '1'); # ini_set('display_errors', '1');
ini_set('display_startup_errors', '1'); # ini_set('display_startup_errors', '1');
error_reporting(E_ALL); # error_reporting(E_ALL);
// Load dependencies // Load dependencies
require_once __DIR__ . '/../../vendor/autoload.php'; require_once __DIR__ . '/../../vendor/autoload.php';
@ -117,7 +117,7 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
$basename = basename($filename); $basename = basename($filename);
$time = preg_replace('/\D/', '', $basename); $time = preg_replace('/\D/', '', $basename);
$snaps[sprintf(_('Remote #%s'), $i + 1)][] = (object) $snaps[sprintf(_('Server #%s'), $i + 1)][] = (object)
[ [
'source' => $i, 'source' => $i,
'md5url' => $md5url, 'md5url' => $md5url,
@ -211,13 +211,6 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
margin: 4px 0; margin: 4px 0;
} }
h4 {
display: block;
font-size: 13px;
font-weight: normal;
margin: 4px 0;
}
form { form {
display: block; display: block;
max-width: 678px; max-width: 678px;
@ -295,6 +288,8 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
ul > li { ul > li {
margin-left: 16px; margin-left: 16px;
font-size: 13px;
padding: 4px 0;
} }
.text-warning { .text-warning {
@ -375,18 +370,22 @@ foreach ($config->snap->storage->remote->ftp as $i => $ftp)
<?php } ?> <?php } ?>
<?php if ($snaps) { ?> <?php if ($snaps) { ?>
<h3><?php echo _('Snaps') ?></h3> <h3><?php echo _('Snaps') ?></h3>
<?php foreach ($snaps as $source => $snap) { ?> <ul>
<h4><?php echo $source ?></h4> <?php foreach ($snaps as $source => $snap) { ?>
<ul> <li>
<?php foreach ($snap as $file) { ?> <?php echo $source ?>
<li> <ul>
<a rel="nofollow" href="<?php echo $config->webui->url->base; ?>/api.php?action=snap&method=download&source=<?php echo $file->source ?>&md5url=<?php echo $file->md5url ?>&time=<?php echo $file->time ?>"> <?php foreach ($snap as $file) { ?>
<?php echo sprintf('%s (tar.gz / %s bytes)', date('c', $file->time), number_format($file->size)) ?> <li>
</a> <a rel="nofollow" href="<?php echo $config->webui->url->base; ?>/api.php?action=snap&method=download&source=<?php echo $file->source ?>&md5url=<?php echo $file->md5url ?>&time=<?php echo $file->time ?>">
</li> <?php echo sprintf('%s (tar.gz / %s bytes)', date('c', $file->time), number_format($file->size)) ?>
<?php } ?> </a>
</ul> </li>
<?php } ?> <?php } ?>
</ul>
</li>
<?php } ?>
</ul>
<?php } ?> <?php } ?>
</div> </div>
<?php } else { ?> <?php } else { ?>

Loading…
Cancel
Save