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
ba737622
authored
Jul 18, 2023
by
archer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: modules
parent
a993eba7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
13 deletions
+27
-13
client/src/components/Markdown/img/MermaidCodeBlock.tsx
+1
-1
client/src/pages/api/admin/initv4.ts
+3
-1
client/src/pages/app/detail/components/edit/index.tsx
+1
-1
client/src/service/events/pushBill.ts
+2
-1
client/src/utils/adapt.ts
+20
-9
No files found.
client/src/components/Markdown/img/MermaidCodeBlock.tsx
View file @
ba737622
...
@@ -57,7 +57,7 @@ const MermaidBlock = ({ code }: { code: string }) => {
...
@@ -57,7 +57,7 @@ const MermaidBlock = ({ code }: { code: string }) => {
const
{
svg
}
=
await
mermaid
.
render
(
`mermaid-
${
Date
.
now
()}
`
,
formatCode
);
const
{
svg
}
=
await
mermaid
.
render
(
`mermaid-
${
Date
.
now
()}
`
,
formatCode
);
setSvg
(
svg
);
setSvg
(
svg
);
}
catch
(
e
:
any
)
{
}
catch
(
e
:
any
)
{
console
.
log
(
'[Mermaid] '
,
e
?.
message
);
//
console.log('[Mermaid] ', e?.message);
}
}
})();
})();
},
[
code
]);
},
[
code
]);
...
...
client/src/pages/api/admin/initv4.ts
View file @
ba737622
...
@@ -615,6 +615,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -615,6 +615,8 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
await
authUser
({
req
,
authRoot
:
true
});
await
authUser
({
req
,
authRoot
:
true
});
await
connectToDatabase
();
await
connectToDatabase
();
const
{
limit
=
1000
}
=
req
.
body
as
{
limit
:
number
};
// 遍历所有的 app
// 遍历所有的 app
const
apps
=
await
App
.
find
(
const
apps
=
await
App
.
find
(
{
{
...
@@ -623,7 +625,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
...
@@ -623,7 +625,7 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
// userId: '63f9a14228d2a688d8dc9e1b'
// userId: '63f9a14228d2a688d8dc9e1b'
},
},
'_id chat'
'_id chat'
);
)
.
limit
(
limit
)
;
await
Promise
.
all
(
await
Promise
.
all
(
apps
.
map
(
async
(
app
)
=>
{
apps
.
map
(
async
(
app
)
=>
{
...
...
client/src/pages/app/detail/components/edit/index.tsx
View file @
ba737622
...
@@ -264,7 +264,7 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
...
@@ -264,7 +264,7 @@ const AppEdit = ({ app, fullScreen, onFullScreen }: Props) => {
setLoaded
(
true
);
setLoaded
(
true
);
onFixView
();
onFixView
();
},
},
[
onDelConnect
,
setEdges
,
setNodes
,
onChangeNode
,
onDelNode
]
[
onDelConnect
,
setEdges
,
setNodes
,
on
FixView
,
on
ChangeNode
,
onDelNode
]
);
);
useEffect
(()
=>
{
useEffect
(()
=>
{
...
...
client/src/service/events/pushBill.ts
View file @
ba737622
...
@@ -2,6 +2,7 @@ import { connectToDatabase, Bill, User, ShareChat } from '../mongo';
...
@@ -2,6 +2,7 @@ import { connectToDatabase, Bill, User, ShareChat } from '../mongo';
import
{
BillSourceEnum
}
from
'@/constants/user'
;
import
{
BillSourceEnum
}
from
'@/constants/user'
;
import
{
getModel
}
from
'../utils/data'
;
import
{
getModel
}
from
'../utils/data'
;
import
type
{
BillListItemType
}
from
'@/types/mongoSchema'
;
import
type
{
BillListItemType
}
from
'@/types/mongoSchema'
;
import
{
formatPrice
}
from
'@/utils/user'
;
export
const
createTaskBill
=
async
({
export
const
createTaskBill
=
async
({
appName
,
appName
,
...
@@ -62,7 +63,7 @@ export const finishTaskBill = async ({ billId }: { billId: string }) => {
...
@@ -62,7 +63,7 @@ export const finishTaskBill = async ({ billId }: { billId: string }) => {
if
(
!
res
)
return
;
if
(
!
res
)
return
;
const
total
=
res
.
list
.
reduce
((
sum
,
item
)
=>
sum
+
item
.
amount
,
0
)
||
0
;
const
total
=
res
.
list
.
reduce
((
sum
,
item
)
=>
sum
+
item
.
amount
,
0
)
||
0
;
console
.
log
(
'finish bill:'
,
total
);
console
.
log
(
'finish bill:'
,
formatPrice
(
total
)
);
// 账号扣费
// 账号扣费
await
User
.
findByIdAndUpdate
(
res
.
userId
,
{
await
User
.
findByIdAndUpdate
(
res
.
userId
,
{
...
...
client/src/utils/adapt.ts
View file @
ba737622
...
@@ -104,15 +104,26 @@ export const appModule2FlowNode = ({
...
@@ -104,15 +104,26 @@ export const appModule2FlowNode = ({
intro
:
template
.
intro
,
intro
:
template
.
intro
,
type
:
template
.
type
,
type
:
template
.
type
,
url
:
template
.
url
,
url
:
template
.
url
,
inputs
:
template
.
inputs
.
map
((
templateInput
)
=>
({
inputs
:
template
.
inputs
.
map
((
templateInput
)
=>
{
...
templateInput
,
// use latest inputs
value
:
const
itemInput
=
item
.
inputs
.
find
((
item
)
=>
item
.
key
===
templateInput
.
key
)
||
templateInput
;
item
.
inputs
.
find
((
item
)
=>
item
.
key
===
templateInput
.
key
)?.
value
||
templateInput
.
value
return
{
})),
...
templateInput
,
outputs
:
template
.
outputs
.
map
((
templateOutput
)
=>
({
key
:
itemInput
.
key
,
...
templateOutput
,
value
:
itemInput
.
value
targets
:
item
.
outputs
.
find
((
item
)
=>
item
.
key
===
templateOutput
.
key
)?.
targets
||
[]
};
}))
}),
outputs
:
item
.
outputs
.
map
((
itemOutput
)
=>
{
// unChange outputs
const
templateOutput
=
template
.
outputs
.
find
((
item
)
=>
item
.
key
===
itemOutput
.
key
)
||
itemOutput
;
return
{
...
templateOutput
,
key
:
itemOutput
.
key
,
targets
:
itemOutput
.
targets
||
[]
};
})
};
};
return
{
return
{
...
...
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