mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-14 14:31:00 +00:00
perf: add subtitle for each page
This commit is contained in:
@@ -5,6 +5,7 @@ export interface ISidebarChildVO {
|
|||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
name: string;
|
name: string;
|
||||||
route: string;
|
route: string;
|
||||||
|
description: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class SidebarChildVO {
|
export class SidebarChildVO {
|
||||||
@@ -12,12 +13,14 @@ export class SidebarChildVO {
|
|||||||
icon: React.ReactNode;
|
icon: React.ReactNode;
|
||||||
name: string;
|
name: string;
|
||||||
route: string;
|
route: string;
|
||||||
|
description: string;
|
||||||
|
|
||||||
constructor(props: ISidebarChildVO) {
|
constructor(props: ISidebarChildVO) {
|
||||||
this.id = props.id;
|
this.id = props.id;
|
||||||
this.icon = props.icon;
|
this.icon = props.icon;
|
||||||
this.name = props.name;
|
this.name = props.name;
|
||||||
this.route = props.route;
|
this.route = props.route;
|
||||||
|
this.description = props.description;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ export const sidebarConfigList = [
|
|||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
route: '/home/bots',
|
route: '/home/bots',
|
||||||
|
description: '创建和管理机器人,这是 LangBot 与各个平台连接的入口',
|
||||||
}),
|
}),
|
||||||
new SidebarChildVO({
|
new SidebarChildVO({
|
||||||
id: 'models',
|
id: 'models',
|
||||||
@@ -31,6 +32,7 @@ export const sidebarConfigList = [
|
|||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
route: '/home/models',
|
route: '/home/models',
|
||||||
|
description: '配置和管理可在流水线中使用的模型',
|
||||||
}),
|
}),
|
||||||
new SidebarChildVO({
|
new SidebarChildVO({
|
||||||
id: 'pipelines',
|
id: 'pipelines',
|
||||||
@@ -46,6 +48,7 @@ export const sidebarConfigList = [
|
|||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
route: '/home/pipelines',
|
route: '/home/pipelines',
|
||||||
|
description: '流水线定义了对消息事件的处理流程,用于绑定到机器人',
|
||||||
}),
|
}),
|
||||||
new SidebarChildVO({
|
new SidebarChildVO({
|
||||||
id: 'plugins',
|
id: 'plugins',
|
||||||
@@ -61,5 +64,6 @@ export const sidebarConfigList = [
|
|||||||
</svg>
|
</svg>
|
||||||
),
|
),
|
||||||
route: '/home/plugins',
|
route: '/home/plugins',
|
||||||
|
description: '安装和配置用于扩展 LangBot 功能的插件',
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
import styles from './HomeTittleBar.module.css';
|
import styles from './HomeTittleBar.module.css';
|
||||||
|
|
||||||
export default function HomeTitleBar({ title }: { title: string }) {
|
export default function HomeTitleBar({
|
||||||
|
title,
|
||||||
|
subtitle,
|
||||||
|
}: {
|
||||||
|
title: string;
|
||||||
|
subtitle: string;
|
||||||
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className={`${styles.titleBarContainer}`}>
|
<div className={`${styles.titleBarContainer}`}>
|
||||||
<div className={`${styles.titleText}`}>{title}</div>
|
<div className={`${styles.titleText}`}>{title}</div>
|
||||||
|
<div className={`${styles.subtitleText}`}>{subtitle}</div>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,14 +5,20 @@
|
|||||||
opacity: 1;
|
opacity: 1;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: column;
|
||||||
align-items: center;
|
align-items: flex-start;
|
||||||
background-color: #fafafa;
|
justify-content: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
.titleText {
|
.titleText {
|
||||||
margin-left: 3.2rem;
|
margin-left: 3.2rem;
|
||||||
font-size: 1.6rem;
|
font-size: 1.4rem;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
color: #585858;
|
color: #585858;
|
||||||
|
}
|
||||||
|
|
||||||
|
.subtitleText {
|
||||||
|
margin-left: 3.2rem;
|
||||||
|
font-size: 0.8rem;
|
||||||
|
color: #808080;
|
||||||
}
|
}
|
||||||
@@ -12,8 +12,10 @@ export default function HomeLayout({
|
|||||||
children: React.ReactNode;
|
children: React.ReactNode;
|
||||||
}>) {
|
}>) {
|
||||||
const [title, setTitle] = useState<string>('');
|
const [title, setTitle] = useState<string>('');
|
||||||
|
const [subtitle, setSubtitle] = useState<string>('');
|
||||||
const onSelectedChangeAction = (child: SidebarChildVO) => {
|
const onSelectedChangeAction = (child: SidebarChildVO) => {
|
||||||
setTitle(child.name);
|
setTitle(child.name);
|
||||||
|
setSubtitle(child.description);
|
||||||
};
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -23,7 +25,7 @@ export default function HomeLayout({
|
|||||||
</aside>
|
</aside>
|
||||||
|
|
||||||
<div className={styles.main}>
|
<div className={styles.main}>
|
||||||
<HomeTitleBar title={title} />
|
<HomeTitleBar title={title} subtitle={subtitle} />
|
||||||
|
|
||||||
<main className={styles.mainContent}>{children}</main>
|
<main className={styles.mainContent}>{children}</main>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user