adjust server detail default and status layout

This commit is contained in:
npc0-hue
2026-08-27 10:17:04 +08:00
parent 2937ece1bc
commit 0940780058
2 changed files with 23 additions and 10 deletions
+13 -5
View File
@@ -35,11 +35,19 @@ describe("ServerDetailPage config write approval", () => {
it("keeps the detail header focused on a single shared action row", () => {
expect(serverDetailPageSource).not.toContain("Run 心跳");
expect(serverDetailPageSource).not.toContain("已自动附着");
expect(serverDetailPageSource).toContain('<span>返回列表</span>');
expect(serverDetailPageSource).toContain('<span>刷新</span>');
expect(serverDetailPageSource).toContain('<span>打开终端</span>');
expect(serverDetailPageSource).toContain('<span>启动</span>');
expect(serverDetailPageSource).toContain('<span>停止</span>');
const headerSource = serverDetailPageSource.split('<header className="server-detail-header">')[1]?.split('</header>')[0] ?? "";
expect(headerSource).toContain('<span>返回列表</span>');
expect(headerSource).not.toContain('<span>刷新</span>');
expect(headerSource).toContain('<span>打开终端</span>');
expect(headerSource).toContain('<span>启动</span>');
expect(headerSource).toContain('<span>停止</span>');
const actionStripSource = headerSource.split('<div className="action-strip">')[1]?.split('</div>')[0] ?? "";
expect(actionStripSource.indexOf('<span>停止</span>')).toBeLessThan(actionStripSource.indexOf('detailStateText'));
});
it("opens the plugin user management page by default when available", () => {
expect(serverDetailPageSource).toContain('page.key === "players"');
expect(serverDetailPageSource).toContain('setSection(`plugin:${defaultPluginPage.key}`)');
});
it("maps platform diff preview responses into the display diff without losing approval metadata", () => {