feat(web): Unified frontend code style (#1923)

Co-authored-by: Fangyin Cheng <staneyffer@gmail.com>
Co-authored-by: 谨欣 <echo.cmy@antgroup.com>
Co-authored-by: 严志勇 <yanzhiyong@tiansuixiansheng.com>
Co-authored-by: yanzhiyong <932374019@qq.com>
This commit is contained in:
Dreammy23
2024-08-30 14:03:06 +08:00
committed by GitHub
parent f866580703
commit 471689ba20
247 changed files with 4960 additions and 4546 deletions

View File

@@ -15,14 +15,14 @@ const ModelSwitcher: React.FC = () => {
// 左边工具栏动态可用key
const paramKey: string[] = useMemo(() => {
return appInfo.param_need?.map((i) => i.type) || [];
return appInfo.param_need?.map(i => i.type) || [];
}, [appInfo.param_need]);
if (!paramKey.includes('model')) {
return (
<Tooltip title={t('model_tip')}>
<div className="flex w-8 h-8 items-center justify-center rounded-md hover:bg-[rgb(221,221,221,0.6)]">
<SettingOutlined className="text-xl cursor-not-allowed opacity-30" />
<div className='flex w-8 h-8 items-center justify-center rounded-md hover:bg-[rgb(221,221,221,0.6)]'>
<SettingOutlined className='text-xl cursor-not-allowed opacity-30' />
</div>
</Tooltip>
);
@@ -32,17 +32,17 @@ const ModelSwitcher: React.FC = () => {
<Select
value={modelValue}
placeholder={t('choose_model')}
className="h-8 rounded-3xl"
onChange={(val) => {
className='h-8 rounded-3xl'
onChange={val => {
setModelValue(val);
}}
popupMatchSelectWidth={300}
>
{modelList.map((item) => (
{modelList.map(item => (
<Select.Option key={item}>
<div className="flex items-center">
<div className='flex items-center'>
<ModelIcon model={item} />
<span className="ml-2">{item}</span>
<span className='ml-2'>{item}</span>
</div>
</Select.Option>
))}