Browse Source

add refresh icon for cache index

master
filesite 2 months ago
parent
commit
d1d19c4c20
  1. 9
      themes/beauty/controller/CommandController.php
  2. 7
      themes/beauty/views/site/index.php

9
themes/beauty/controller/CommandController.php

@ -129,6 +129,9 @@ eof; @@ -129,6 +129,9 @@ eof;
//缓存所有文件id跟文件信息,便于根据id列表来渲染,并按id首字母分子目录存放,以支持大量文件的场景
$this->saveAllFilesIntoCacheFile();
//TODO: 保存所有目录下文件数量统计
//按年、月保存文件数据,以便按年、月显示
//while (true) {
//$time = date('Y-m-d H:i:s');
//echo "{$botLogPrefix} {$time}\n";
@ -142,6 +145,7 @@ eof; @@ -142,6 +145,7 @@ eof;
Common::setCache($this->scanedDirCacheKey, array());
Common::setCache($this->dateIndexCacheKey, array());
Common::setCache($this->noOriginalCtimeFilesCacheKey, array());
Common::setCache($this->allFilesCacheKey, array());
}
//扫描媒体文件:图片、视频、音乐
@ -227,6 +231,7 @@ eof; @@ -227,6 +231,7 @@ eof;
'total' => $total,
'current' => $index,
'percent' => floor($index*100/$total),
'status' => 'running',
);
$botLogPrefix = $this->logPrefix;
@ -238,6 +243,10 @@ eof; @@ -238,6 +243,10 @@ eof;
$rootDir = __DIR__ . '/../../../www/' . FSC::$app['config']['content_directory'];
if ($dirpath == $rootDir) {
if ($index == $total) {
$stats['status'] = 'finished';
}
echo "{$botLogPrefix} Scan has finished {$stats['percent']}%, total {$stats['total']}, current {$stats['current']}\n";
//保存进度文件

7
themes/beauty/views/site/index.php

@ -58,7 +58,12 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full'; @@ -58,7 +58,12 @@ $main_view_cls = $menu_ext_status == 'opened' ? '' : 'full';
<!--侧边栏-->
<ul class="nav navbar-fixed-left <?=$menu_expand_icon_cls?>">
<li class="menu-title">年月</li>
<li class="menu-title">
年月
<?php if (!empty($viewData['isAdminIp'])) { ?>
<img class="svg icon1 svgimg verMiddle" src="/img/beauty/refresh.svg" alt="清空缓存数据" title="刷新缓存数据" style="margin-left:10px;width:16px">
<?php } ?>
</li>
<?php
if (!empty($viewData['cacheDataByDate'])) {
$arrYears = array_keys($viewData['cacheDataByDate']);

Loading…
Cancel
Save