[fix] preview image in admin page

This commit is contained in:
Knah Tsaeb 2015-07-10 13:55:10 +02:00
parent 5d4edab2a4
commit 840de1ac0e

View file

@ -161,7 +161,7 @@ echo '<div class="hMenu">
</div>
<div id="log">';
if (isset($ui['ac']) && $ui['ac'] === 'delete') {
if($ui['delThumb']){
if ($ui['delThumb']) {
delAndRegen($ui['delThumb'], $size);
}
if (isset($ui['deleteUrl']) && testValidUrl($ui['deleteUrl']) !== true) {
@ -204,7 +204,7 @@ if (isset($ui['log']) && $ui['log'] === 'success') {
$nbThumb = 0;
$nbThumb = count($logs['genTime']);
echo 'Total request : ', $nbThumb, '</br>';
echo 'Moyenne per request : ', round(array_sum($logs['genTime']) / $nbThumb, 2), 's (min (', min($logs['genTime']), 's) max (', max($logs['genTime']), 's))</br>';
echo 'Moyenne per request : ', round(array_sum($logs['genTime']) / $nbThumb, 2), 's (min (', min($logs['genTime']), 's) max (', max($logs['genTime']), 's))</br>';
} else {
echo 'No result';
}
@ -226,15 +226,15 @@ if (isset($ui['log']) && ($ui['log'] === 'suspect' || $ui['log'] === 'retry' ||
if (isset($ui['keep']) && (int)$ui['keep'] === 1) {
keepThisThumb($ui['hash'], $ui['log']);
}
if (isset($ui['mGen']) && (int)$ui['mGen'] === 1)
if (isset($ui['mGen']) && (int)$ui['mGen'] === 1) {
$success = manualGen($ui['hash'], $ui['log']);
$success['base64'] = 'data:image/png;base64,'.base64_encode(file_get_contents($success['filePath']));
}
}
$logs = parseFailLog($ui['log']);
if (!empty($logs)) {
echo '<ul>';
foreach ($logs as $value) {
echo '<li>', htmlentities(strip_tags($value['3'])), htmlentities(strip_tags($value['0'])), '</br><a href="?p=admin&log=', $ui['log'], '&hash=', $value['1'], '&mGen=1#result">manuel launch</a> <a href="', htmlentities(strip_tags($value['0'])), '">view site</a> <a href="?p=admin&log=', $ui['log'], '&hash=', $value['1'], '&cache=1&s=', $value['2'], '#result">view image in cache</a></li>';
echo '<li>', htmlentities(strip_tags($value['3'])), htmlentities(strip_tags($value['0'])), '</br><a href="?p=admin&log=', $ui['log'], '&hash=', $value['1'], '&mGen=1#result">manuel launch</a> <a href="', htmlentities(strip_tags($value['0'])), '">view site</a> <a href="?p=admin&log=', $ui['log'], '&hash=', $value['1'], '&cache=1&s=', $value['2'], '#result">view image in cache</a></li>';
}
echo '</ul>';
} else {