feat(platform): expose amap server readiness
This commit is contained in:
@@ -361,6 +361,7 @@ export interface OpsHealth {
|
||||
export interface RuntimeInfo {
|
||||
requestTimeoutMs: number;
|
||||
amapWebJsConfigured?: boolean;
|
||||
amapApiConfigured?: boolean;
|
||||
amapSecurityProxyEnabled?: boolean;
|
||||
amapSecurityCodeExposed?: boolean;
|
||||
amapSecurityServiceHost?: string;
|
||||
|
||||
@@ -105,6 +105,7 @@ export function OpsQuality() {
|
||||
<Card bordered title="地图安全配置" loading={loading} style={{ marginTop: 16 }}>
|
||||
<Space wrap>
|
||||
<Tag color={runtime?.amapWebJsConfigured ? 'green' : 'orange'}>{runtime?.amapWebJsConfigured ? 'Web JS Key 已配置' : 'Web JS Key 未配置'}</Tag>
|
||||
<Tag color={runtime?.amapApiConfigured ? 'green' : 'orange'}>{runtime?.amapApiConfigured ? '服务端 API Key 已配置' : '服务端 API Key 未配置'}</Tag>
|
||||
<Tag color={amapSecurityColor(health)}>{amapSecurityText(health)}</Tag>
|
||||
<Tag color={runtime?.amapSecurityProxyEnabled ? 'green' : 'grey'}>{runtime?.amapSecurityServiceHost || '代理未启用'}</Tag>
|
||||
</Space>
|
||||
|
||||
@@ -368,6 +368,12 @@ export function Realtime({
|
||||
color: amapConfigured ? 'green' as const : 'orange' as const,
|
||||
detail: amapConfigured ? '前端可加载高德 Web JS API。' : '缺少公开 Key,地图将使用坐标预览。'
|
||||
},
|
||||
{
|
||||
label: '服务端 API Key',
|
||||
value: runtime?.amapApiConfigured ? '已配置' : '未配置',
|
||||
color: runtime?.amapApiConfigured ? 'green' as const : 'orange' as const,
|
||||
detail: runtime?.amapApiConfigured ? '后端可支持地理编码、路线、围栏等服务端地图能力。' : '服务端地图能力未配置,后续地理服务会降级。'
|
||||
},
|
||||
{
|
||||
label: '安全代理',
|
||||
value: amapSecurityServiceHost || '未启用',
|
||||
|
||||
@@ -3351,6 +3351,7 @@ test('renders ops quality as a standalone runtime health page', async () => {
|
||||
requestTimeoutMs: 5000,
|
||||
platformRelease: 'platform-ops-test',
|
||||
amapWebJsConfigured: true,
|
||||
amapApiConfigured: true,
|
||||
amapSecurityProxyEnabled: true,
|
||||
amapSecurityCodeExposed: false,
|
||||
amapSecurityServiceHost: '/_AMapService'
|
||||
@@ -3380,6 +3381,7 @@ test('renders ops quality as a standalone runtime health page', async () => {
|
||||
expect(screen.getByText('368')).toBeInTheDocument();
|
||||
expect(screen.getByText('TDengine 写入')).toBeInTheDocument();
|
||||
expect(screen.getByText('MySQL 写入')).toBeInTheDocument();
|
||||
expect(screen.getByText('服务端 API Key 已配置')).toBeInTheDocument();
|
||||
expect(screen.getByText('/_AMapService')).toBeInTheDocument();
|
||||
expect(screen.getByText('安全码未暴露')).toBeInTheDocument();
|
||||
expect(screen.getByText('gb32960-gateway')).toBeInTheDocument();
|
||||
@@ -8133,6 +8135,7 @@ test('shows production AMap integration status on realtime page', async () => {
|
||||
runtime: {
|
||||
requestTimeoutMs: 5000,
|
||||
amapWebJsConfigured: true,
|
||||
amapApiConfigured: true,
|
||||
amapSecurityProxyEnabled: true,
|
||||
amapSecurityCodeExposed: false,
|
||||
amapSecurityServiceHost: '/_AMapService',
|
||||
@@ -8214,6 +8217,7 @@ test('shows production AMap integration status on realtime page', async () => {
|
||||
|
||||
expect(await screen.findByText('地图接入状态')).toBeInTheDocument();
|
||||
expect(screen.getByText('Web JS Key')).toBeInTheDocument();
|
||||
expect(screen.getByText('服务端 API Key')).toBeInTheDocument();
|
||||
expect(screen.getAllByText('已配置').length).toBeGreaterThan(0);
|
||||
expect(screen.getByText('安全代理')).toBeInTheDocument();
|
||||
expect(screen.getByText('/_AMapService')).toBeInTheDocument();
|
||||
|
||||
Reference in New Issue
Block a user