const Dashboard = { async render() { return '
| 玩家 | 类型 | 原因 | 时长 | 时间 |
|---|---|---|---|---|
| ${U.esc(b.player_name)} | ${b.type==='ban'?'封禁':b.type==='mute'?'禁言':'其他'} | ${U.esc(b.reason||'')} | ${b.duration||'永久'} | ${U.date(b.created_at)} |
| 月份 | 数量 |
|---|---|
| ${m.m} | ${m.c} |
提示: 可在"工单列表"中查看和管理所有工单
`; }, showAddBan() { U.modal('添加封禁', ` `); document.getElementById('ban-form').onsubmit = async e => { e.preventDefault(); try { await API.post('/bans', { player_name: document.getElementById('ban-name').value, player_uid: document.getElementById('ban-uid').value, type: document.getElementById('ban-type').value, duration: document.getElementById('ban-dur').value, reason: document.getElementById('ban-reason').value }); App.closeModal(); this.mount(); } catch(ex) { alert(ex.message); } }; } };