From ce99b17fcb6e04a708ba8ef635fc67b7317ab192 Mon Sep 17 00:00:00 2001 From: MrKBear Date: Tue, 24 May 2022 14:07:47 +0800 Subject: [PATCH] Add statistics panel --- source/Localization/EN-US.ts | 2 ++ source/Localization/ZH-CN.ts | 2 ++ .../SimulatorDesktop/SimulatorDesktop.tsx | 2 +- source/Page/SimulatorWeb/SimulatorWeb.tsx | 2 +- source/Panel/Panel.tsx | 6 +++++ source/Panel/Statistics/Statistics.scss | 8 +++++++ source/Panel/Statistics/Statistics.tsx | 22 +++++++++++++++++++ 7 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 source/Panel/Statistics/Statistics.scss create mode 100644 source/Panel/Statistics/Statistics.tsx diff --git a/source/Localization/EN-US.ts b/source/Localization/EN-US.ts index 4fcbd3f..cda3522 100644 --- a/source/Localization/EN-US.ts +++ b/source/Localization/EN-US.ts @@ -62,6 +62,8 @@ const EN_US = { "Panel.Info.Behavior.Clip.Player": "Pre render recorded data", "Panel.Title.Behavior.Clip.Details": "Clip", "Panel.Info.Behavior.Clip.Details": "Edit view clip attributes", + "Panel.Info.Statistics": "View statistics", + "Panel.Title.Statistics": "Statistics", "Panel.Info.Behavior.Clip.Time.Formate": "{current} / {all} / {fps}fps", "Panel.Info.Behavior.Clip.Record.Formate": "Record: {time}", "Panel.Info.Behavior.Clip.Uname.Clip": "Waiting for recording...", diff --git a/source/Localization/ZH-CN.ts b/source/Localization/ZH-CN.ts index 15b2c6a..99b8a19 100644 --- a/source/Localization/ZH-CN.ts +++ b/source/Localization/ZH-CN.ts @@ -62,6 +62,8 @@ const ZH_CN = { "Panel.Info.Behavior.Clip.Player": "预渲染录制数据", "Panel.Title.Behavior.Clip.Details": "剪辑", "Panel.Info.Behavior.Clip.Details": "编辑查看剪辑片段属性", + "Panel.Info.Statistics": "查看统计信息", + "Panel.Title.Statistics": "统计", "Panel.Info.Behavior.Clip.Time.Formate": "{current} / {all} / {fps} fps", "Panel.Info.Behavior.Clip.Record.Formate": "录制: {time}", "Panel.Info.Behavior.Clip.Uname.Clip": "等待录制...", diff --git a/source/Page/SimulatorDesktop/SimulatorDesktop.tsx b/source/Page/SimulatorDesktop/SimulatorDesktop.tsx index 06b5639..c6f04aa 100644 --- a/source/Page/SimulatorDesktop/SimulatorDesktop.tsx +++ b/source/Page/SimulatorDesktop/SimulatorDesktop.tsx @@ -74,7 +74,7 @@ class SimulatorDesktop extends Component { }, { items: [{ - panels: ["ObjectList"] + panels: ["ObjectList", "Statistics"] }, { panels: ["GroupDetails", "RangeDetails", "LabelDetails", "BehaviorDetails", "ClipDetails"] }], diff --git a/source/Page/SimulatorWeb/SimulatorWeb.tsx b/source/Page/SimulatorWeb/SimulatorWeb.tsx index a520ff0..36058af 100644 --- a/source/Page/SimulatorWeb/SimulatorWeb.tsx +++ b/source/Page/SimulatorWeb/SimulatorWeb.tsx @@ -65,7 +65,7 @@ class SimulatorWeb extends Component { }, { items: [{ - panels: ["ObjectList"] + panels: ["ObjectList", "Statistics"] }, { panels: ["GroupDetails", "RangeDetails", "LabelDetails", "BehaviorDetails", "ClipDetails"] }], diff --git a/source/Panel/Panel.tsx b/source/Panel/Panel.tsx index b4cc8c1..4aa6644 100644 --- a/source/Panel/Panel.tsx +++ b/source/Panel/Panel.tsx @@ -13,6 +13,7 @@ import { BehaviorDetails } from "@Panel/BehaviorDetails/BehaviorDetails"; import { ClipPlayer } from "@Panel/ClipPlayer/ClipPlayer"; import { ClipRecorder } from "@Panel/ClipPlayer/ClipRecorder"; import { ClipDetails } from "@Panel/ClipDetails/ClipDetails"; +import { Statistics } from "@Panel/Statistics/Statistics"; interface IPanelInfo { nameKey: string; @@ -36,6 +37,7 @@ type PanelId = "" | "BehaviorDetails" // 行为属性 | "ClipPlayer" // 剪辑影片 | "ClipDetails" // 剪辑详情 +| "Statistics" // 统计信息 ; const PanelInfoMap = new Map(); @@ -79,6 +81,10 @@ PanelInfoMap.set("ClipDetails", { nameKey: "Panel.Title.Behavior.Clip.Details", introKay: "Panel.Info.Behavior.Clip.Details", class: ClipDetails }); +PanelInfoMap.set("Statistics", { + nameKey: "Panel.Title.Statistics", introKay: "Panel.Info.Statistics", + class: Statistics +}); function getPanelById(panelId: PanelId): ReactNode { switch (panelId) { diff --git a/source/Panel/Statistics/Statistics.scss b/source/Panel/Statistics/Statistics.scss new file mode 100644 index 0000000..20a0d20 --- /dev/null +++ b/source/Panel/Statistics/Statistics.scss @@ -0,0 +1,8 @@ +@import "../../Component/Theme/Theme.scss"; + +div.statistics-panel { + width: 100%; + min-height: 100%; + padding: 10px; + box-sizing: border-box; +} \ No newline at end of file diff --git a/source/Panel/Statistics/Statistics.tsx b/source/Panel/Statistics/Statistics.tsx new file mode 100644 index 0000000..a893fb3 --- /dev/null +++ b/source/Panel/Statistics/Statistics.tsx @@ -0,0 +1,22 @@ +import { Component, ReactNode } from "react"; +import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status"; +import { useSetting, IMixinSettingProps } from "@Context/Setting"; +import Theme from "@Component/Theme/Theme"; +import "./Statistics.scss"; + +interface IStatisticsProps { + +} + +@useSetting +@useStatusWithEvent("labelChange", "focusLabelChange", "labelAttrChange") +class Statistics extends Component { + + public render(): ReactNode { + return + + ; + } +} + +export { Statistics }; \ No newline at end of file