forked from labring/FastGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
186 changed files
with
2,983 additions
and
1,825 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,5 +39,4 @@ docSite/.vercel | |
*.local.* | ||
|
||
|
||
# jetbrains | ||
.idea/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# 打包命令 | ||
|
||
```sh | ||
# Build image, not proxy | ||
docker build -t registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.4.7 --build-arg name=app . | ||
|
||
# build image with proxy | ||
docker build -t registry.cn-hangzhou.aliyuncs.com/fastgpt/fastgpt:v4.4.7 --build-arg name=app --build-arg proxy=taobao . | ||
``` | ||
|
||
# Pg 常用索引 | ||
|
||
```sql | ||
CREATE INDEX IF NOT EXISTS modelData_dataset_id_index ON modeldata (dataset_id); | ||
CREATE INDEX IF NOT EXISTS modelData_collection_id_index ON modeldata (collection_id); | ||
CREATE INDEX IF NOT EXISTS modelData_teamId_index ON modeldata (team_id); | ||
``` |
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,23 @@ | ||
export type UploadImgProps = { | ||
base64Img: string; | ||
import { MongoImageTypeEnum } from './image/constants'; | ||
|
||
export type preUploadImgProps = { | ||
type: `${MongoImageTypeEnum}`; | ||
|
||
expiredTime?: Date; | ||
metadata?: Record<string, any>; | ||
shareId?: string; | ||
}; | ||
export type UploadImgProps = preUploadImgProps & { | ||
base64Img: string; | ||
}; | ||
|
||
export type UrlFetchParams = { | ||
urlList: string[]; | ||
selector?: string; | ||
}; | ||
export type UrlFetchResponse = { | ||
url: string; | ||
title: string; | ||
content: string; | ||
selector?: string; | ||
}[]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
export const imageBaseUrl = '/api/system/img/'; | ||
|
||
export enum MongoImageTypeEnum { | ||
systemAvatar = 'systemAvatar', | ||
appAvatar = 'appAvatar', | ||
pluginAvatar = 'pluginAvatar', | ||
datasetAvatar = 'datasetAvatar', | ||
userAvatar = 'userAvatar', | ||
teamAvatar = 'teamAvatar', | ||
|
||
chatImage = 'chatImage', | ||
docImage = 'docImage' | ||
} | ||
export const mongoImageTypeMap = { | ||
[MongoImageTypeEnum.systemAvatar]: { | ||
label: 'common.file.type.appAvatar', | ||
unique: true | ||
}, | ||
[MongoImageTypeEnum.appAvatar]: { | ||
label: 'common.file.type.appAvatar', | ||
unique: true | ||
}, | ||
[MongoImageTypeEnum.pluginAvatar]: { | ||
label: 'common.file.type.pluginAvatar', | ||
unique: true | ||
}, | ||
[MongoImageTypeEnum.datasetAvatar]: { | ||
label: 'common.file.type.datasetAvatar', | ||
unique: true | ||
}, | ||
[MongoImageTypeEnum.userAvatar]: { | ||
label: 'common.file.type.userAvatar', | ||
unique: true | ||
}, | ||
[MongoImageTypeEnum.teamAvatar]: { | ||
label: 'common.file.type.teamAvatar', | ||
unique: true | ||
}, | ||
|
||
[MongoImageTypeEnum.chatImage]: { | ||
label: 'common.file.type.chatImage', | ||
unique: false | ||
}, | ||
[MongoImageTypeEnum.docImage]: { | ||
label: 'common.file.type.docImage', | ||
unique: false | ||
} | ||
}; | ||
|
||
export const uniqueImageTypeList = Object.entries(mongoImageTypeMap) | ||
.filter(([key, value]) => value.unique) | ||
.map(([key]) => key as `${MongoImageTypeEnum}`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { MongoImageTypeEnum } from './constants'; | ||
|
||
export type MongoImageSchemaType = { | ||
teamId: string; | ||
binary: Buffer; | ||
createTime: Date; | ||
expiredTime?: Date; | ||
type: `${MongoImageTypeEnum}`; | ||
|
||
metadata?: { fileId?: string }; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// The number of days left in the month is calculated as 30 days per month, and less than 1 day is calculated as 1 day | ||
export const getMonthRemainingDays = () => { | ||
const now = new Date(); | ||
const year = now.getFullYear(); | ||
const month = now.getMonth(); | ||
const date = now.getDate(); | ||
const days = new Date(year, month + 1, 0).getDate(); | ||
const remainingDays = days - date; | ||
return remainingDays + 1; | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
import dayjs from 'dayjs'; | ||
|
||
export const formatTime2YMDHM = (time: Date) => dayjs(time).format('YYYY-MM-DD HH:mm'); | ||
export const formatTime2YMDHM = (time?: Date) => | ||
time ? dayjs(time).format('YYYY-MM-DD HH:mm') : ''; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.