feat(platform-web): show searched vehicle service status
This commit is contained in:
@@ -11,6 +11,7 @@ import {
|
||||
} from '@douyinfe/semi-icons';
|
||||
import type { ReactNode } from 'react';
|
||||
import { useState } from 'react';
|
||||
import type { VehicleServiceStatus } from '../api/types';
|
||||
|
||||
export type PageKey = 'dashboard' | 'vehicles' | 'realtime' | 'detail' | 'history' | 'mileage' | 'quality';
|
||||
|
||||
@@ -34,12 +35,14 @@ function linkHealthClassName(count: number | null) {
|
||||
export function AppShell({
|
||||
activePage,
|
||||
linkIssueCount,
|
||||
currentVehicleStatus,
|
||||
onChange,
|
||||
onVehicleSearch,
|
||||
children
|
||||
}: {
|
||||
activePage: PageKey;
|
||||
linkIssueCount: number | null;
|
||||
currentVehicleStatus?: VehicleServiceStatus;
|
||||
onChange: (page: PageKey) => void;
|
||||
onVehicleSearch: (keyword: string) => void | Promise<void>;
|
||||
children: ReactNode;
|
||||
@@ -86,6 +89,11 @@ export function AppShell({
|
||||
<Button theme="solid" type="primary" loading={searching} onClick={search}>查询车辆</Button>
|
||||
</Space>
|
||||
<Space spacing={12}>
|
||||
{currentVehicleStatus ? (
|
||||
<Tag color={currentVehicleStatus.severity === 'ok' ? 'green' : currentVehicleStatus.severity === 'error' ? 'red' : 'orange'}>
|
||||
当前车辆:{currentVehicleStatus.title}
|
||||
</Tag>
|
||||
) : null}
|
||||
<Tag color="blue">生产环境</Tag>
|
||||
<Tag color="grey">多源接入 / 一个车辆服务</Tag>
|
||||
<Button size="small" className={linkHealthClassName(linkIssueCount)} onClick={() => onChange('quality')}>
|
||||
|
||||
Reference in New Issue
Block a user