feat: add access list
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
import icons from '@/components/icon-font/icons';
|
||||
import { StatusMaps } from '@/config';
|
||||
import { StatusType } from '@/config/types';
|
||||
|
||||
export type maasProviderType =
|
||||
| 'doubao'
|
||||
| 'qwen'
|
||||
| 'openai'
|
||||
| 'deepseek'
|
||||
| 'anthropic';
|
||||
|
||||
export const maasProviderValueMap = {
|
||||
Doubao: 'doubao',
|
||||
Qwen: 'qwen',
|
||||
OpenAI: 'openai',
|
||||
Deepseek: 'deepseek',
|
||||
Anthropic: 'anthropic'
|
||||
};
|
||||
|
||||
export const maasProviderLabelMap = {
|
||||
[maasProviderValueMap.Doubao]: 'Doubao',
|
||||
[maasProviderValueMap.Qwen]: 'Qwen',
|
||||
[maasProviderValueMap.OpenAI]: 'OpenAI',
|
||||
[maasProviderValueMap.Deepseek]: 'Deepseek',
|
||||
[maasProviderValueMap.Anthropic]: 'Anthropic'
|
||||
};
|
||||
|
||||
export const providerIconsMap = {
|
||||
[maasProviderValueMap.Doubao]: 'icon-doubao',
|
||||
[maasProviderValueMap.Qwen]: 'icon-qwen',
|
||||
[maasProviderValueMap.OpenAI]: 'icon-openai',
|
||||
[maasProviderValueMap.Deepseek]: 'icon-deepseek',
|
||||
[maasProviderValueMap.Anthropic]: 'icon-anthropic'
|
||||
};
|
||||
|
||||
export const maasProviderOptions = Object.entries(maasProviderValueMap).map(
|
||||
([key, value]) => ({
|
||||
label: maasProviderLabelMap[value],
|
||||
value: value,
|
||||
key: value,
|
||||
locale: false,
|
||||
icon: providerIconsMap[value]
|
||||
})
|
||||
);
|
||||
|
||||
export const ProviderStatusValueMap: Record<string, string> = {
|
||||
Ready: 'Ready',
|
||||
InActive: 'Inactive'
|
||||
};
|
||||
|
||||
export const ProviderStatusLabelMap = {
|
||||
[ProviderStatusValueMap.Ready]: 'Ready',
|
||||
[ProviderStatusValueMap.InActive]: 'Inactive'
|
||||
};
|
||||
|
||||
export const ProviderStatus: Record<string, StatusType> = {
|
||||
[ProviderStatusValueMap.Ready]: StatusMaps.success,
|
||||
[ProviderStatusValueMap.InActive]: StatusMaps.error
|
||||
};
|
||||
|
||||
// actions for each row
|
||||
export const rowActionList = [
|
||||
{
|
||||
key: 'edit',
|
||||
label: 'common.button.edit',
|
||||
icon: icons.EditOutlined
|
||||
},
|
||||
{
|
||||
key: 'delete',
|
||||
label: 'common.button.delete',
|
||||
icon: icons.DeleteOutlined,
|
||||
props: {
|
||||
danger: true
|
||||
}
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,35 @@
|
||||
import { AccessItem } from './types';
|
||||
|
||||
// mock data for AccessItem 5 items
|
||||
export const mockDataList: AccessItem[] = [
|
||||
{
|
||||
id: 1,
|
||||
name: 'Doubao Access',
|
||||
source: 'Doubao',
|
||||
accessPoints: 5
|
||||
},
|
||||
{
|
||||
id: 2,
|
||||
name: 'Qwen Access',
|
||||
source: 'Qwen',
|
||||
accessPoints: 3
|
||||
},
|
||||
{
|
||||
id: 3,
|
||||
name: 'OpenAI Access',
|
||||
source: 'OpenAI',
|
||||
accessPoints: 8
|
||||
},
|
||||
{
|
||||
id: 4,
|
||||
name: 'Deepseek Access',
|
||||
source: 'Deepseek',
|
||||
accessPoints: 2
|
||||
},
|
||||
{
|
||||
id: 5,
|
||||
name: 'Anthropic Access',
|
||||
source: 'Anthropic',
|
||||
accessPoints: 4
|
||||
}
|
||||
];
|
||||
@@ -0,0 +1,12 @@
|
||||
export interface AccessItem {
|
||||
id: number;
|
||||
name: string;
|
||||
source: string;
|
||||
accessPoints?: number;
|
||||
}
|
||||
|
||||
export interface FormData {
|
||||
name: string;
|
||||
category: string;
|
||||
description: string;
|
||||
}
|
||||
Reference in New Issue
Block a user