feat(platform): expose deployed release

This commit is contained in:
lingniu
2026-07-04 15:34:37 +08:00
parent 1f069178d6
commit ff36cb4bd1
9 changed files with 32 additions and 1 deletions

View File

@@ -338,6 +338,7 @@ export interface RuntimeInfo {
amapSecurityProxyEnabled?: boolean;
amapSecurityCodeExposed?: boolean;
amapSecurityServiceHost?: string;
platformRelease?: string;
}
export interface Page<T> {

View File

@@ -294,6 +294,12 @@ export function Realtime({
color: amapSecurityCodeExposed ? 'red' as const : 'green' as const,
detail: amapSecurityCodeExposed ? '当前安全码会下发到浏览器,只建议调试使用。' : '生产安全码保持在服务端环境变量中。'
},
{
label: '当前版本',
value: runtime?.platformRelease || '未标记',
color: runtime?.platformRelease ? 'blue' as const : 'grey' as const,
detail: runtime?.platformRelease ? '当前 ECS 正在运行的车辆中台 release。' : '未注入 PLATFORM_RELEASE部署追踪会降级。'
},
{
label: '定位覆盖',
value: `${locatedCount.toLocaleString()} / ${rows.length.toLocaleString()}`,

View File

@@ -7476,7 +7476,8 @@ test('shows production AMap integration status on realtime page', async () => {
amapWebJsConfigured: true,
amapSecurityProxyEnabled: true,
amapSecurityCodeExposed: false,
amapSecurityServiceHost: '/_AMapService'
amapSecurityServiceHost: '/_AMapService',
platformRelease: 'platform-20260704153005'
}
},
traceId: 'trace-test',
@@ -7557,6 +7558,8 @@ test('shows production AMap integration status on realtime page', async () => {
expect(screen.getAllByText('已配置').length).toBeGreaterThan(0);
expect(screen.getByText('安全代理')).toBeInTheDocument();
expect(screen.getByText('/_AMapService')).toBeInTheDocument();
expect(screen.getByText('当前版本')).toBeInTheDocument();
expect(screen.getByText('platform-20260704153005')).toBeInTheDocument();
expect(screen.getByText('定位覆盖')).toBeInTheDocument();
expect(screen.getByText('1 / 2')).toBeInTheDocument();
});