galaxy-opc-plugin 0.3.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.ts +0 -2
- package/package.json +1 -1
- package/src/api/companies.ts +1 -1
- package/src/api/dashboard.ts +1 -1
- package/src/web/config-ui.ts +2 -2
- package/src/web/landing-page.ts +5 -10
package/index.ts
CHANGED
|
@@ -47,7 +47,6 @@ import { registerOrderTool } from "./src/tools/order-tool.js";
|
|
|
47
47
|
import { registerOpcCommand } from "./src/commands/opc-command.js";
|
|
48
48
|
import { triggerEventRules } from "./src/opc/event-triggers.js";
|
|
49
49
|
import { registerConfigUi } from "./src/web/config-ui.js";
|
|
50
|
-
import { registerLandingPage } from "./src/web/landing-page.js";
|
|
51
50
|
|
|
52
51
|
/** 解析数据库路径,支持 ~ 前缀 */
|
|
53
52
|
function resolveDbPath(configured?: string): string {
|
|
@@ -153,7 +152,6 @@ const plugin = {
|
|
|
153
152
|
|
|
154
153
|
// 注册 Web UI
|
|
155
154
|
registerConfigUi(api, db, gatewayToken);
|
|
156
|
-
registerLandingPage(api);
|
|
157
155
|
|
|
158
156
|
// ── 智能刷新器(共享函数,after_tool_call + subagent_ended 共用) ──
|
|
159
157
|
const refreshTimers = new Map<string, ReturnType<typeof setTimeout>>();
|
package/package.json
CHANGED
package/src/api/companies.ts
CHANGED
package/src/api/dashboard.ts
CHANGED
package/src/web/config-ui.ts
CHANGED
|
@@ -4162,7 +4162,7 @@ export function registerConfigUi(api: OpenClawPluginApi, db: OpcDatabase, gatewa
|
|
|
4162
4162
|
}
|
|
4163
4163
|
|
|
4164
4164
|
// Serve HTML page for all other /opc/admin paths
|
|
4165
|
-
sendHtml(res, buildPageHtml(
|
|
4165
|
+
sendHtml(res, buildPageHtml(false));
|
|
4166
4166
|
return true;
|
|
4167
4167
|
} catch (err) {
|
|
4168
4168
|
res.writeHead(500, { "Content-Type": "application/json; charset=utf-8" });
|
|
@@ -4182,7 +4182,7 @@ export function registerConfigUi(api: OpenClawPluginApi, db: OpcDatabase, gatewa
|
|
|
4182
4182
|
apiAny.registerHttpRoute({
|
|
4183
4183
|
path: "/opc/admin",
|
|
4184
4184
|
handler,
|
|
4185
|
-
auth: "
|
|
4185
|
+
auth: "plugin",
|
|
4186
4186
|
match: "prefix",
|
|
4187
4187
|
});
|
|
4188
4188
|
} else {
|
package/src/web/landing-page.ts
CHANGED
|
@@ -321,17 +321,12 @@ export function registerLandingPage(api: OpenClawPluginApi): void {
|
|
|
321
321
|
};
|
|
322
322
|
|
|
323
323
|
if (typeof apiAny.registerHttpHandler === "function") {
|
|
324
|
+
// 旧版 openclaw:通过 registerHttpHandler 注册,返回 false 时 openclaw 继续处理聊天 UI
|
|
324
325
|
apiAny.registerHttpHandler(handler);
|
|
325
|
-
|
|
326
|
-
apiAny.registerHttpRoute({
|
|
327
|
-
path: "/",
|
|
328
|
-
handler,
|
|
329
|
-
auth: "plugin",
|
|
330
|
-
match: "prefix",
|
|
331
|
-
});
|
|
326
|
+
api.logger.info("opc: 已注册产品官网 (/)");
|
|
332
327
|
} else {
|
|
333
|
-
|
|
328
|
+
// 新版 openclaw (2026.3.2+):跳过官网注册,保留 openclaw 原生聊天 UI 在 /
|
|
329
|
+
// 用户通过 /opc/admin 直接访问管理后台
|
|
330
|
+
api.logger.info("opc: 跳过官网注册(新版 openclaw,聊天 UI 保留在 /)");
|
|
334
331
|
}
|
|
335
|
-
|
|
336
|
-
api.logger.info("opc: 已注册产品官网 (/)");
|
|
337
332
|
}
|