feat: provider lsit

This commit is contained in:
jialin
2026-02-03 18:21:08 +08:00
parent 2dfdd4a0d9
commit 34331063eb
16 changed files with 135 additions and 55 deletions
+8 -5
View File
@@ -25,7 +25,7 @@ export const maasProviderLabelMap = {
[maasProviderValueMap.Anthropic]: 'Anthropic'
};
export const IconsMap = {
export const providerIconsMap = {
[maasProviderValueMap.Doubao]: 'icon-doubao',
[maasProviderValueMap.Qwen]: 'icon-qwen',
[maasProviderValueMap.OpenAI]: 'icon-openai',
@@ -33,10 +33,13 @@ export const IconsMap = {
[maasProviderValueMap.Anthropic]: 'icon-anthropic'
};
export const maasProviderOptions = Object.keys(maasProviderValueMap).map(
(key) => ({
label: maasProviderLabelMap[key],
value: maasProviderValueMap[key as keyof typeof maasProviderValueMap]
export const maasProviderOptions = Object.entries(maasProviderValueMap).map(
([key, value]) => ({
label: maasProviderLabelMap[value],
value: value,
key: value,
locale: false,
icon: providerIconsMap[value]
})
);
+50
View File
@@ -0,0 +1,50 @@
import { MaasProviderItem } from '../config/types';
// mock data for MaasProviderItem 5 items
export const mockDataList: MaasProviderItem[] = [
{
id: 1,
name: 'Doubao',
state: 'Ready',
models: 5,
state_message: '',
provider: 'doubao',
builtIn: false
},
{
id: 2,
models: 3,
name: 'Qwen',
state: 'Inactive',
state_message: 'Provider is inactive',
provider: 'qwen',
builtIn: true
},
{
id: 3,
models: 8,
name: 'OpenAI',
state: 'Ready',
state_message: '',
provider: 'openai',
builtIn: false
},
{
id: 4,
models: 2,
name: 'Deepseek',
state: 'Ready',
state_message: '',
provider: 'deepseek',
builtIn: false
},
{
id: 5,
models: 4,
name: 'Anthropic',
state: 'Inactive',
state_message: 'Provider is inactive',
provider: 'anthropic',
builtIn: true
}
];
+2
View File
@@ -3,9 +3,11 @@ import { maasProviderType } from '.';
export interface MaasProviderItem {
id: number;
name: string;
models?: number;
state: string;
state_message: string;
provider: maasProviderType;
builtIn: boolean;
}
export interface FormData {