<?php
if (!defined('USING_SYSTEM')) exit;
?>
<!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" />
<script type="text/javascript" src="skins/common/images/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src="admin/images/page.js"></script>
<script type="text/javascript">
function removeVol(id) {
	if(id != '1') {
		if(confirm('您确定要删除本云卷吗？云卷程序以及文件数据需要您手动去删除。')) {
			
		}
	} else {
		alert('内置云卷不允许被删除');
	}
}
</script>
<title>Filiant Control Panel</title>
</head>
<body>
<div class="bigTips"<?php echo ($tips=='')?'':' style="display:block;"' ?>><?php echo $tips ?></div>
<form id="mainForm" action="" method="post">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th colspan="3">添加云卷</th>
  </tr>
  <tr>
    <td class="title" width="150">卷域</td>
    <td width="400"><input name="hostTxt" id="hostTxt" type="text" class="textbox" /></td>
    <td class="tips">例：seoul.kr.mivstroe.com，添加前首先在相应服务器上安装好卷端程序。</td>
  </tr>
  <tr>
    <td class="title">容量</td>
    <td><input name="sizeTxt" id="sizeTxt" type="text" class="textbox" /></td>
    <td class="tips">限制此云卷最大的可用容量，单位字节。</td>
  </tr>
  <tr id="typeTd">
    <td class="title">类型</td>
    <td class="dropdown">
      <select name="typeTxt" id="typeTxt">
        <option value="1" selected="selected">COMMON</option>
        <option value="2">PARTNER-QINIU</option>
      </select>
    </td>
    <td class="tips">请选择您要挂载的云卷的类型，具体选择请参照说明。</td>
  </tr>
  <tr>
    <td colspan="3" class="tips">我们对 PARTNER 开头的卷端类型不做任何可用性保证和任何技术支持，请联系相关服务商获取相关支持。</td>
  </tr>
</table>
<div class="controls">
  <a id="saveBtn" class="button" href="javascript:void(0);" onclick="$('#mainForm').trigger('submit');return false;">添加<i></i></a>
</div>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <th colspan="7">云卷列表</th>
  </tr>
  <tr>
    <th>卷域</th>
    <th>备注</th>
    <th>容量</th>
    <th>剩余</th>
    <th>类型</th>
    <th width="50">状态</th>
    <th width="100">操作</th>
  </tr>
<?php
if($vols = xVolMgr::getAllArr()) {
	foreach($vols as $vol) {
?>
  <tr>
    <td><?php echo $vol['host'] ?></td>
    <td><?php echo ($vol['id'] == '1') ? '这是一个内置云卷' : '' ?></td>
    <td><?php echo xFile::toStrSize($vol['size']) ?></td>
    <td><?php echo xFile::toStrSize($vol['rsize']) ?></td>
    <td>内置</td>
    <td align="center"><strong style="color:#090;">畅通</strong></td>
    <td align="center">
      <a class="button" href="?ac=p401edit&id=<?php echo $vol['id'] ?>">编辑<i></i></a><br />
      <!--<a href="javascript:void(0);" onclick="removeVol(<?php echo $vol['id'] ?>);return false;">删除<i></i></a>-->
    </td>
  </tr>
<?php
	}
}
?>
</table>
</body>
</html>