Make starter project delivery-ready
This commit is contained in:
1 parent
5b300dee0d
commit
d7bfde754b
22 files changed
+695
-71
No files matched your search
@@ -0,0 +1,10 @@
|
|||||||
|
node_modules
|
||||||
|
**/node_modules
|
||||||
|
dist
|
||||||
|
**/dist
|
||||||
|
.git
|
||||||
|
.env
|
||||||
|
.env.*
|
||||||
|
!.env.example
|
||||||
|
coverage
|
||||||
|
*.log
|
||||||
@@ -0,0 +1,3 @@
|
|||||||
|
VITE_API_BASE_URL=http://localhost:3000
|
||||||
|
VITE_WS_URL=ws://localhost:3000/ws/screen
|
||||||
|
VITE_ENABLE_STAGE_DEBUG=true
|
||||||
@@ -2,6 +2,7 @@ node_modules/
|
|||||||
dist/
|
dist/
|
||||||
.env
|
.env
|
||||||
.env.*
|
.env.*
|
||||||
|
!.env.example
|
||||||
.DS_Store
|
.DS_Store
|
||||||
*.log
|
*.log
|
||||||
coverage/
|
coverage/
|
||||||
|
|||||||
+23
@@ -0,0 +1,23 @@
|
|||||||
|
FROM node:22-alpine AS build
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
RUN corepack enable
|
||||||
|
|
||||||
|
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml tsconfig.base.json ./
|
||||||
|
COPY packages ./packages
|
||||||
|
COPY apps ./apps
|
||||||
|
COPY templates ./templates
|
||||||
|
|
||||||
|
RUN pnpm install --frozen-lockfile
|
||||||
|
ARG APP_FILTER=@dev-screen-starter/demo-screen
|
||||||
|
RUN pnpm --filter ${APP_FILTER:-@dev-screen-starter/demo-screen} build
|
||||||
|
|
||||||
|
FROM nginx:1.27-alpine
|
||||||
|
|
||||||
|
ARG APP_PATH=apps/demo-screen
|
||||||
|
|
||||||
|
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
|
COPY --from=build /app/${APP_PATH}/dist /usr/share/nginx/html
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
@@ -101,3 +101,4 @@ pnpm build
|
|||||||
- [交付流程](doc/delivery-workflow.md)
|
- [交付流程](doc/delivery-workflow.md)
|
||||||
- [图表工厂与 visual-kit 使用教程](doc/charts-and-visual-kit-guide.md)
|
- [图表工厂与 visual-kit 使用教程](doc/charts-and-visual-kit-guide.md)
|
||||||
- [外部数据接入设计与使用教程](doc/data-integration-guide.md)
|
- [外部数据接入设计与使用教程](doc/data-integration-guide.md)
|
||||||
|
- [部署与上线检查清单](doc/deployment-and-checklist.md)
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
import {
|
import {
|
||||||
|
ChartPanel,
|
||||||
createAreaTrendOption,
|
createAreaTrendOption,
|
||||||
createDualAxisOption,
|
createDualAxisOption,
|
||||||
createGaugeOption,
|
createGaugeOption,
|
||||||
@@ -6,9 +7,8 @@ import {
|
|||||||
createRadarOption,
|
createRadarOption,
|
||||||
createRankBarOption,
|
createRankBarOption,
|
||||||
createStackedBarOption,
|
createStackedBarOption,
|
||||||
EChart
|
|
||||||
} from '@dev-screen-starter/charts'
|
} from '@dev-screen-starter/charts'
|
||||||
import { MetricCard, Panel, ScreenStage, type ScaleMode } from '@dev-screen-starter/screen-core'
|
import { MetricCard, ScreenStage, type ScaleMode } from '@dev-screen-starter/screen-core'
|
||||||
import {
|
import {
|
||||||
CornerFrame,
|
CornerFrame,
|
||||||
Divider,
|
Divider,
|
||||||
@@ -112,75 +112,80 @@ export function DemoOverview() {
|
|||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section className="chart-grid">
|
<section className="chart-grid">
|
||||||
<Panel title="面积趋势:吞吐走势">
|
<ChartPanel
|
||||||
{capacityTrend ? (
|
title="面积趋势:吞吐走势"
|
||||||
<EChart
|
option={
|
||||||
option={createAreaTrendOption({
|
capacityTrend
|
||||||
|
? createAreaTrendOption({
|
||||||
categories: capacityTrend.xAxis,
|
categories: capacityTrend.xAxis,
|
||||||
series: capacityTrend.series
|
series: capacityTrend.series
|
||||||
})}
|
})
|
||||||
/>
|
: null
|
||||||
) : null}
|
}
|
||||||
</Panel>
|
/>
|
||||||
|
|
||||||
<Panel title="堆叠柱:区域订单">
|
<ChartPanel
|
||||||
{stackedOrders ? (
|
title="堆叠柱:区域订单"
|
||||||
<EChart
|
option={
|
||||||
option={createStackedBarOption({
|
stackedOrders
|
||||||
|
? createStackedBarOption({
|
||||||
categories: stackedOrders.categories,
|
categories: stackedOrders.categories,
|
||||||
series: stackedOrders.series
|
series: stackedOrders.series
|
||||||
})}
|
})
|
||||||
/>
|
: null
|
||||||
) : null}
|
}
|
||||||
</Panel>
|
/>
|
||||||
|
|
||||||
<Panel title="排名条:区域排行">
|
<ChartPanel
|
||||||
{regionRank ? (
|
title="排名条:区域排行"
|
||||||
<EChart
|
option={
|
||||||
option={createRankBarOption({
|
regionRank
|
||||||
|
? createRankBarOption({
|
||||||
categories: regionRank.categories,
|
categories: regionRank.categories,
|
||||||
values: regionRank.values,
|
values: regionRank.values,
|
||||||
name: '订单',
|
name: '订单',
|
||||||
color: '#7aa7ff'
|
color: '#7aa7ff'
|
||||||
})}
|
})
|
||||||
/>
|
: null
|
||||||
) : null}
|
}
|
||||||
</Panel>
|
/>
|
||||||
|
|
||||||
<Panel title="玫瑰图:异常来源">
|
<ChartPanel title="玫瑰图:异常来源" option={createRosePieOption({ data: issueRose })} />
|
||||||
<EChart option={createRosePieOption({ data: issueRose })} />
|
|
||||||
</Panel>
|
|
||||||
|
|
||||||
<Panel title="双轴图:订单与履约">
|
<ChartPanel
|
||||||
{fulfillmentMix ? (
|
title="双轴图:订单与履约"
|
||||||
<EChart
|
option={
|
||||||
option={createDualAxisOption({
|
fulfillmentMix
|
||||||
|
? createDualAxisOption({
|
||||||
categories: fulfillmentMix.categories,
|
categories: fulfillmentMix.categories,
|
||||||
leftName: '订单',
|
leftName: '订单',
|
||||||
rightName: '履约率',
|
rightName: '履约率',
|
||||||
bar: { name: '订单', values: fulfillmentMix.orders, color: '#63a4ff' },
|
bar: { name: '订单', values: fulfillmentMix.orders, color: '#63a4ff' },
|
||||||
line: { name: '履约率', values: fulfillmentMix.rates, color: '#d8a13e' }
|
line: { name: '履约率', values: fulfillmentMix.rates, color: '#d8a13e' }
|
||||||
})}
|
})
|
||||||
/>
|
: null
|
||||||
) : null}
|
}
|
||||||
</Panel>
|
/>
|
||||||
|
|
||||||
<Panel title="雷达图:运营质量">
|
<ChartPanel
|
||||||
{qualityRadar ? (
|
title="雷达图:运营质量"
|
||||||
<EChart
|
option={
|
||||||
option={createRadarOption({
|
qualityRadar
|
||||||
|
? createRadarOption({
|
||||||
indicators: qualityRadar.indicators,
|
indicators: qualityRadar.indicators,
|
||||||
values: qualityRadar.values,
|
values: qualityRadar.values,
|
||||||
name: '质量评分',
|
name: '质量评分',
|
||||||
color: '#d8a13e'
|
color: '#d8a13e'
|
||||||
})}
|
})
|
||||||
/>
|
: null
|
||||||
) : null}
|
}
|
||||||
</Panel>
|
/>
|
||||||
|
|
||||||
<Panel title="仪表盘:履约率" className="compact-panel">
|
<ChartPanel
|
||||||
<EChart option={createGaugeOption({ name: '履约率', value: 87, unit: '%', color: '#56d08a' })} />
|
title="仪表盘:履约率"
|
||||||
</Panel>
|
className="compact-panel"
|
||||||
|
option={createGaugeOption({ name: '履约率', value: 87, unit: '%', color: '#56d08a' })}
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
</ScreenStage>
|
</ScreenStage>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -170,9 +170,12 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.screen-panel header {
|
.screen-panel header {
|
||||||
|
align-items: center;
|
||||||
color: #d7e6f7;
|
color: #d7e6f7;
|
||||||
|
display: flex;
|
||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
|
justify-content: space-between;
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -202,6 +205,28 @@ body {
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chart-panel-body {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-panel-extra {
|
||||||
|
color: #88a1bd;
|
||||||
|
font-size: 12px;
|
||||||
|
font-weight: 400;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-panel-state {
|
||||||
|
align-items: center;
|
||||||
|
color: #88a1bd;
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-panel-state.is-error {
|
||||||
|
color: #ff9fa7;
|
||||||
|
}
|
||||||
|
|
||||||
.debug-badge {
|
.debug-badge {
|
||||||
background: rgb(3 8 13 / 80%);
|
background: rgb(3 8 13 / 80%);
|
||||||
border: 1px solid rgb(100 135 170 / 35%);
|
border: 1px solid rgb(100 135 170 / 35%);
|
||||||
|
|||||||
@@ -0,0 +1,17 @@
|
|||||||
|
server {
|
||||||
|
listen 80;
|
||||||
|
server_name _;
|
||||||
|
|
||||||
|
root /usr/share/nginx/html;
|
||||||
|
index index.html;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.html;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /assets/ {
|
||||||
|
expires 30d;
|
||||||
|
add_header Cache-Control "public, immutable";
|
||||||
|
try_files $uri =404;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -166,6 +166,11 @@ const sources = defineDataSources({
|
|||||||
字段说明:
|
字段说明:
|
||||||
|
|
||||||
- `url`: 请求地址。
|
- `url`: 请求地址。
|
||||||
|
- `baseUrl`: API 基础地址,建议来自 `.env`。
|
||||||
|
- `query`: 查询参数。
|
||||||
|
- `headers`: 静态 header 或返回 header 的函数。
|
||||||
|
- `authToken`: token 字符串或返回 token 的函数,会自动写入 `Authorization: Bearer <token>`。
|
||||||
|
- `timeoutMs`: 超时时间。
|
||||||
- `init`: `fetch` 的 RequestInit 参数。
|
- `init`: `fetch` 的 RequestInit 参数。
|
||||||
- `intervalMs`: 轮询间隔,不传则只请求一次。
|
- `intervalMs`: 轮询间隔,不传则只请求一次。
|
||||||
- `immediate`: 是否立即请求,默认 `true`。
|
- `immediate`: 是否立即请求,默认 `true`。
|
||||||
@@ -186,6 +191,8 @@ const sources = defineDataSources({
|
|||||||
url: 'ws://localhost:3000/ws/alerts',
|
url: 'ws://localhost:3000/ws/alerts',
|
||||||
mode: 'append',
|
mode: 'append',
|
||||||
maxItems: 20,
|
maxItems: 20,
|
||||||
|
reconnect: { enabled: true, maxRetries: 10, delayMs: 3000 },
|
||||||
|
heartbeat: { message: 'ping', intervalMs: 30000 },
|
||||||
transform: (raw) => ({
|
transform: (raw) => ({
|
||||||
time: raw.time,
|
time: raw.time,
|
||||||
message: raw.message
|
message: raw.message
|
||||||
@@ -200,6 +207,8 @@ const sources = defineDataSources({
|
|||||||
- `protocols`: 可选 WebSocket protocols。
|
- `protocols`: 可选 WebSocket protocols。
|
||||||
- `mode`: `replace` 或 `append`,默认 `replace`。
|
- `mode`: `replace` 或 `append`,默认 `replace`。
|
||||||
- `maxItems`: `append` 模式最多保留多少条。
|
- `maxItems`: `append` 模式最多保留多少条。
|
||||||
|
- `reconnect`: 断线重连设置。
|
||||||
|
- `heartbeat`: 心跳消息设置。
|
||||||
- `transform`: 单条消息的清洗函数。
|
- `transform`: 单条消息的清洗函数。
|
||||||
|
|
||||||
WebSocket 消息如果是字符串,会优先尝试 `JSON.parse`。如果不是 JSON,会把原始字符串传给 `transform`。
|
WebSocket 消息如果是字符串,会优先尝试 `JSON.parse`。如果不是 JSON,会把原始字符串传给 `transform`。
|
||||||
|
|||||||
@@ -0,0 +1,104 @@
|
|||||||
|
# 部署与上线检查清单
|
||||||
|
|
||||||
|
本文档用于客户大屏项目交付前的最后检查。
|
||||||
|
|
||||||
|
## 1. 本地构建
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm install
|
||||||
|
pnpm typecheck
|
||||||
|
pnpm build
|
||||||
|
```
|
||||||
|
|
||||||
|
单个客户项目构建:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
pnpm --filter @dev-screen-starter/customer-a build
|
||||||
|
```
|
||||||
|
|
||||||
|
## 2. 环境变量
|
||||||
|
|
||||||
|
新项目会带 `.env.example`:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
VITE_API_BASE_URL=http://localhost:3000
|
||||||
|
VITE_WS_URL=ws://localhost:3000/ws/screen
|
||||||
|
VITE_ENABLE_STAGE_DEBUG=true
|
||||||
|
```
|
||||||
|
|
||||||
|
交付环境建议:
|
||||||
|
|
||||||
|
- 开发环境可以打开 `VITE_ENABLE_STAGE_DEBUG=true`。
|
||||||
|
- 生产环境建议关闭调试浮层。
|
||||||
|
- API 和 WebSocket 地址不要写死在组件里,统一放到 `dataSources.ts` 或 `.env`。
|
||||||
|
|
||||||
|
## 3. Nginx 静态部署
|
||||||
|
|
||||||
|
构建完成后,把对应项目的 `dist` 发布到静态服务器。
|
||||||
|
|
||||||
|
示例 Nginx 配置在:
|
||||||
|
|
||||||
|
```txt
|
||||||
|
deploy/nginx.conf
|
||||||
|
```
|
||||||
|
|
||||||
|
## 4. Docker 部署
|
||||||
|
|
||||||
|
默认构建 demo:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build -t dev-screen-demo .
|
||||||
|
docker run --rm -p 8080:80 dev-screen-demo
|
||||||
|
```
|
||||||
|
|
||||||
|
构建指定客户项目:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
docker build \
|
||||||
|
--build-arg APP_FILTER=@dev-screen-starter/customer-a \
|
||||||
|
--build-arg APP_PATH=apps/customer-a \
|
||||||
|
-t customer-a-screen .
|
||||||
|
```
|
||||||
|
|
||||||
|
## 5. 屏幕适配验收
|
||||||
|
|
||||||
|
至少检查这些尺寸:
|
||||||
|
|
||||||
|
- `1366x768`
|
||||||
|
- `1920x1080`
|
||||||
|
- `2560x1440`
|
||||||
|
- `3840x2160`
|
||||||
|
|
||||||
|
至少检查这些模式:
|
||||||
|
|
||||||
|
- `?scaleMode=fit`
|
||||||
|
- `?scaleMode=fill`
|
||||||
|
- `?scaleMode=stretch`
|
||||||
|
|
||||||
|
默认建议生产使用 `fit`。
|
||||||
|
|
||||||
|
## 6. 数据接入检查
|
||||||
|
|
||||||
|
- HTTP 数据源是否配置 `baseUrl`、`timeoutMs`、错误兜底。
|
||||||
|
- WebSocket 是否配置 `reconnect` 和 `heartbeat`。
|
||||||
|
- 实时列表是否设置 `maxItems`。
|
||||||
|
- 图表数据是否在 `transform` 中清洗成组件需要的结构。
|
||||||
|
- 断网、接口 500、空数据时页面是否仍可读。
|
||||||
|
|
||||||
|
## 7. 视觉检查
|
||||||
|
|
||||||
|
- 标题、指标、图例、坐标轴在 1080p 和 4K 下都清晰。
|
||||||
|
- 自动滚动列表没有超出父容器。
|
||||||
|
- 图表容器没有空白 canvas。
|
||||||
|
- 关键数字没有挤压、换行或遮挡。
|
||||||
|
- 客户看屏页面不出现开发调试信息。
|
||||||
|
|
||||||
|
## 8. 上线前清单
|
||||||
|
|
||||||
|
- `pnpm typecheck` 通过。
|
||||||
|
- `pnpm build` 通过。
|
||||||
|
- 客户接口地址已切换为正式地址。
|
||||||
|
- `.env` 未提交到 git。
|
||||||
|
- 生产关闭 `VITE_ENABLE_STAGE_DEBUG`。
|
||||||
|
- 浏览器全屏查看无滚动条、无遮挡。
|
||||||
|
- 大屏实际设备上验收一次。
|
||||||
+10
-1
@@ -146,6 +146,8 @@ const metrics = data.metrics.data ?? []
|
|||||||
|
|
||||||
其中 `mockSource`、`httpSource`、`websocketSource` 已可用;`mqttSource`、`signalrSource` 已预留类型和声明入口,具体 SDK 在客户项目需要时再接。
|
其中 `mockSource`、`httpSource`、`websocketSource` 已可用;`mqttSource`、`signalrSource` 已预留类型和声明入口,具体 SDK 在客户项目需要时再接。
|
||||||
|
|
||||||
|
HTTP 数据源支持 `baseUrl`、`query`、`headers`、`authToken`、`timeoutMs`。WebSocket 数据源支持断线重连和心跳。
|
||||||
|
|
||||||
## 5. debug
|
## 5. debug
|
||||||
|
|
||||||
`debug` 提供开发时调试组件。
|
`debug` 提供开发时调试组件。
|
||||||
@@ -189,7 +191,14 @@ const metrics = data.metrics.data ?? []
|
|||||||
|
|
||||||
## 7. 项目模板
|
## 7. 项目模板
|
||||||
|
|
||||||
`templates/project-basic` 是新客户项目起点。
|
`templates/project-basic` 是新客户项目起点,默认包含:
|
||||||
|
|
||||||
|
- `ScreenStage` 适配和 debug。
|
||||||
|
- `dataSources.ts` 页面级数据源声明。
|
||||||
|
- `mockData.ts` 本地 mock 数据。
|
||||||
|
- `ChartPanel` 图表面板。
|
||||||
|
- `visual-kit` 状态区和告警区。
|
||||||
|
- `.env.example` 接口配置示例。
|
||||||
|
|
||||||
创建命令:
|
创建命令:
|
||||||
|
|
||||||
|
|||||||
+5
-3
@@ -129,12 +129,14 @@ doc/
|
|||||||
- 图表工厂覆盖常用交付场景,并保留 ECharts 原生 option 覆盖能力。
|
- 图表工厂覆盖常用交付场景,并保留 ECharts 原生 option 覆盖能力。
|
||||||
- demo-screen 已包含状态区、运行事件、指标卡、趋势、堆叠、排行、玫瑰、双轴、雷达和仪表盘示例。
|
- demo-screen 已包含状态区、运行事件、指标卡、趋势、堆叠、排行、玫瑰、双轴、雷达和仪表盘示例。
|
||||||
- `data` 包已新增统一数据源设计,支持页面集中声明 mock、HTTP、WebSocket 数据源,并预留 MQTT、SignalR 类型。
|
- `data` 包已新增统一数据源设计,支持页面集中声明 mock、HTTP、WebSocket 数据源,并预留 MQTT、SignalR 类型。
|
||||||
|
- `project-basic` 模板已升级,默认包含数据源声明、图表面板、visual-kit、`.env.example` 和屏幕适配 debug。
|
||||||
|
- 新增 `ChartPanel`,封装图表标题、loading、empty、error 和 ECharts 容器。
|
||||||
|
- 新增 Dockerfile、Nginx 配置和部署上线检查清单。
|
||||||
|
|
||||||
下一步建议:
|
下一步建议:
|
||||||
|
|
||||||
- 做 `ChartPanel` 组合组件,把 `Panel + EChart + loading/empty/error` 固化下来。
|
- 继续完善真实 MQTT、SignalR adapter。
|
||||||
- 给 `data` 包补 WebSocket 重连、心跳、鉴权 header/token 约定。
|
- 按客户项目沉淀更多模板分支,例如运营大屏、设备大屏、销售驾驶舱。
|
||||||
- 增加 `.env.example` 和项目级接口配置约定。
|
|
||||||
- 对 `ScreenStage` 做更多截图验收,覆盖 1366x768、1920x1080、4K 和不同 `scaleMode`。
|
- 对 `ScreenStage` 做更多截图验收,覆盖 1366x768、1920x1080、4K 和不同 `scaleMode`。
|
||||||
|
|
||||||
## 8. 成功标准
|
## 8. 成功标准
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
import type { EChartsOption } from 'echarts'
|
||||||
|
import type { ReactNode } from 'react'
|
||||||
|
import { EChart } from './EChart'
|
||||||
|
|
||||||
|
type ChartPanelProps = {
|
||||||
|
title: string
|
||||||
|
option?: EChartsOption | null
|
||||||
|
loading?: boolean
|
||||||
|
error?: string | null
|
||||||
|
empty?: boolean
|
||||||
|
emptyText?: string
|
||||||
|
className?: string
|
||||||
|
extra?: ReactNode
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ChartPanel({
|
||||||
|
title,
|
||||||
|
option,
|
||||||
|
loading = false,
|
||||||
|
error,
|
||||||
|
empty,
|
||||||
|
emptyText = '暂无数据',
|
||||||
|
className = '',
|
||||||
|
extra
|
||||||
|
}: ChartPanelProps) {
|
||||||
|
const isEmpty = empty ?? !option
|
||||||
|
|
||||||
|
return (
|
||||||
|
<section className={`screen-panel chart-panel ${className}`}>
|
||||||
|
<header>
|
||||||
|
<span>{title}</span>
|
||||||
|
{extra ? <div className="chart-panel-extra">{extra}</div> : null}
|
||||||
|
</header>
|
||||||
|
<div className="screen-panel-body chart-panel-body">
|
||||||
|
{error ? <div className="chart-panel-state is-error">{error}</div> : null}
|
||||||
|
{!error && isEmpty ? <div className="chart-panel-state">{emptyText}</div> : null}
|
||||||
|
{!error && !isEmpty && option ? <EChart option={option} loading={loading} /> : null}
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
)
|
||||||
|
}
|
||||||
@@ -1,3 +1,4 @@
|
|||||||
export * from './EChart'
|
export * from './EChart'
|
||||||
|
export * from './ChartPanel'
|
||||||
export * from './chartTheme'
|
export * from './chartTheme'
|
||||||
export * from './optionFactories'
|
export * from './optionFactories'
|
||||||
@@ -29,17 +29,35 @@ export type MockDataSource<Result> = BaseDataSource<Result, Result> & {
|
|||||||
export type HttpDataSource<Result, Raw = unknown> = BaseDataSource<Result, Raw> & {
|
export type HttpDataSource<Result, Raw = unknown> = BaseDataSource<Result, Raw> & {
|
||||||
type: 'http'
|
type: 'http'
|
||||||
url: string
|
url: string
|
||||||
|
baseUrl?: string
|
||||||
|
query?: Record<string, string | number | boolean | null | undefined>
|
||||||
|
headers?: HeadersInit | (() => HeadersInit)
|
||||||
|
authToken?: string | (() => string | null | undefined)
|
||||||
|
timeoutMs?: number
|
||||||
init?: RequestInit
|
init?: RequestInit
|
||||||
intervalMs?: number
|
intervalMs?: number
|
||||||
immediate?: boolean
|
immediate?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export type ReconnectOptions = {
|
||||||
|
enabled?: boolean
|
||||||
|
maxRetries?: number
|
||||||
|
delayMs?: number
|
||||||
|
}
|
||||||
|
|
||||||
|
export type HeartbeatOptions = {
|
||||||
|
message: string
|
||||||
|
intervalMs: number
|
||||||
|
}
|
||||||
|
|
||||||
export type WebSocketDataSource<Result, Raw = unknown> = BaseDataSource<Result, Raw> & {
|
export type WebSocketDataSource<Result, Raw = unknown> = BaseDataSource<Result, Raw> & {
|
||||||
type: 'websocket'
|
type: 'websocket'
|
||||||
url: string
|
url: string
|
||||||
protocols?: string | string[]
|
protocols?: string | string[]
|
||||||
mode?: RealtimeUpdateMode
|
mode?: RealtimeUpdateMode
|
||||||
maxItems?: number
|
maxItems?: number
|
||||||
|
reconnect?: boolean | ReconnectOptions
|
||||||
|
heartbeat?: string | HeartbeatOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SignalRDataSource<Result, Raw = unknown> = BaseDataSource<Result, Raw> & {
|
export type SignalRDataSource<Result, Raw = unknown> = BaseDataSource<Result, Raw> & {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useEffect, useMemo, useState } from 'react'
|
import { useEffect, useMemo, useState } from 'react'
|
||||||
import { requestJson } from './request'
|
import { requestJson } from './request'
|
||||||
import type { DataSource, DataSourceMap, DataState, DataStates, RealtimeUpdateMode } from './types'
|
import type { DataSource, DataSourceMap, DataState, DataStates, HeartbeatOptions, RealtimeUpdateMode } from './types'
|
||||||
|
|
||||||
function createInitialState(source: DataSource<unknown, unknown>): DataState<unknown> {
|
function createInitialState(source: DataSource<unknown, unknown>): DataState<unknown> {
|
||||||
return {
|
return {
|
||||||
@@ -56,6 +56,46 @@ function toErrorMessage(error: unknown): string {
|
|||||||
return error instanceof Error ? error.message : String(error)
|
return error instanceof Error ? error.message : String(error)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function resolveHeaders(sourceHeaders?: HeadersInit | (() => HeadersInit), authToken?: string | (() => string | null | undefined)): HeadersInit {
|
||||||
|
const headers = new Headers(typeof sourceHeaders === 'function' ? sourceHeaders() : sourceHeaders)
|
||||||
|
const token = typeof authToken === 'function' ? authToken() : authToken
|
||||||
|
|
||||||
|
if (token && !headers.has('authorization')) {
|
||||||
|
headers.set('authorization', `Bearer ${token}`)
|
||||||
|
}
|
||||||
|
|
||||||
|
return headers
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveHttpUrl(url: string, baseUrl?: string, query?: Record<string, string | number | boolean | null | undefined>): string {
|
||||||
|
const resolved = baseUrl ? new URL(url, baseUrl).toString() : url
|
||||||
|
|
||||||
|
if (!query) {
|
||||||
|
return resolved
|
||||||
|
}
|
||||||
|
|
||||||
|
const parsed = new URL(resolved, window.location.origin)
|
||||||
|
for (const [key, value] of Object.entries(query)) {
|
||||||
|
if (value !== null && value !== undefined) {
|
||||||
|
parsed.searchParams.set(key, String(value))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!baseUrl && url.startsWith('/')) {
|
||||||
|
return `${parsed.pathname}${parsed.search}`
|
||||||
|
}
|
||||||
|
|
||||||
|
return parsed.toString()
|
||||||
|
}
|
||||||
|
|
||||||
|
function resolveHeartbeat(heartbeat: string | HeartbeatOptions | undefined): HeartbeatOptions | null {
|
||||||
|
if (!heartbeat) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return typeof heartbeat === 'string' ? { message: heartbeat, intervalMs: 30000 } : heartbeat
|
||||||
|
}
|
||||||
|
|
||||||
export function useScreenDataSources<TSources extends DataSourceMap>(sources: TSources): DataStates<TSources> {
|
export function useScreenDataSources<TSources extends DataSourceMap>(sources: TSources): DataStates<TSources> {
|
||||||
const sourceEntries = useMemo(() => Object.entries(sources), [sources])
|
const sourceEntries = useMemo(() => Object.entries(sources), [sources])
|
||||||
|
|
||||||
@@ -124,10 +164,14 @@ export function useScreenDataSources<TSources extends DataSourceMap>(sources: TS
|
|||||||
abortController?.abort()
|
abortController?.abort()
|
||||||
abortController = new AbortController()
|
abortController = new AbortController()
|
||||||
updateState({ loading: true, error: null, status: 'connecting' })
|
updateState({ loading: true, error: null, status: 'connecting' })
|
||||||
|
const timeout = source.timeoutMs
|
||||||
|
? window.setTimeout(() => abortController?.abort(), source.timeoutMs)
|
||||||
|
: null
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const raw = await requestJson<unknown>(source.url, {
|
const raw = await requestJson<unknown>(resolveHttpUrl(source.url, source.baseUrl, source.query), {
|
||||||
...source.init,
|
...source.init,
|
||||||
|
headers: resolveHeaders(source.headers ?? source.init?.headers, source.authToken),
|
||||||
signal: abortController.signal
|
signal: abortController.signal
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -138,6 +182,10 @@ export function useScreenDataSources<TSources extends DataSourceMap>(sources: TS
|
|||||||
if (active && !(error instanceof DOMException && error.name === 'AbortError')) {
|
if (active && !(error instanceof DOMException && error.name === 'AbortError')) {
|
||||||
updateState({ loading: false, error: toErrorMessage(error), status: 'error' })
|
updateState({ loading: false, error: toErrorMessage(error), status: 'error' })
|
||||||
}
|
}
|
||||||
|
} finally {
|
||||||
|
if (timeout) {
|
||||||
|
window.clearTimeout(timeout)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -162,17 +210,69 @@ export function useScreenDataSources<TSources extends DataSourceMap>(sources: TS
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
updateState({ status: 'connecting', error: null })
|
let closedByCleanup = false
|
||||||
const socket = new WebSocket(source.url, source.protocols)
|
let retryCount = 0
|
||||||
|
let reconnectTimer: number | null = null
|
||||||
|
let heartbeatTimer: number | null = null
|
||||||
|
let socket: WebSocket | null = null
|
||||||
|
const reconnect = source.reconnect === undefined ? { enabled: true, maxRetries: 5, delayMs: 3000 } : source.reconnect
|
||||||
|
const reconnectOptions = typeof reconnect === 'boolean'
|
||||||
|
? { enabled: reconnect, maxRetries: 5, delayMs: 3000 }
|
||||||
|
: { enabled: reconnect.enabled ?? true, maxRetries: reconnect.maxRetries ?? 5, delayMs: reconnect.delayMs ?? 3000 }
|
||||||
|
const heartbeat = resolveHeartbeat(source.heartbeat)
|
||||||
|
|
||||||
socket.addEventListener('open', () => updateState({ loading: false, status: 'open', error: null }))
|
const clearHeartbeat = () => {
|
||||||
socket.addEventListener('message', (event) => {
|
if (heartbeatTimer) {
|
||||||
commitData(parsePayload(event.data), source.mode, source.maxItems)
|
window.clearInterval(heartbeatTimer)
|
||||||
|
heartbeatTimer = null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const connect = () => {
|
||||||
|
updateState({ status: 'connecting', error: null })
|
||||||
|
socket = new WebSocket(source.url, source.protocols)
|
||||||
|
|
||||||
|
socket.addEventListener('open', () => {
|
||||||
|
retryCount = 0
|
||||||
|
updateState({ loading: false, status: 'open', error: null })
|
||||||
|
|
||||||
|
if (heartbeat) {
|
||||||
|
clearHeartbeat()
|
||||||
|
heartbeatTimer = window.setInterval(() => {
|
||||||
|
if (socket?.readyState === WebSocket.OPEN) {
|
||||||
|
socket.send(heartbeat.message)
|
||||||
|
}
|
||||||
|
}, heartbeat.intervalMs)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.addEventListener('message', (event) => {
|
||||||
|
commitData(parsePayload(event.data), source.mode, source.maxItems)
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.addEventListener('close', () => {
|
||||||
|
clearHeartbeat()
|
||||||
|
updateState({ loading: false, status: 'closed' })
|
||||||
|
|
||||||
|
if (!closedByCleanup && reconnectOptions.enabled && retryCount < reconnectOptions.maxRetries) {
|
||||||
|
retryCount += 1
|
||||||
|
reconnectTimer = window.setTimeout(connect, reconnectOptions.delayMs)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
socket.addEventListener('error', () => updateState({ loading: false, status: 'error', error: 'WebSocket connection error.' }))
|
||||||
|
}
|
||||||
|
|
||||||
|
connect()
|
||||||
|
|
||||||
|
cleanups.push(() => {
|
||||||
|
closedByCleanup = true
|
||||||
|
clearHeartbeat()
|
||||||
|
if (reconnectTimer) {
|
||||||
|
window.clearTimeout(reconnectTimer)
|
||||||
|
}
|
||||||
|
socket?.close()
|
||||||
})
|
})
|
||||||
socket.addEventListener('close', () => updateState({ loading: false, status: 'closed' }))
|
|
||||||
socket.addEventListener('error', () => updateState({ loading: false, status: 'error', error: 'WebSocket connection error.' }))
|
|
||||||
|
|
||||||
cleanups.push(() => socket.close())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (source.type === 'signalr' || source.type === 'mqtt') {
|
if (source.type === 'signalr' || source.type === 'mqtt') {
|
||||||
|
|||||||
@@ -0,0 +1,3 @@
|
|||||||
|
VITE_API_BASE_URL=http://localhost:3000
|
||||||
|
VITE_WS_URL=ws://localhost:3000/ws/screen
|
||||||
|
VITE_ENABLE_STAGE_DEBUG=true
|
||||||
@@ -1,17 +1,91 @@
|
|||||||
import { MetricCard, ScreenStage } from '@dev-screen-starter/screen-core'
|
import { ChartPanel, createAreaTrendOption, createRankBarOption } from '@dev-screen-starter/charts'
|
||||||
|
import { useScreenDataSources } from '@dev-screen-starter/data'
|
||||||
|
import { MetricCard, ScreenStage, type ScaleMode } from '@dev-screen-starter/screen-core'
|
||||||
|
import { CornerFrame, Divider, GlowPanel, ScrollTable, SectionTitle, StatusPill } from '@dev-screen-starter/visual-kit'
|
||||||
|
import { screenDataSources } from './dataSources'
|
||||||
|
|
||||||
|
const scaleModes: ScaleMode[] = ['fit', 'fill', 'stretch', 'none']
|
||||||
|
|
||||||
|
function readScaleMode(): ScaleMode {
|
||||||
|
if (typeof window === 'undefined') {
|
||||||
|
return 'fit'
|
||||||
|
}
|
||||||
|
|
||||||
|
const value = new URLSearchParams(window.location.search).get('scaleMode')
|
||||||
|
return scaleModes.includes(value as ScaleMode) ? (value as ScaleMode) : 'fit'
|
||||||
|
}
|
||||||
|
|
||||||
export function ProjectScreen() {
|
export function ProjectScreen() {
|
||||||
|
const scaleMode = readScaleMode()
|
||||||
|
const data = useScreenDataSources(screenDataSources)
|
||||||
|
const metrics = data.metrics.data ?? []
|
||||||
|
const trend = data.trend.data
|
||||||
|
const rank = data.rank.data
|
||||||
|
const alerts = data.alerts.data ?? []
|
||||||
|
const debug = import.meta.env.VITE_ENABLE_STAGE_DEBUG === 'true'
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ScreenStage background="#061826">
|
<ScreenStage background="#061826" scaleMode={scaleMode} debug={debug}>
|
||||||
<header className="screen-title">
|
<header className="screen-title">
|
||||||
<span>__PROJECT_TITLE__</span>
|
<span>__PROJECT_TITLE__</span>
|
||||||
<strong>大屏总览</strong>
|
<strong>大屏总览</strong>
|
||||||
|
<small>scaleMode={scaleMode}</small>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
|
<section className="status-strip">
|
||||||
|
<CornerFrame>
|
||||||
|
<SectionTitle title="运行态" subtitle="Project starter" size="sm" />
|
||||||
|
<Divider />
|
||||||
|
<div className="status-row">
|
||||||
|
<StatusPill label="稳定" />
|
||||||
|
<StatusPill label="预警" status="warning" />
|
||||||
|
<StatusPill label="异常" status="danger" />
|
||||||
|
</div>
|
||||||
|
</CornerFrame>
|
||||||
|
|
||||||
|
<GlowPanel title="实时告警" tone="amber">
|
||||||
|
<ScrollTable
|
||||||
|
columns={[
|
||||||
|
{ key: 'time', title: '时间', width: '68px' },
|
||||||
|
{ key: 'area', title: '区域' },
|
||||||
|
{ key: 'status', title: '状态' }
|
||||||
|
]}
|
||||||
|
rows={alerts}
|
||||||
|
/>
|
||||||
|
</GlowPanel>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section className="metric-row">
|
<section className="metric-row">
|
||||||
<MetricCard label="指标一" value="--" />
|
{metrics.map((metric) => (
|
||||||
<MetricCard label="指标二" value="--" />
|
<MetricCard key={metric.label} {...metric} />
|
||||||
<MetricCard label="指标三" value="--" />
|
))}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<section className="chart-grid">
|
||||||
|
<ChartPanel
|
||||||
|
title="趋势图"
|
||||||
|
option={
|
||||||
|
trend
|
||||||
|
? createAreaTrendOption({
|
||||||
|
categories: trend.categories,
|
||||||
|
values: trend.values,
|
||||||
|
name: '订单'
|
||||||
|
})
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
<ChartPanel
|
||||||
|
title="区域排行"
|
||||||
|
option={
|
||||||
|
rank
|
||||||
|
? createRankBarOption({
|
||||||
|
categories: rank.categories,
|
||||||
|
values: rank.values,
|
||||||
|
name: '订单'
|
||||||
|
})
|
||||||
|
: null
|
||||||
|
}
|
||||||
|
/>
|
||||||
</section>
|
</section>
|
||||||
</ScreenStage>
|
</ScreenStage>
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -0,0 +1,44 @@
|
|||||||
|
import { defineDataSources, httpSource, mockSource, websocketSource } from '@dev-screen-starter/data'
|
||||||
|
import { alerts, metrics, rank, trend } from './mockData'
|
||||||
|
|
||||||
|
const apiBaseUrl = import.meta.env.VITE_API_BASE_URL
|
||||||
|
const wsUrl = import.meta.env.VITE_WS_URL
|
||||||
|
|
||||||
|
export const screenDataSources = defineDataSources({
|
||||||
|
metrics: mockSource({
|
||||||
|
data: metrics,
|
||||||
|
intervalMs: 15000
|
||||||
|
}),
|
||||||
|
|
||||||
|
trend: mockSource({
|
||||||
|
data: trend
|
||||||
|
}),
|
||||||
|
|
||||||
|
rank: mockSource({
|
||||||
|
data: rank
|
||||||
|
}),
|
||||||
|
|
||||||
|
alerts: mockSource({
|
||||||
|
data: alerts,
|
||||||
|
intervalMs: 10000
|
||||||
|
}),
|
||||||
|
|
||||||
|
// Replace the mock source above with this source when the customer API is ready.
|
||||||
|
overviewApi: httpSource({
|
||||||
|
enabled: false,
|
||||||
|
baseUrl: apiBaseUrl,
|
||||||
|
url: '/api/screen/overview',
|
||||||
|
timeoutMs: 8000,
|
||||||
|
intervalMs: 10000
|
||||||
|
}),
|
||||||
|
|
||||||
|
// Enable this source for pushed event streams.
|
||||||
|
realtimeAlerts: websocketSource({
|
||||||
|
enabled: false,
|
||||||
|
url: wsUrl,
|
||||||
|
mode: 'append',
|
||||||
|
maxItems: 20,
|
||||||
|
reconnect: { enabled: true, maxRetries: 10, delayMs: 3000 },
|
||||||
|
heartbeat: { message: 'ping', intervalMs: 30000 }
|
||||||
|
})
|
||||||
|
})
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
import { createRoot } from 'react-dom/client'
|
import { createRoot } from 'react-dom/client'
|
||||||
import { ProjectScreen } from './ProjectScreen'
|
import { ProjectScreen } from './ProjectScreen'
|
||||||
|
import '@dev-screen-starter/visual-kit/styles.css'
|
||||||
import './screen.css'
|
import './screen.css'
|
||||||
|
|
||||||
createRoot(document.getElementById('root')!).render(<ProjectScreen />)
|
createRoot(document.getElementById('root')!).render(<ProjectScreen />)
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
export const metrics = [
|
||||||
|
{ label: '今日订单', value: 1280, unit: '单', tone: 'blue' as const },
|
||||||
|
{ label: '在线设备', value: 342, unit: '台', tone: 'green' as const },
|
||||||
|
{ label: '告警数量', value: 17, unit: '条', tone: 'amber' as const }
|
||||||
|
]
|
||||||
|
|
||||||
|
export const trend = {
|
||||||
|
categories: ['08:00', '10:00', '12:00', '14:00', '16:00', '18:00'],
|
||||||
|
values: [120, 240, 380, 520, 760, 920]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const rank = {
|
||||||
|
categories: ['华东', '华南', '华北', '西南', '东北'],
|
||||||
|
values: [960, 820, 680, 520, 390]
|
||||||
|
}
|
||||||
|
|
||||||
|
export const alerts = [
|
||||||
|
{ time: '18:20', area: '华东仓', status: '履约延迟' },
|
||||||
|
{ time: '18:12', area: '华南仓', status: '库存预警' },
|
||||||
|
{ time: '17:48', area: '华北仓', status: '接口抖动' }
|
||||||
|
]
|
||||||
@@ -27,6 +27,9 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.screen-title {
|
.screen-title {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 8px;
|
||||||
left: 56px;
|
left: 56px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 42px;
|
top: 42px;
|
||||||
@@ -34,9 +37,7 @@ body {
|
|||||||
|
|
||||||
.screen-title span {
|
.screen-title span {
|
||||||
color: #88a1bd;
|
color: #88a1bd;
|
||||||
display: block;
|
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
margin-bottom: 8px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.screen-title strong {
|
.screen-title strong {
|
||||||
@@ -44,6 +45,32 @@ body {
|
|||||||
font-size: 42px;
|
font-size: 42px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.screen-title small {
|
||||||
|
border: 1px solid rgb(99 164 255 / 22%);
|
||||||
|
border-radius: 999px;
|
||||||
|
color: #9fb4cc;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 5px 9px;
|
||||||
|
width: fit-content;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-strip {
|
||||||
|
display: grid;
|
||||||
|
gap: 18px;
|
||||||
|
grid-template-columns: 0.9fr 1.1fr;
|
||||||
|
height: 150px;
|
||||||
|
left: 720px;
|
||||||
|
position: absolute;
|
||||||
|
right: 56px;
|
||||||
|
top: 42px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status-row {
|
||||||
|
display: flex;
|
||||||
|
gap: 8px;
|
||||||
|
margin-top: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
.metric-row {
|
.metric-row {
|
||||||
display: grid;
|
display: grid;
|
||||||
gap: 24px;
|
gap: 24px;
|
||||||
@@ -51,7 +78,7 @@ body {
|
|||||||
left: 56px;
|
left: 56px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
right: 56px;
|
right: 56px;
|
||||||
top: 150px;
|
top: 230px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.metric-card {
|
.metric-card {
|
||||||
@@ -80,3 +107,88 @@ body {
|
|||||||
font-size: 18px;
|
font-size: 18px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.tone-green {
|
||||||
|
border-color: rgb(78 170 116 / 42%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.tone-amber {
|
||||||
|
border-color: rgb(216 161 62 / 42%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen-panel {
|
||||||
|
background: rgb(8 22 36 / 86%);
|
||||||
|
border: 1px solid rgb(88 130 171 / 36%);
|
||||||
|
border-radius: 8px;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
padding: 18px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen-panel header {
|
||||||
|
align-items: center;
|
||||||
|
color: #d7e6f7;
|
||||||
|
display: flex;
|
||||||
|
font-size: 18px;
|
||||||
|
font-weight: 700;
|
||||||
|
justify-content: space-between;
|
||||||
|
margin-bottom: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen-panel-body {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-grid {
|
||||||
|
bottom: 56px;
|
||||||
|
display: grid;
|
||||||
|
gap: 20px;
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
left: 56px;
|
||||||
|
position: absolute;
|
||||||
|
right: 56px;
|
||||||
|
top: 420px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-host {
|
||||||
|
height: 100%;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-panel-body {
|
||||||
|
position: relative;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-panel-state {
|
||||||
|
align-items: center;
|
||||||
|
color: #88a1bd;
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.chart-panel-state.is-error {
|
||||||
|
color: #ff9fa7;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen-stage-debug {
|
||||||
|
background: rgb(3 8 13 / 84%);
|
||||||
|
border: 1px solid rgb(100 135 170 / 35%);
|
||||||
|
border-radius: 6px;
|
||||||
|
bottom: 18px;
|
||||||
|
color: #9fb4cc;
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
gap: 10px;
|
||||||
|
max-width: min(760px, calc(100vw - 36px));
|
||||||
|
padding: 8px 10px;
|
||||||
|
position: absolute;
|
||||||
|
right: 18px;
|
||||||
|
z-index: 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screen-stage-debug span {
|
||||||
|
font-size: 12px;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
Reference in new issue
Block a user