perf: webui styles

This commit is contained in:
Junyan Qin
2025-05-06 22:40:35 +08:00
parent 324f1c324d
commit 3c39ffca72
6 changed files with 51 additions and 17 deletions
Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

@@ -14,22 +14,33 @@
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: center;
gap: 0.8rem;
.langbotIcon { .langbotIcon {
width: 54px; width: 2.8rem;
height: 54px; height: 2.8rem;
border-radius: 12px;
background: #2288ee;
color: #fbfbfb; color: #fbfbfb;
font-weight: 600; box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1);
font-size: 36px; }
line-height: 54px;
text-align: center; .langbotTextContainer {
display: flex;
flex-direction: column;
align-items: flex-start;
justify-content: flex-start;
gap: 0.1rem;
} }
.langbotText { .langbotText {
font-size: 26px; font-size: 1.4rem;
font-weight: 500;
}
.langbotVersion {
font-size: 0.8rem;
font-weight: 700;
color: #6C6C6C;
} }
} }
@@ -8,6 +8,7 @@ import {
} from '@/app/home/components/home-sidebar/HomeSidebarChild'; } from '@/app/home/components/home-sidebar/HomeSidebarChild';
import { useRouter, usePathname } from 'next/navigation'; import { useRouter, usePathname } from 'next/navigation';
import { sidebarConfigList } from '@/app/home/components/home-sidebar/sidbarConfigList'; import { sidebarConfigList } from '@/app/home/components/home-sidebar/sidbarConfigList';
import langbotIcon from '../../assets/langbot-logo.webp';
// TODO 侧边导航栏要加动画 // TODO 侧边导航栏要加动画
export default function HomeSidebar({ export default function HomeSidebar({
@@ -72,8 +73,12 @@ export default function HomeSidebar({
{/* LangBot、ICON区域 */} {/* LangBot、ICON区域 */}
<div className={`${styles.langbotIconContainer}`}> <div className={`${styles.langbotIconContainer}`}>
{/* icon */} {/* icon */}
<div className={`${styles.langbotIcon}`}>L</div> <img className={`${styles.langbotIcon}`} src={langbotIcon.src} alt="langbot-icon" />
<div className={`${styles.langbotText}`}>Langbot</div> {/* 文字 */}
<div className={`${styles.langbotTextContainer}`}>
<div className={`${styles.langbotText}`}>LangBot</div>
<div className={`${styles.langbotVersion}`}>v4.0.0</div>
</div>
</div> </div>
{/* 菜单列表,后期可升级成配置驱动 */} {/* 菜单列表,后期可升级成配置驱动 */}
<div> <div>
@@ -3,8 +3,13 @@
height: 10rem; height: 10rem;
background-color: #fff; background-color: #fff;
border-radius: 10px; border-radius: 10px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.2);
padding: 1.2rem; padding: 1.2rem;
cursor: pointer;
}
.cardContainer:hover {
box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.1);
} }
.iconBasicInfoContainer { .iconBasicInfoContainer {
@@ -50,7 +55,7 @@
.providerLabel { .providerLabel {
font-size: 1.2rem; font-size: 1.2rem;
font-weight: bold; font-weight: 600;
color: #626262; color: #626262;
} }
+10 -2
View File
@@ -21,7 +21,15 @@ export default function LLMConfigPage() {
getLLMModelList(); getLLMModelList();
}, []); }, []);
function getLLMModelList() { async function getLLMModelList() {
const requesterNameListResp = await httpClient.getProviderRequesters();
const requesterNameList = requesterNameListResp.requesters.map((item) => {
return {
label: item.label.zh_CN,
value: item.name,
};
});
httpClient httpClient
.getProviderLLMModels() .getProviderLLMModels()
.then((resp) => { .then((resp) => {
@@ -31,7 +39,7 @@ export default function LLMConfigPage() {
id: model.uuid, id: model.uuid,
iconURL: httpClient.getProviderRequesterIconURL(model.requester), iconURL: httpClient.getProviderRequesterIconURL(model.requester),
name: model.name, name: model.name,
providerLabel: model.requester.substring(0, 10), providerLabel: requesterNameList.find((item) => item.value === model.requester)?.label || model.requester.substring(0, 10),
baseURL: model.requester_config?.base_url, baseURL: model.requester_config?.base_url,
abilities: model.abilities, abilities: model.abilities,
}); });
@@ -1,11 +1,16 @@
.cardContainer { .cardContainer {
background-color: #FFF; background-color: #FFF;
border-radius: 9px; border-radius: 9px;
box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.1); box-shadow: 0 0 5px 0 rgba(0, 0, 0, 0.1);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: center; align-items: center;
justify-content: space-evenly; justify-content: space-evenly;
cursor: pointer;
}
.cardContainer:hover {
box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.05);
} }
.createCardContainer { .createCardContainer {