style: dashboard

This commit is contained in:
jialin
2024-06-26 10:39:03 +08:00
parent 1fc415b6e6
commit d44f5a72d1
16 changed files with 95 additions and 71 deletions
+1
View File
@@ -65,6 +65,7 @@ export default defineConfig({
} }
: {}), : {}),
// esbuildMinifyIIFE: true, // esbuildMinifyIIFE: true,
favicons: ['/static/favicon.ico'],
jsMinifier: 'terser', jsMinifier: 'terser',
cssMinifier: 'cssnano', cssMinifier: 'cssnano',
presets: ['umi-presets-pro'], presets: ['umi-presets-pro'],

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

+1 -1
View File
@@ -1,5 +1,5 @@
.cardWrapper { .cardWrapper {
border-radius: 20px; border-radius: var(--border-radius-middle);
background-color: var(--color-white-1); background-color: var(--color-white-1);
box-shadow: var(--box-shadow-base); box-shadow: var(--box-shadow-base);
} }
+5 -2
View File
@@ -43,7 +43,10 @@ const BarChart: React.FC<BarChartProps> = (props) => {
title: { title: {
title, title,
style: { style: {
align: 'center' align: 'center',
titleFontSize: 14,
titleFill: 'rgba(0,0,0,0.88)',
titleFontWeight: 500
} }
}, },
split: { split: {
@@ -62,7 +65,7 @@ const BarChart: React.FC<BarChartProps> = (props) => {
radiusTopLeft: 12, radiusTopLeft: 12,
radiusTopRight: 12, radiusTopRight: 12,
align: 'center', align: 'center',
width: 30 width: 20
} }
}; };
+4 -2
View File
@@ -47,9 +47,11 @@ const GaugeChart: React.FC<GaugeChartProps> = (props) => {
title: { title: {
title, title,
size: 0, size: 0,
titleFontSize: 14,
style: { style: {
align: 'center' align: 'center',
titleFontSize: 14,
titleFill: 'rgba(0,0,0,0.88)',
titleFontWeight: 500
} }
}, },
style: { style: {
+5 -2
View File
@@ -43,7 +43,10 @@ const BarChart: React.FC<BarChartProps> = (props) => {
title: { title: {
title, title,
style: { style: {
align: 'center' align: 'center',
titleFontSize: 14,
titleFill: 'rgba(0,0,0,0.88)',
titleFontWeight: 500
} }
}, },
split: { split: {
@@ -59,7 +62,7 @@ const BarChart: React.FC<BarChartProps> = (props) => {
fill: 'linear-gradient(180deg,rgba(84, 204, 152,0.8) 0%,rgb(0, 168, 143,.7) 100%)', fill: 'linear-gradient(180deg,rgba(84, 204, 152,0.8) 0%,rgb(0, 168, 143,.7) 100%)',
radiusTopLeft: 12, radiusTopLeft: 12,
radiusTopRight: 12, radiusTopRight: 12,
height: 30 height: 20
} }
}; };
+4 -3
View File
@@ -39,11 +39,12 @@ const LineChart: React.FC<LineChartProps> = (props) => {
lineWidth: 1.5 lineWidth: 1.5
}, },
legend: { legend: {
itemMarker: {
symbol: 'circle'
},
color: { color: {
layout: { justifyContent: 'center' } layout: { justifyContent: 'center' }
},
size: {
itemLabelFontSize: 14,
itemLabelFontWeight: 500
} }
}, },
tooltip: { tooltip: {
+3 -3
View File
@@ -11,7 +11,7 @@ html {
--border-radius-base: 16px; --border-radius-base: 16px;
--border-radius-middle: 20px; --border-radius-middle: 20px;
--border-radius-small: 8px; --border-radius-small: 8px;
--color-white-1: rgba(255, 255, 255, 75%); --color-white-1: rgba(255, 255, 255, 100%);
--font-weight-normal: 500; --font-weight-normal: 500;
--font-weight-bold: 700; --font-weight-bold: 700;
--color-text-1: var(--ant-color-text); --color-text-1: var(--ant-color-text);
@@ -51,7 +51,7 @@ html {
&.ant-menu-css-var { &.ant-menu-css-var {
--ant-menu-item-height: 46px; --ant-menu-item-height: 46px;
--ant-menu-item-selected-bg: var(--color-white-1); --ant-menu-item-selected-bg: var(--color-white-1);
--ant-menu-item-border-radius: 24px; --ant-menu-item-border-radius: 20px;
--ant-menu-item-selected-color: var(--ant-color-primary); --ant-menu-item-selected-color: var(--ant-color-primary);
--ant-menu-item-hover-bg: var(--color-white-1); --ant-menu-item-hover-bg: var(--color-white-1);
--ant-menu-item-color: var(--color-text-1); --ant-menu-item-color: var(--color-text-1);
@@ -98,7 +98,7 @@ html {
.css-var-rh.ant-menu-css-var { .css-var-rh.ant-menu-css-var {
--ant-menu-item-height: 46px; --ant-menu-item-height: 46px;
--ant-menu-item-selected-bg: var(--color-white-1); --ant-menu-item-selected-bg: var(--color-white-1);
--ant-menu-item-border-radius: 24px; --ant-menu-item-border-radius: 20px;
--ant-menu-item-selected-color: var(--ant-color-primary); --ant-menu-item-selected-color: var(--ant-color-primary);
--ant-menu-item-hover-bg: var(--color-white-1); --ant-menu-item-hover-bg: var(--color-white-1);
--ant-menu-item-color: var(--color-text-1); --ant-menu-item-color: var(--color-text-1);
+1 -1
View File
@@ -144,7 +144,7 @@ export default (props: any) => {
location={location} location={location}
title={userConfig.title} title={userConfig.title}
navTheme="light" navTheme="light"
siderWidth={270} siderWidth={220}
onMenuHeaderClick={(e) => { onMenuHeaderClick={(e) => {
e.stopPropagation(); e.stopPropagation();
e.preventDefault(); e.preventDefault();
@@ -132,9 +132,9 @@ const projectData = [
const ActiveTable = () => { const ActiveTable = () => {
return ( return (
<Row gutter={[20, 0]}> <Row gutter={[20, 0]}>
<Col span={12}> <Col xs={24} sm={24} md={24} lg={12} xl={12}>
<PageTools <PageTools
style={{ margin: '32px 40px' }} style={{ margin: '32px 8px' }}
left={ left={
<span <span
style={{ fontSize: 'var(--font-size-large)', padding: '9px 0' }} style={{ fontSize: 'var(--font-size-large)', padding: '9px 0' }}
@@ -153,9 +153,9 @@ const ActiveTable = () => {
/> />
</div> </div>
</Col> </Col>
<Col span={12}> <Col xs={24} sm={24} md={24} lg={12} xl={12}>
<PageTools <PageTools
style={{ margin: '32px 40px' }} style={{ margin: '32px 8px' }}
left={ left={
<span <span
style={{ fontSize: 'var(--font-size-large)', padding: '9px 0' }} style={{ fontSize: 'var(--font-size-large)', padding: '9px 0' }}
@@ -18,7 +18,7 @@ const SystemLoad = () => {
<div> <div>
<div className="system-load"> <div className="system-load">
<PageTools <PageTools
style={{ margin: '32px 40px' }} style={{ margin: '32px 8px' }}
left={ left={
<span style={{ fontSize: 'var(--font-size-large)' }}> <span style={{ fontSize: 'var(--font-size-large)' }}>
System Load System Load
+47 -35
View File
@@ -94,46 +94,65 @@ const Usage = () => {
return ( return (
<> <>
<PageTools <PageTools
style={{ margin: '32px 40px' }} style={{ margin: '32px 8px' }}
left={<span style={{ fontSize: 'var(--font-size-large)' }}>Usage</span>} left={<span style={{ fontSize: 'var(--font-size-large)' }}>Usage</span>}
right={ right={
<DatePicker onChange={handleSelectDate} style={{ width: 300 }} /> <DatePicker onChange={handleSelectDate} style={{ width: 300 }} />
} }
/> />
<Row style={{ width: '100%' }} gutter={[0, 20]}> <Row style={{ width: '100%' }} gutter={[0, 20]}>
<Col span={12} style={{ paddingRight: '20px' }}> <Col span={14} style={{ paddingRight: '20px' }}>
<CardWrapper> <CardWrapper>
<ColumnBar <Row>
title="API Request" <Col span={12}>
data={dataList} <ColumnBar
xField="time" title="API Request"
yField="value" data={dataList}
height={360} xField="time"
></ColumnBar> yField="value"
height={360}
></ColumnBar>
</Col>
<Col span={12}>
<ColumnBar
title="Tokens"
data={tokenUsage}
xField="time"
yField="value"
height={360}
></ColumnBar>
</Col>
</Row>
</CardWrapper> </CardWrapper>
</Col> </Col>
<Col span={12}> <Col span={10}>
<CardWrapper> <CardWrapper>
<ColumnBar <Row>
title="Tokens" <Col span={12}>
data={tokenUsage} <HBar
xField="time" title="Top Users"
yField="value" data={userDataList}
height={360} xField="time"
></ColumnBar> yField="value"
height={360}
></HBar>
</Col>
<Col span={12}>
<HBar
title="Top Projects"
data={projectDataList}
xField="time"
yField="value"
height={360}
></HBar>
</Col>
</Row>
</CardWrapper> </CardWrapper>
</Col> </Col>
</Row> </Row>
<Row style={{ width: '100%', marginTop: '20px' }} gutter={[0, 20]}> {/* <Row style={{ width: '100%', marginTop: '20px' }} gutter={[0, 20]}>
<Col span={12} style={{ paddingRight: '20px' }}> <Col span={12} style={{ paddingRight: '20px' }}>
<CardWrapper> <CardWrapper></CardWrapper>
<HBar
title="Top Users"
data={userDataList}
xField="time"
yField="value"
></HBar>
</CardWrapper>
</Col> </Col>
<Col span={12}> <Col span={12}>
<CardWrapper <CardWrapper
@@ -141,16 +160,9 @@ const Usage = () => {
background: bgColor, background: bgColor,
borderRadius: 'var(--border-radius-base)' borderRadius: 'var(--border-radius-base)'
}} }}
> ></CardWrapper>
<HBar
title="Top Projects"
data={projectDataList}
xField="time"
yField="value"
></HBar>
</CardWrapper>
</Col> </Col>
</Row> </Row> */}
</> </>
); );
}; };
-3
View File
@@ -7,11 +7,8 @@ const Dashboard: React.FC = () => {
return ( return (
<> <>
<Overview></Overview> <Overview></Overview>
{/* <DividerLine></DividerLine> */}
<SystemLoad></SystemLoad> <SystemLoad></SystemLoad>
{/* <DividerLine></DividerLine> */}
<Usage></Usage> <Usage></Usage>
{/* <DividerLine></DividerLine> */}
<ActiveTable></ActiveTable> <ActiveTable></ActiveTable>
</> </>
); );
+19 -12
View File
@@ -1,4 +1,6 @@
import CardWrapper from '@/components/card-wrapper';
import { useSearchParams } from '@umijs/max'; import { useSearchParams } from '@umijs/max';
import { Divider } from 'antd';
import { useState } from 'react'; import { useState } from 'react';
import GroundLeft from './components/ground-left'; import GroundLeft from './components/ground-left';
import ParamsSettings from './components/params-settings'; import ParamsSettings from './components/params-settings';
@@ -25,19 +27,24 @@ const Playground: React.FC = () => {
}; };
return ( return (
<div className="play-ground"> <CardWrapper>
<div className="chat"> <div className="play-ground">
<GroundLeft parameters={params}></GroundLeft> <div className="chat">
<GroundLeft parameters={params}></GroundLeft>
</div>
<div className="divider-line">
<Divider type="vertical" />
</div>
<div className="params">
<ParamsSettings
onClose={handleClosePopover}
setParams={setParams}
selectedModel={selectModel}
/>
</div>
</div> </div>
<div className="divider-line">{/* <Divider type="vertical" /> */}</div> </CardWrapper>
<div className="params">
<ParamsSettings
onClose={handleClosePopover}
setParams={setParams}
selectedModel={selectModel}
/>
</div>
</div>
); );
}; };
@@ -2,8 +2,6 @@
position: relative; position: relative;
height: 100vh; height: 100vh;
padding-bottom: 120px; padding-bottom: 120px;
background-color: var(--color-white-1);
border-radius: 24px;
.message-list-wrap { .message-list-wrap {
max-height: calc(100vh - 152px); max-height: calc(100vh - 152px);