<?php
if (!defined('USING_SYSTEM')) exit;

$servers = xVolMgr::getAll();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="text/css" rel="stylesheet" href="admin/images/page.css?v=<?php echo FA_VERSION.'-'.FA_FIXPACK ?>" />
<script type="text/javascript" src="skins/common/images/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="admin/images/page.js?v=<?php echo FA_VERSION.'-'.FA_FIXPACK ?>"></script>
<script type="text/javascript" src="admin/ui.p402.js?v=<?php echo FA_VERSION.'-'.FA_FIXPACK ?>"></script>
<title>Filiant Control Panel</title>
</head>
<body>
<div class="bigTips"<?php echo ($tips=='')?'':' style="display:block;"' ?>><?php echo $tips ?></div>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th colspan="3">文件清理</th>
  </tr>
  <tr>
    <th>卷域</th>
    <th>废弃文件占用</th>
    <th>说明</th>
  </tr>
  <tbody id="serversTbody">
<?php
$size = 0;
foreach($servers as $server) {
?>
    <tr sid="<?php echo $server->id ?>">
      <td class="title" width="250"><span><?php echo $server->host ?>&nbsp;</span><img src="admin/images/ajax-loader.gif" id="serv<?php echo $server->id ?>img" style="display:none;" /></td>
      <td width="400"><?php echo xFile::toStrSize($server->getUnlinkSize()) ?></td>
      <td class="tips">卷端废弃文件占用</td>
    </tr>
<?php
	$size += $server->getUnlinkSize();
}
?>
  </tbody>
  <tr>
    <td class="title" width="150">统计信息</td>
    <td width="400">共 <?php echo xVFile::getUnlinkCount() ?> 个，占用卷端共 <?php echo xFile::toStrSize($size) ?></td>
    <td class="tips">建议您隔一段时间清理一次</td>
  </tr>
  <tr>
    <td colspan="3" class="tips">什么是废弃文件：Filiant 基于分布式文件架构，当用户将文件删除时，实体文件并非实时删除，若不同用户上传了相同文件也只保留一份，且被删除的文件又被重新上传也不会重新占用空间（需要开启存储分析功能），您可以每隔一段时间进行一次无任何用户引用的实体文件来释放空间。</td>
  </tr>
</table>
<div class="controls">
  <a id="startBtn" class="button" href="javascript:void(0);" onclick="return false;">开始清理<i></i></a>
</div>
</body>
</html>