Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
赵月辉
/
fastgpt-migrated
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Unverified
Commit
6a996272
authored
Sep 13, 2023
by
Archer
Committed by
GitHub
Sep 13, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: share link quote (#296)
parent
1bf76ebe
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
73 additions
and
28 deletions
+73
-28
client/public/docs/versionIntro.md
+5
-4
client/src/components/ChatBox/QuoteModal.tsx
+9
-3
client/src/pages/api/system/getInitData.ts
+22
-1
client/src/pages/chat/share.tsx
+1
-0
client/src/pages/login/components/LoginForm.tsx
+35
-20
client/src/types/index.d.ts
+1
-0
No files found.
client/public/docs/versionIntro.md
View file @
6a996272
### Fast GPT V4.4
### Fast GPT V4.4
.1
1.
新增 - 知识库目录结构
2.
优化 -
[
使用文档
](
https://doc.fastgpt.run/docs/intro/
)
3.
[
点击查看高级编排介绍文档
](
https://doc.fastgpt.run/docs/workflow
)
4.
[
点击查看商业版
](
https://fael3z0zfze.feishu.cn/docx/F155dbirfo8vDDx2WgWc6extnwf
)
2.
新增 - 分享链接支持配置 IP 限流、过期时间、最大额度等
3.
优化 -
[
使用文档
](
https://doc.fastgpt.run/docs/intro/
)
4.
[
点击查看高级编排介绍文档
](
https://doc.fastgpt.run/docs/workflow
)
5.
[
点击查看商业版
](
https://fael3z0zfze.feishu.cn/docx/F155dbirfo8vDDx2WgWc6extnwf
)
client/src/components/ChatBox/QuoteModal.tsx
View file @
6a996272
import
React
,
{
useCallback
,
useState
}
from
'react'
;
import
React
,
{
useCallback
,
use
Memo
,
use
State
}
from
'react'
;
import
{
ModalBody
,
Box
,
useTheme
}
from
'@chakra-ui/react'
;
import
{
getKbDataItemById
}
from
'@/api/plugins/kb'
;
import
{
useLoading
}
from
'@/hooks/useLoading'
;
...
...
@@ -9,6 +9,7 @@ import MyIcon from '@/components/Icon';
import
InputDataModal
,
{
RawFileText
}
from
'@/pages/kb/detail/components/InputDataModal'
;
import
MyModal
from
'../MyModal'
;
import
{
KbDataItemType
}
from
'@/types/plugin'
;
import
{
useRouter
}
from
'next/router'
;
type
SearchType
=
KbDataItemType
&
{
kb_id
?:
string
;
...
...
@@ -24,10 +25,13 @@ const QuoteModal = ({
onClose
:
()
=>
void
;
})
=>
{
const
theme
=
useTheme
();
const
router
=
useRouter
();
const
{
toast
}
=
useToast
();
const
{
setIsLoading
,
Loading
}
=
useLoading
();
const
[
editDataItem
,
setEditDataItem
]
=
useState
<
QuoteItemType
>
();
const
isShare
=
useMemo
(()
=>
router
.
pathname
===
'/chat/share'
,
[
router
.
pathname
]);
/**
* click edit, get new kbDataItem
*/
...
...
@@ -91,10 +95,12 @@ const QuoteModal = ({
_hover=
{
{
'& .edit'
:
{
display
:
'flex'
}
}
}
overflow=
{
'hidden'
}
>
{
item
.
source
&&
<
RawFileText
filename=
{
item
.
source
}
fileId=
{
item
.
file_id
}
/>
}
{
item
.
source
&&
!
isShare
&&
(
<
RawFileText
filename=
{
item
.
source
}
fileId=
{
item
.
file_id
}
/>
)
}
<
Box
>
{
item
.
q
}
</
Box
>
<
Box
>
{
item
.
a
}
</
Box
>
{
item
.
id
&&
(
{
item
.
id
&&
!
isShare
&&
(
<
Box
className=
"edit"
display=
{
'none'
}
...
...
client/src/pages/api/system/getInitData.ts
View file @
6a996272
...
...
@@ -26,7 +26,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
chatModels
:
global
.
chatModels
,
qaModel
:
global
.
qaModel
,
vectorModels
:
global
.
vectorModels
,
systemVersion
:
process
.
env
.
npm_package_v
ersion
||
'0.0.0'
systemVersion
:
global
.
systemV
ersion
||
'0.0.0'
}
});
}
...
...
@@ -98,9 +98,14 @@ export async function getInitConfig() {
try
{
if
(
global
.
feConfigs
)
return
;
getSystemVersion
();
const
filename
=
process
.
env
.
NODE_ENV
===
'development'
?
'data/config.local.json'
:
'/app/data/config.json'
;
const
res
=
JSON
.
parse
(
readFileSync
(
filename
,
'utf-8'
));
console
.
log
(
`System Version:
${
global
.
systemVersion
}
`
);
console
.
log
(
res
);
global
.
systemEnv
=
res
.
SystemParams
...
...
@@ -123,3 +128,19 @@ export function setDefaultData() {
global
.
qaModel
=
defaultQAModel
;
global
.
vectorModels
=
defaultVectorModels
;
}
export
function
getSystemVersion
()
{
try
{
if
(
process
.
env
.
NODE_ENV
===
'development'
)
{
global
.
systemVersion
=
process
.
env
.
npm_package_version
||
'0.0.0'
;
return
;
}
const
packageJson
=
JSON
.
parse
(
readFileSync
(
'/app/package.json'
,
'utf-8'
));
global
.
systemVersion
=
packageJson
?.
version
;
}
catch
(
error
)
{
console
.
log
(
error
);
global
.
systemVersion
=
'0.0.0'
;
}
}
client/src/pages/chat/share.tsx
View file @
6a996272
...
...
@@ -64,6 +64,7 @@ const OutLink = ({ shareId, chatId }: { shareId: string; chatId: string }) => {
status
:
'finish'
}));
result
[
1
].
value
=
responseText
;
result
[
1
].
responseData
=
responseData
;
/* save chat */
saveChatResponse
({
...
...
client/src/pages/login/components/LoginForm.tsx
View file @
6a996272
import
React
,
{
useState
,
Dispatch
,
useCallback
,
useRef
}
from
'react'
;
import
{
FormControl
,
Flex
,
Input
,
Button
,
FormErrorMessage
,
Box
}
from
'@chakra-ui/react'
;
import
{
FormControl
,
Flex
,
Input
,
Button
,
FormErrorMessage
,
Box
,
Link
}
from
'@chakra-ui/react'
;
import
{
useForm
}
from
'react-hook-form'
;
import
{
useRouter
}
from
'next/router'
;
import
{
OAuthEnum
,
PageTypeEnum
}
from
'@/constants/user'
;
...
...
@@ -120,28 +120,43 @@ const LoginForm = ({ setPageType, loginSuccess }: Props) => {
</FormErrorMessage>
</FormControl>
{feConfigs?.show_register && (
<Flex align={'center'} justifyContent={'space-between'} mt={3} color={'myBlue.600'}>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
onClick={() => setPageType('forgetPassword')}
fontSize="sm"
>
忘记密码?
</Box>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
onClick={() => setPageType('register')}
fontSize="sm"
>
注册账号
</Box>
</Flex>
<>
<Flex align={'center'} justifyContent={'space-between'} mt={3} color={'myBlue.600'}>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
onClick={() => setPageType('forgetPassword')}
fontSize="sm"
>
忘记密码?
</Box>
<Box
cursor={'pointer'}
_hover={{ textDecoration: 'underline' }}
onClick={() => setPageType('register')}
fontSize="sm"
>
注册账号
</Box>
</Flex>
{feConfigs?.show_doc && (
<Box textAlign={'center'} mt={2} fontSize={'sm'}>
使用即代表你同意我们的{' '}
<Link
href="https://doc.fastgpt.run/docs/intro/#%e5%85%8d%e8%b4%a3%e5%a3%b0%e6%98%8e"
target={'_blank'}
color={'myBlue.600'}
>
免责声明
</Link>
</Box>
)}
</>
)}
<Button
type="submit"
mt={
6
}
mt={
5
}
w={'100%'}
size={['md', 'lg']}
colorScheme="blue"
...
...
client/src/types/index.d.ts
View file @
6a996272
...
...
@@ -61,6 +61,7 @@ declare global {
var
chatModels
:
ChatModelItemType
[];
var
qaModel
:
QAModelItemType
;
var
vectorModels
:
VectorModelItemType
[];
var
systemVersion
:
string
;
interface
Window
{
[
'pdfjs-dist/build/pdf'
]:
any
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment