Keep SCUM page bundle registration compatible

This commit is contained in:
npc0-hue
2026-08-27 17:21:09 +08:00
parent d3b7207019
commit 75ef3761ca
3 changed files with 14 additions and 14 deletions
@@ -62,8 +62,8 @@ const plugin: GamePluginResponse = {
title: "用户管理", title: "用户管理",
path: "/players", path: "/players",
bundleKey: "scum-server-plugin", bundleKey: "scum-server-plugin",
bundleVersion: "1.0.4", bundleVersion: "1.0.3",
bundleIntegritySha256: "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60", bundleIntegritySha256: "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
permissions: ["server.read", "server.game-client.read", "server.game-client.command"], permissions: ["server.read", "server.game-client.read", "server.game-client.command"],
bridgeActions: ["server.instances.read"] bridgeActions: ["server.instances.read"]
}], }],
@@ -138,7 +138,7 @@ describe("PluginPageHostPage", () => {
const html = renderToStaticMarkup(<PluginPageHostPage {...props()} initialPlugin={plugin} />); const html = renderToStaticMarkup(<PluginPageHostPage {...props()} initialPlugin={plugin} />);
expect(html).toContain("用户管理"); expect(html).toContain("用户管理");
expect(html).toContain("平台托管上下文"); expect(html).toContain("平台托管上下文");
expect(html).toContain("scum-server-plugin@1.0.4"); expect(html).toContain("scum-server-plugin@1.0.3");
expect(html).toContain("完整性"); expect(html).toContain("完整性");
expect(html).toContain("返回服务器"); expect(html).toContain("返回服务器");
expect(html).not.toMatch(/sessionToken|componentKey|hostPath|dsn|runSocket|credential/i); expect(html).not.toMatch(/sessionToken|componentKey|hostPath|dsn|runSocket|credential/i);
@@ -1345,8 +1345,8 @@
"title": "用户管理", "title": "用户管理",
"path": "/players", "path": "/players",
"bundleKey": "scum-server-plugin", "bundleKey": "scum-server-plugin",
"bundleVersion": "1.0.4", "bundleVersion": "1.0.3",
"bundleIntegritySha256": "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60", "bundleIntegritySha256": "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
"permissions": [ "permissions": [
"server.read", "server.read",
"server.remote.access", "server.remote.access",
@@ -1367,8 +1367,8 @@
"title": "队伍管理", "title": "队伍管理",
"path": "/squads", "path": "/squads",
"bundleKey": "scum-server-plugin", "bundleKey": "scum-server-plugin",
"bundleVersion": "1.0.4", "bundleVersion": "1.0.3",
"bundleIntegritySha256": "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60", "bundleIntegritySha256": "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
"permissions": [ "permissions": [
"server.read", "server.read",
"server.remote.access", "server.remote.access",
@@ -1387,8 +1387,8 @@
"title": "实时地图", "title": "实时地图",
"path": "/live-map", "path": "/live-map",
"bundleKey": "scum-server-plugin", "bundleKey": "scum-server-plugin",
"bundleVersion": "1.0.4", "bundleVersion": "1.0.3",
"bundleIntegritySha256": "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60", "bundleIntegritySha256": "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
"permissions": [ "permissions": [
"server.read", "server.read",
"server.remote.access", "server.remote.access",
@@ -1407,8 +1407,8 @@
"title": "礼包管理", "title": "礼包管理",
"path": "/gifts", "path": "/gifts",
"bundleKey": "scum-server-plugin", "bundleKey": "scum-server-plugin",
"bundleVersion": "1.0.4", "bundleVersion": "1.0.3",
"bundleIntegritySha256": "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60", "bundleIntegritySha256": "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
"permissions": [ "permissions": [
"server.read", "server.read",
"server.remote.access", "server.remote.access",
@@ -1428,8 +1428,8 @@
"title": "活动管理", "title": "活动管理",
"path": "/activity", "path": "/activity",
"bundleKey": "scum-server-plugin", "bundleKey": "scum-server-plugin",
"bundleVersion": "1.0.4", "bundleVersion": "1.0.3",
"bundleIntegritySha256": "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60", "bundleIntegritySha256": "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e",
"permissions": [ "permissions": [
"server.read", "server.read",
"server.remote.access", "server.remote.access",
@@ -1,5 +1,5 @@
import { renderSCUMFeaturePage } from "../features/page.js"; import { renderSCUMFeaturePage } from "../features/page.js";
export const pluginPageBundle = { key: "scum-server-plugin", version: "1.0.4", integritySha256: "sha256:359ade451d368774fd52b518e3a944ecda70f71cb9d4f8639d731d8072a44a60" }; export const pluginPageBundle = { key: "scum-server-plugin", version: "1.0.3", integritySha256: "sha256:3488b316d909e597024f8f31c7bc96ab8019f643d74a528dc442d3df0dc3d54e" };
export function renderPluginPage(react: any, input: any) { return renderSCUMFeaturePage(react, { pageKey: input.page?.key ?? "players", pageTitle: input.page?.title ?? "用户管理", serverInstanceId: input.context.serverInstanceId, permissions: input.context.permissions, availability: input.availability, featureAvailability: input.availability.features, workspaceActions: input.workspaceActions }); } export function renderPluginPage(react: any, input: any) { return renderSCUMFeaturePage(react, { pageKey: input.page?.key ?? "players", pageTitle: input.page?.title ?? "用户管理", serverInstanceId: input.context.serverInstanceId, permissions: input.context.permissions, availability: input.availability, featureAvailability: input.availability.features, workspaceActions: input.workspaceActions }); }