feat: poll/voting system with live results and bar charts

This commit is contained in:
2026-07-13 21:37:16 +08:00
parent eed4591059
commit 116fe89ac8
6 changed files with 173 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ const App = {
{ id: 'templates', label: '邮件模板', icon: 'fa-envelope', roles: ['owner','admin'] },
{ id: 'settings', label: '系统设置', icon: 'fa-cog', roles: ['owner','admin'] },
{ id: 'export', label: '数据导出', icon: 'fa-download', roles: ['owner'] },
{ id: 'polls', label: '投票', icon: 'fa-poll', roles: ['owner','admin','player'] },
],
async init() {
@@ -76,6 +77,7 @@ const App = {
case 'templates': this.renderMain('邮件模板', TemplatesPage, param); break;
case 'settings': this.renderMain('系统设置', SettingsPage, param); break;
case 'export': this.renderMain('数据导出', ExportPage, param); break;
case 'polls': this.renderMain('投票', PollsPage, param); break;
default: this.renderMain('控制台', Dashboard, param);
}
},
@@ -98,6 +100,7 @@ const App = {
const u = Auth.user();
el.innerHTML = `<span class="tm ts">${U.esc(u.game_name||u.username)}</span>
<a href="#/dashboard" class="btn btn-p btn-sm"><i class="fas fa-chart-simple"></i> 控制台</a>
<a href="#/polls" class="btn btn-o btn-sm"><i class="fas fa-poll"></i></a>
${Auth.isAdmin() ? `<a href="#/unclaimed" class="btn btn-o btn-sm">待处理</a>`:''}
<button class="btn btn-o btn-sm" onclick="App.logout()"><i class="fas fa-sign-out-alt"></i> 退出</button>`;
} else {
@@ -144,6 +147,7 @@ window.TemplatesPage = TemplatesPage;
window.NotificationsPage = NotificationsPage;
window.SettingsPage = SettingsPage;
window.ExportPage = ExportPage;
window.PollsPage = PollsPage;
window.LoginPage = LoginPage;
window.RegisterPage = RegisterPage;
window.HomePage = HomePage;