feat: new ui

This commit is contained in:
archer
2023-05-04 23:30:59 +08:00
parent 4d043e0e46
commit 014fb504a4
133 changed files with 2426 additions and 1696 deletions

19
src/types/chat.d.ts vendored
View File

@@ -1,4 +1,7 @@
import { ChatRoleEnum } from '@/constants/chat';
import type { InitChatResponse } from '@/api/response/chat';
export type ExportChatType = 'md' | 'pdf' | 'html';
export type ChatItemSimpleType = {
obj: `${ChatRoleEnum}`;
@@ -8,3 +11,19 @@ export type ChatItemSimpleType = {
export type ChatItemType = {
_id: string;
} & ChatItemSimpleType;
export type ChatSiteItemType = {
status: 'loading' | 'finish';
} & ChatItemType;
export interface ChatType extends InitChatResponse {
history: ChatSiteItemType[];
}
export type HistoryItemType = {
_id: string;
updateTime: Date;
modelId: string;
title: string;
latestChat: string;
};

View File

@@ -1,6 +1,13 @@
import { ModelStatusEnum } from '@/constants/model';
import type { ModelSchema } from './mongoSchema';
export type ModelListItemType = {
_id: string;
name: string;
avatar: string;
systemPrompt: string;
};
export interface ModelUpdateParams {
name: string;
avatar: string;

View File

@@ -11,6 +11,7 @@ export interface UserModelSchema {
_id: string;
username: string;
password: string;
avatar: string;
balance: number;
inviterId?: string;
promotionAmount: number;

4
src/types/user.d.ts vendored
View File

@@ -1,6 +1,7 @@
export interface UserType {
_id: string;
username: string;
avatar: string;
openaiKey: string;
balance: number;
promotion: {
@@ -10,7 +11,8 @@ export interface UserType {
export interface UserUpdateParams {
balance?: number;
openaiKey: string;
avatar?: string;
openaiKey?: string;
}
export interface UserBillType {