From 5c0ba37eda80d39e6ceca59bb1d5f4942f858995 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Thu, 17 Sep 2026 14:32:37 +0800 Subject: chore: establish Strategy Lab source baseline (development, not release) --- frontend/src/pages/AdminPage.svelte | 371 ++++++++++++++++++++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100644 frontend/src/pages/AdminPage.svelte (limited to 'frontend/src/pages/AdminPage.svelte') diff --git a/frontend/src/pages/AdminPage.svelte b/frontend/src/pages/AdminPage.svelte new file mode 100644 index 0000000..984962d --- /dev/null +++ b/frontend/src/pages/AdminPage.svelte @@ -0,0 +1,371 @@ + + + + {#snippet actions()} +
+ + + +
+ {/snippet} + +
+ + + {#if tab === 'users'} +
+

用户

+ + {#if !usersBusy && !usersErr && users.length > 0} + + + + + + + + + + + + + + {#each users as u (u.id)} + + + + + + + + + + {/each} + +
邮箱姓名角色状态AI 权限日回测上限操作
{u.email}{u.name} + + + {u.active ? '启用' : '停用'} + + + + void patchUser(u, { daily_run_limit: Number((e.target as HTMLInputElement).value) })} + /> + +
+ + +
+
+ {/if} +

停用账户会立即吊销其会话并阻止其回测与 AI 请求。角色不能作用于他人项目,私阅策略代码不提供。

+
+ {:else if tab === 'invites'} +
+

签发邀请

+
+ + + +
+ + {#if newInvite} + + {/if} +
+ +
+

历史邀请

+ + {#if !inviteBusy && !inviteErr && invites.length === 0} + + {/if} + {#if !inviteBusy && invites.length > 0} + + + + + + + + + + + + + {#each invites as inv (inv.id)} + + + + + + + + + {/each} + +
邮箱备注角色创建时间过期状态
{inv.email ?? '—'}{inv.role === 'admin' ? '管理员' : '成员'}{fmtDateTime(inv.created_at)}{fmtDateTime(inv.expires_at)} + {#if inv.used_at}已使用 + {:else if inv.revoked}已撤销 + {:else if inv.expires_at && new Date(inv.expires_at) < new Date()}已过期 + {:else}有效 + {/if} + + {#if !inv.used_at && !inv.revoked} + + {/if} +
+ {/if} +

恢复链接由“生成恢复”按钮产生,仅出现一次;不会自动发邮件。

+
+ {:else} +
+

安全审计(收尾尾部)

+ + {#if !auditBusy && !auditErr && audit.length === 0} + + {/if} + {#if !auditBusy && audit.length > 0} + + + + + + + + + + + + {#each audit as e, i (i)} + + + + + + + + {/each} + +
时间行为者事件对象结果
{fmtDateTime(e.time)}{e.actor ?? '—'}{e.action}{e.target ?? '—'}{e.status}
+ {/if} +

审计仅记录操作行为与结果,不含密码/密钥/策略代码内容。

+
+ {/if} +
+ + {#if resetFor} + (resetFor = null)}> +
+ +

单次有效、限时;重置会吊销对方的全部历史会话。

+
+
+ {/if} +
-- cgit v1.2.3