0 ? (int)ceil($total / $result['per_page']) : 1; $statuses = rp_statuses(); $all_nodes = rp_all_nodes(); // 一次性统计本页所有资源池的用量,避免逐行查询 $usage_map = rp_usage_batch(array_map(function ($p) { return (int)$p['id']; }, $list)); /** 配额单元格:已用/总额,超额标红;总额 0 表示不限 */ $quota_cell = function ($used, $total, $unit) { $total = (int)$total; if ($total <= 0) { return '' . (int)$used . $unit . ' / 不限'; } $cls = ((int)$used > $total) ? 'text-danger' : 'text-success'; return '' . (int)$used . ' / ' . $total . $unit . ''; }; $title = '资源池列表'; mnbt_admin_include('head'); /** 拼接分页链接 */ $page_url = function ($n) use ($kw, $status_f) { return 'plugin.php?p=resource_pool&page=list&page_num=' . (int)$n . '&kw=' . urlencode($kw) . '&status=' . urlencode($status_f); }; ?>
| ID | 资源池名 | 用户名 | 密码 | 可用节点 | 网页空间 已用/总额 |
数据库空间 已用/总额 |
流量 已用/总额 |
主机数 | 到期日期 | 状态 | 操作 |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 暂无资源池,点击右上「添加资源池」创建 | |||||||||||
| = $pid ?> | = $pname ?>
= htmlspecialchars($p['remark'], ENT_QUOTES, 'UTF-8') ?> |
= htmlspecialchars($p['username'], ENT_QUOTES, 'UTF-8') ?> | •••••• 显示 | 不限 = htmlspecialchars($n, ENT_QUOTES, 'UTF-8') ?> | = $quota_cell($usage['web'], $p['web_space'], 'MB') ?> | = $quota_cell($usage['sql'], $p['sql_space'], 'MB') ?> | = $quota_cell($usage['flow'], $p['flow'], 'G') ?> | = (int)$usage['hosts'] ?> 台 |
永不到期
= htmlspecialchars($p['expire_date'], ENT_QUOTES, 'UTF-8') ?>
已到期 |
启用 禁用 | |