From c8a7bdc0f84d7953c667e40dd1ce6a82b7a763d7 Mon Sep 17 00:00:00 2001 From: baiyanyun Date: Mon, 13 Jul 2026 15:53:42 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=85=A5=E5=8F=AF=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=A6=82=E8=A7=88=E6=9C=8D=E5=8A=A1=E5=B9=B6=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/resources/application-dev.sample.yml | 3 ++ .../src/main/resources/application-dev.yml | 3 ++ .../resources/application-prod.sample.yml | 3 ++ .../resources/application-test.sample.yml | 3 ++ .../application/dto/TenantConfigDto.java | 3 ++ .../service/impl/TenantConfigServiceImpl.java | 16 +++++++- .../web/controller/TenantController.java | 6 +++ .../SystemConfig/BaseFormItem/index.tsx | 3 +- qiming/src/types/interfaces/systemManage.ts | 2 + .../src/renderer/App.tsx | 12 ++++-- .../pages/ConfiguredServicePage.tsx | 37 ++++++++++++++++++- .../components/pages/OverviewPage.tsx | 15 ++++++++ .../renderer/services/core/servicePages.ts | 10 +++++ 13 files changed, 108 insertions(+), 8 deletions(-) create mode 100644 qimingclaw/crates/agent-electron-client/src/renderer/components/pages/OverviewPage.tsx diff --git a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.sample.yml b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.sample.yml index 7885f4d6..8e57afe8 100644 --- a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.sample.yml +++ b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.sample.yml @@ -185,6 +185,9 @@ eco-market: mcp: proxy-base-url: ${MCP_PROXY_URL:http://localhost:8020} +overview-page: + service-url: ${OVERVIEW_SERVICE_URL:http://127.0.0.1:5173/_app/digital} + intelligent-data: service-url: ${INTELLIGENT_DATA_SERVICE_URL:http://192.168.2.106:3000/test-console} diff --git a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.yml b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.yml index 2a2c3c3f..844fa613 100644 --- a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.yml +++ b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-dev.yml @@ -185,6 +185,9 @@ eco-market: mcp: proxy-base-url: ${MCP_PROXY_URL:http://localhost:18020} +overview-page: + service-url: ${OVERVIEW_SERVICE_URL:http://127.0.0.1:5173/_app/digital} + intelligent-data: service-url: ${INTELLIGENT_DATA_SERVICE_URL:http://192.168.2.106:3000/test-console} diff --git a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-prod.sample.yml b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-prod.sample.yml index 42e71ac3..66f0087b 100644 --- a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-prod.sample.yml +++ b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-prod.sample.yml @@ -182,6 +182,9 @@ eco-market: mcp: proxy-base-url: ${MCP_PROXY_URL:http://localhost:8020} +overview-page: + service-url: ${OVERVIEW_SERVICE_URL:http://127.0.0.1:5173/_app/digital} + intelligent-data: service-url: ${INTELLIGENT_DATA_SERVICE_URL:http://192.168.2.106:3000/test-console} diff --git a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-test.sample.yml b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-test.sample.yml index 42e71ac3..66f0087b 100644 --- a/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-test.sample.yml +++ b/qiming-backend/app-platform-bootstrap/app-platform-web-bootstrap/src/main/resources/application-test.sample.yml @@ -182,6 +182,9 @@ eco-market: mcp: proxy-base-url: ${MCP_PROXY_URL:http://localhost:8020} +overview-page: + service-url: ${OVERVIEW_SERVICE_URL:http://127.0.0.1:5173/_app/digital} + intelligent-data: service-url: ${INTELLIGENT_DATA_SERVICE_URL:http://192.168.2.106:3000/test-console} diff --git a/qiming-backend/app-platform-modules/platform-system/system-application/src/main/java/com/xspaceagi/system/application/dto/TenantConfigDto.java b/qiming-backend/app-platform-modules/platform-system/system-application/src/main/java/com/xspaceagi/system/application/dto/TenantConfigDto.java index ab3fbcbc..a72700cf 100644 --- a/qiming-backend/app-platform-modules/platform-system/system-application/src/main/java/com/xspaceagi/system/application/dto/TenantConfigDto.java +++ b/qiming-backend/app-platform-modules/platform-system/system-application/src/main/java/com/xspaceagi/system/application/dto/TenantConfigDto.java @@ -179,6 +179,9 @@ public class TenantConfigDto implements Serializable { @Schema(description = "模型API根地址") private String baseModelApiUrl; + @Schema(description = "客户端概览服务地址") + private String overviewServiceUrl; + @Schema(description = "智能取数服务地址") private String intelligentDataServiceUrl; diff --git a/qiming-backend/app-platform-modules/platform-system/system-infra/src/main/java/com/xspaceagi/system/infra/dao/service/impl/TenantConfigServiceImpl.java b/qiming-backend/app-platform-modules/platform-system/system-infra/src/main/java/com/xspaceagi/system/infra/dao/service/impl/TenantConfigServiceImpl.java index 8daa52a7..ea3b58b0 100644 --- a/qiming-backend/app-platform-modules/platform-system/system-infra/src/main/java/com/xspaceagi/system/infra/dao/service/impl/TenantConfigServiceImpl.java +++ b/qiming-backend/app-platform-modules/platform-system/system-infra/src/main/java/com/xspaceagi/system/infra/dao/service/impl/TenantConfigServiceImpl.java @@ -72,6 +72,18 @@ public class TenantConfigServiceImpl extends ServiceImpl("client"); + const [activeTab, setActiveTab] = useState("overview"); const [activeNavKey, setActiveNavKey] = useState("overview"); const [sessionsAutoOpen, setSessionsAutoOpen] = useState(false); const [aiAgentLaunchContext, setAiAgentLaunchContext] = @@ -1039,7 +1041,7 @@ function App() { await logout(); await handleAuthChange(); setIsLoggedIn(false); - setActiveTab("client"); + setActiveTab("overview"); setActiveNavKey("overview"); setServices([]); setServicesLoading(false); @@ -1057,7 +1059,7 @@ function App() { setActiveNavKey(key); if (key === "overview") { - setActiveTab("client"); + setActiveTab("overview"); return; } @@ -1109,7 +1111,7 @@ function App() { return; } - setActiveTab("client"); + setActiveTab("overview"); }, []); const handleLegacySelect = useCallback((key: LegacyTabKey) => { @@ -1358,6 +1360,7 @@ function App() {
+ {activeTab === "overview" && } {activeTab === "client" && ( { diff --git a/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/ConfiguredServicePage.tsx b/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/ConfiguredServicePage.tsx index 44d21653..8f6ae254 100644 --- a/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/ConfiguredServicePage.tsx +++ b/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/ConfiguredServicePage.tsx @@ -6,13 +6,16 @@ import styles from "../../styles/components/ConfiguredServicePage.module.css"; interface ConfiguredServicePageProps { title: string; loadServiceUrl: () => Promise; + fitContentWidth?: number; } function ConfiguredServicePage({ title, loadServiceUrl, + fitContentWidth, }: ConfiguredServicePageProps) { const webviewRef = useRef(null); + const webviewReadyRef = useRef(false); const [serviceUrl, setServiceUrl] = useState(null); const [loadingConfig, setLoadingConfig] = useState(true); const [loadingPage, setLoadingPage] = useState(false); @@ -37,14 +40,36 @@ function ConfiguredServicePage({ void loadService(); }, [loadService]); + const applyPageScale = useCallback(() => { + if (!fitContentWidth || !webviewReadyRef.current) return; + + const element = webviewRef.current as any; + const availableWidth = element?.clientWidth; + if (!availableWidth || typeof element?.setZoomFactor !== "function") { + return; + } + + const zoomFactor = Math.max( + 0.35, + Math.min(1, availableWidth / fitContentWidth), + ); + element.setZoomFactor(Number(zoomFactor.toFixed(3))); + }, [fitContentWidth]); + useEffect(() => { const element = webviewRef.current as any; if (!element || !serviceUrl) return; + webviewReadyRef.current = false; + const handleStart = () => { setLoadingPage(true); setError(null); }; + const handleReady = () => { + webviewReadyRef.current = true; + applyPageScale(); + }; const handleStop = () => setLoadingPage(false); const handleFailure = (event: any) => { if (event.errorCode !== -3) { @@ -56,14 +81,24 @@ function ConfiguredServicePage({ }; element.addEventListener("did-start-loading", handleStart); + element.addEventListener("dom-ready", handleReady); element.addEventListener("did-stop-loading", handleStop); element.addEventListener("did-fail-load", handleFailure); + + const resizeObserver = fitContentWidth + ? new ResizeObserver(applyPageScale) + : null; + resizeObserver?.observe(element); + return () => { + resizeObserver?.disconnect(); + webviewReadyRef.current = false; element.removeEventListener("did-start-loading", handleStart); + element.removeEventListener("dom-ready", handleReady); element.removeEventListener("did-stop-loading", handleStop); element.removeEventListener("did-fail-load", handleFailure); }; - }, [serviceUrl, title]); + }, [applyPageScale, fitContentWidth, serviceUrl, title]); const handleReload = useCallback(() => { const element = webviewRef.current as any; diff --git a/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/OverviewPage.tsx b/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/OverviewPage.tsx new file mode 100644 index 00000000..3c638490 --- /dev/null +++ b/qimingclaw/crates/agent-electron-client/src/renderer/components/pages/OverviewPage.tsx @@ -0,0 +1,15 @@ +import React from "react"; +import { fetchOverviewServiceUrl } from "../../services/core/servicePages"; +import ConfiguredServicePage from "./ConfiguredServicePage"; + +function OverviewPage() { + return ( + + ); +} + +export default OverviewPage; diff --git a/qimingclaw/crates/agent-electron-client/src/renderer/services/core/servicePages.ts b/qimingclaw/crates/agent-electron-client/src/renderer/services/core/servicePages.ts index 0b73230c..d9ed3a19 100644 --- a/qimingclaw/crates/agent-electron-client/src/renderer/services/core/servicePages.ts +++ b/qimingclaw/crates/agent-electron-client/src/renderer/services/core/servicePages.ts @@ -7,12 +7,14 @@ import { getDomainTokenKey } from "@shared/utils/domain"; import { normalizeServerHost } from "./auth"; const SUCCESS_CODE = "0000"; +const OVERVIEW_FALLBACK_URL = "http://127.0.0.1:5173/_app/digital"; const INTELLIGENT_DATA_FALLBACK_URL = "http://192.168.2.106:3000/test-console"; interface TenantConfigResponse { code: string; message?: string; data?: { + overviewServiceUrl?: string; intelligentDataServiceUrl?: string; documentEditorServiceUrl?: string; }; @@ -77,6 +79,14 @@ async function fetchTenantConfig(): Promise { return result.data; } +export async function fetchOverviewServiceUrl(): Promise { + const config = await fetchTenantConfig(); + return normalizeServiceUrl( + config?.overviewServiceUrl || OVERVIEW_FALLBACK_URL, + "概览", + ); +} + export async function fetchIntelligentDataServiceUrl(): Promise { const config = await fetchTenantConfig(); return normalizeServiceUrl(