Revert "sub plan page (#885)" (#886)

This reverts commit 443ad37b6a.
This commit is contained in:
Archer
2024-02-23 17:48:15 +08:00
committed by GitHub
parent 443ad37b6a
commit fd9b6291af
246 changed files with 4281 additions and 6286 deletions

View File

@@ -1,26 +0,0 @@
import { UsageSourceEnum } from './constants';
import { UsageListItemCountType, UsageListItemType } from './type';
export type CreateTrainingUsageProps = {
name: string;
datasetId: string;
};
export type ConcatUsageProps = UsageListItemCountType & {
teamId: string;
tmbId: string;
billId?: string;
totalPoints: number;
listIndex?: number;
};
export type CreateUsageProps = {
teamId: string;
tmbId: string;
appName: string;
appId?: string;
totalPoints: number;
// inputTokens: number;
source: `${UsageSourceEnum}`;
list: UsageListItemType[];
};

View File

@@ -1,21 +0,0 @@
export enum UsageSourceEnum {
fastgpt = 'fastgpt',
api = 'api',
shareLink = 'shareLink',
training = 'training'
}
export const UsageSourceMap = {
[UsageSourceEnum.fastgpt]: {
label: '在线使用'
},
[UsageSourceEnum.api]: {
label: 'Api'
},
[UsageSourceEnum.shareLink]: {
label: '免登录链接'
},
[UsageSourceEnum.training]: {
label: 'dataset.Training Name'
}
};

View File

@@ -1,23 +0,0 @@
/* bill common */
import { PRICE_SCALE } from '../constants';
import { UsageSourceEnum } from './constants';
import { AuthUserTypeEnum } from '../../permission/constant';
/**
* dataset price / PRICE_SCALE = real price
*/
export const formatStorePrice2Read = (val = 0, multiple = 1) => {
return Number(((val / PRICE_SCALE) * multiple).toFixed(10));
};
export const getUsageSourceByAuthType = ({
shareId,
authType
}: {
shareId?: string;
authType?: `${AuthUserTypeEnum}`;
}) => {
if (shareId) return UsageSourceEnum.shareLink;
if (authType === AuthUserTypeEnum.apikey) return UsageSourceEnum.api;
return UsageSourceEnum.fastgpt;
};

View File

@@ -1,26 +0,0 @@
import { CreateUsageProps } from './api';
import { UsageSourceEnum } from './constants';
export type UsageListItemCountType = {
charsLength?: number;
duration?: number;
};
export type UsageListItemType = UsageListItemCountType & {
moduleName: string;
amount: number;
model?: string;
};
export type UsageSchemaType = CreateUsageProps & {
_id: string;
time: Date;
};
export type UsageItemType = {
id: string;
time: Date;
appName: string;
source: UsageSchemaType['source'];
totalPoints: number;
list: UsageSchemaType['list'];
};