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
bf33f7af
authored
Nov 05, 2025
by
Archer
Committed by
GitHub
Nov 05, 2025
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add templateId to apps (#5866)
* fix: timeselector ui error * var update node * add templateId to apps
parent
45869fa0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
43 additions
and
32 deletions
+43
-32
packages/global/core/app/type.d.ts
+6
-3
packages/global/support/wallet/usage/type.d.ts
+3
-2
packages/service/core/app/schema.ts
+11
-12
packages/service/support/wallet/usage/schema.ts
+12
-11
projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx
+1
-1
projects/app/src/pages/api/core/app/create.ts
+8
-2
projects/app/src/pages/dashboard/templateMarket/index.tsx
+2
-1
No files found.
packages/global/core/app/type.d.ts
View file @
bf33f7af
...
@@ -29,6 +29,7 @@ export type AppSchema = {
...
@@ -29,6 +29,7 @@ export type AppSchema = {
name
:
string
;
name
:
string
;
avatar
:
string
;
avatar
:
string
;
intro
:
string
;
intro
:
string
;
templateId
?:
string
;
// Create by template
updateTime
:
Date
;
updateTime
:
Date
;
...
@@ -46,16 +47,18 @@ export type AppSchema = {
...
@@ -46,16 +47,18 @@ export type AppSchema = {
scheduledTriggerConfig
?:
AppScheduledTriggerConfigType
|
null
;
scheduledTriggerConfig
?:
AppScheduledTriggerConfigType
|
null
;
scheduledTriggerNextTime
?:
Date
;
scheduledTriggerNextTime
?:
Date
;
inited
?:
boolean
;
teamTags
:
string
[];
inheritPermission
?:
boolean
;
inheritPermission
?:
boolean
;
// if access the app by favourite or quick
// if access the app by favourite or quick
favourite
?:
boolean
;
favourite
?:
boolean
;
quick
?:
boolean
;
quick
?:
boolean
;
/
/ abandon
/
** @deprecated */
defaultPermission
?:
number
;
defaultPermission
?:
number
;
/** @deprecated */
inited
?:
boolean
;
/** @deprecated */
teamTags
:
string
[];
};
};
export
type
AppListItemType
=
{
export
type
AppListItemType
=
{
...
...
packages/global/support/wallet/usage/type.d.ts
View file @
bf33f7af
...
@@ -8,11 +8,12 @@ export type UsageSchemaType = {
...
@@ -8,11 +8,12 @@ export type UsageSchemaType = {
teamId
:
string
;
teamId
:
string
;
tmbId
:
string
;
tmbId
:
string
;
appName
:
string
;
appName
:
string
;
appId
?:
string
;
pluginId
?:
string
;
totalPoints
:
number
;
totalPoints
:
number
;
source
:
`
${
UsageSourceEnum
}
`
;
source
:
`
${
UsageSourceEnum
}
`
;
appId
?:
string
;
datasetId
?:
string
;
// @deprecated
// @deprecated
list
?:
UsageItemType
[];
list
?:
UsageItemType
[];
};
};
...
...
packages/service/core/app/schema.ts
View file @
bf33f7af
...
@@ -60,18 +60,14 @@ const AppSchema = new Schema(
...
@@ -60,18 +60,14 @@ const AppSchema = new Schema(
type
:
String
,
type
:
String
,
default
:
''
default
:
''
},
},
templateId
:
String
,
updateTime
:
{
updateTime
:
{
type
:
Date
,
type
:
Date
,
default
:
()
=>
new
Date
()
default
:
()
=>
new
Date
()
},
},
// role and auth
// Workflow data
teamTags
:
{
type
:
[
String
]
},
// save app(Not publish)
modules
:
{
modules
:
{
type
:
Array
,
type
:
Array
,
default
:
[]
default
:
[]
...
@@ -83,7 +79,8 @@ const AppSchema = new Schema(
...
@@ -83,7 +79,8 @@ const AppSchema = new Schema(
chatConfig
:
{
chatConfig
:
{
type
:
chatConfigType
type
:
chatConfigType
},
},
// plugin config
// Tool config
pluginData
:
{
pluginData
:
{
type
:
{
type
:
{
nodeVersion
:
String
,
nodeVersion
:
String
,
...
@@ -108,19 +105,21 @@ const AppSchema = new Schema(
...
@@ -108,19 +105,21 @@ const AppSchema = new Schema(
type
:
Date
type
:
Date
},
},
inited
:
{
type
:
Boolean
},
inheritPermission
:
{
inheritPermission
:
{
type
:
Boolean
,
type
:
Boolean
,
default
:
true
default
:
true
},
},
// Chat setting
favourite
:
Boolean
,
favourite
:
Boolean
,
quick
:
Boolean
,
quick
:
Boolean
,
// abandoned
/** @deprecated */
defaultPermission
:
Number
defaultPermission
:
Number
,
inited
:
Boolean
,
teamTags
:
{
type
:
[
String
]
}
},
},
{
{
minimize
:
false
minimize
:
false
...
...
packages/service/support/wallet/usage/schema.ts
View file @
bf33f7af
...
@@ -7,6 +7,8 @@ import {
...
@@ -7,6 +7,8 @@ import {
TeamMemberCollectionName
TeamMemberCollectionName
}
from
'@fastgpt/global/support/user/team/constant'
;
}
from
'@fastgpt/global/support/user/team/constant'
;
import
{
UsageCollectionName
,
UsageItemCollectionName
}
from
'./constants'
;
import
{
UsageCollectionName
,
UsageItemCollectionName
}
from
'./constants'
;
import
{
AppCollectionName
}
from
'../../../core/app/schema'
;
import
{
DatasetCollectionName
}
from
'../../../core/dataset/schema'
;
const
UsageSchema
=
new
Schema
(
const
UsageSchema
=
new
Schema
(
{
{
...
@@ -25,29 +27,28 @@ const UsageSchema = new Schema(
...
@@ -25,29 +27,28 @@ const UsageSchema = new Schema(
enum
:
Object
.
values
(
UsageSourceEnum
),
enum
:
Object
.
values
(
UsageSourceEnum
),
required
:
true
required
:
true
},
},
// usage name
appName
:
{
appName
:
{
// usage name
type
:
String
,
type
:
String
,
default
:
''
default
:
''
},
},
// total points
totalPoints
:
{
totalPoints
:
{
// total points
type
:
Number
,
type
:
Number
,
required
:
true
required
:
true
},
},
time
:
{
type
:
Date
,
default
:
()
=>
new
Date
()
},
appId
:
{
appId
:
{
type
:
Schema
.
Types
.
ObjectId
,
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'apps'
,
ref
:
AppCollectionName
required
:
false
},
},
plugin
Id
:
{
dataset
Id
:
{
type
:
Schema
.
Types
.
ObjectId
,
type
:
Schema
.
Types
.
ObjectId
,
ref
:
'plugins'
,
ref
:
DatasetCollectionName
required
:
false
},
time
:
{
type
:
Date
,
default
:
()
=>
new
Date
()
},
},
// @description It will not be used again in the future.
// @description It will not be used again in the future.
...
...
projects/app/src/pageComponents/app/detail/SimpleApp/components/ToolSelectModal.tsx
View file @
bf33f7af
...
@@ -484,7 +484,7 @@ const RenderList = React.memo(function RenderList({
...
@@ -484,7 +484,7 @@ const RenderList = React.memo(function RenderList({
_hover=
{
{
_hover=
{
{
color
:
'primary.600'
color
:
'primary.600'
}
}
}
}
onClick=
{
()
=>
router
.
push
(
'/
toolkit/tools
'
)
}
onClick=
{
()
=>
router
.
push
(
'/
plugin/tool
'
)
}
gap=
{
1
}
gap=
{
1
}
bottom=
{
0
}
bottom=
{
0
}
right=
{
[
3
,
6
]
}
right=
{
[
3
,
6
]
}
...
...
projects/app/src/pages/api/core/app/create.ts
View file @
bf33f7af
...
@@ -39,11 +39,14 @@ export type CreateAppBody = {
...
@@ -39,11 +39,14 @@ export type CreateAppBody = {
modules
:
AppSchema
[
'modules'
];
modules
:
AppSchema
[
'modules'
];
edges
?:
AppSchema
[
'edges'
];
edges
?:
AppSchema
[
'edges'
];
chatConfig
?:
AppSchema
[
'chatConfig'
];
chatConfig
?:
AppSchema
[
'chatConfig'
];
templateId
?:
string
;
utmParams
?:
ShortUrlParams
;
utmParams
?:
ShortUrlParams
;
};
};
async
function
handler
(
req
:
ApiRequestProps
<
CreateAppBody
>
)
{
async
function
handler
(
req
:
ApiRequestProps
<
CreateAppBody
>
)
{
const
{
parentId
,
name
,
avatar
,
intro
,
type
,
modules
,
edges
,
chatConfig
,
utmParams
}
=
req
.
body
;
const
{
parentId
,
name
,
avatar
,
intro
,
type
,
modules
,
edges
,
chatConfig
,
templateId
,
utmParams
}
=
req
.
body
;
if
(
!
name
||
!
type
||
!
Array
.
isArray
(
modules
))
{
if
(
!
name
||
!
type
||
!
Array
.
isArray
(
modules
))
{
return
Promise
.
reject
(
CommonErrEnum
.
inheritPermissionError
);
return
Promise
.
reject
(
CommonErrEnum
.
inheritPermissionError
);
...
@@ -122,6 +125,7 @@ export const onCreateApp = async ({
...
@@ -122,6 +125,7 @@ export const onCreateApp = async ({
pluginData
,
pluginData
,
username
,
username
,
userAvatar
,
userAvatar
,
templateId
,
session
session
}:
{
}:
{
parentId
?:
ParentIdType
;
parentId
?:
ParentIdType
;
...
@@ -137,6 +141,7 @@ export const onCreateApp = async ({
...
@@ -137,6 +141,7 @@ export const onCreateApp = async ({
pluginData
?:
AppSchema
[
'pluginData'
];
pluginData
?:
AppSchema
[
'pluginData'
];
username
?:
string
;
username
?:
string
;
userAvatar
?:
string
;
userAvatar
?:
string
;
templateId
?:
string
;
session
?:
ClientSession
;
session
?:
ClientSession
;
})
=>
{
})
=>
{
const
create
=
async
(
session
:
ClientSession
)
=>
{
const
create
=
async
(
session
:
ClientSession
)
=>
{
...
@@ -154,7 +159,8 @@ export const onCreateApp = async ({
...
@@ -154,7 +159,8 @@ export const onCreateApp = async ({
chatConfig
,
chatConfig
,
type
,
type
,
version
:
'v2'
,
version
:
'v2'
,
pluginData
pluginData
,
templateId
}
}
],
],
{
session
,
ordered
:
true
}
{
session
,
ordered
:
true
}
...
...
projects/app/src/pages/dashboard/templateMarket/index.tsx
View file @
bf33f7af
...
@@ -74,7 +74,8 @@ const TemplateMarket = ({
...
@@ -74,7 +74,8 @@ const TemplateMarket = ({
type
:
template
.
type
as
AppTypeEnum
,
type
:
template
.
type
as
AppTypeEnum
,
modules
:
templateDetail
.
workflow
.
nodes
||
[],
modules
:
templateDetail
.
workflow
.
nodes
||
[],
edges
:
templateDetail
.
workflow
.
edges
||
[],
edges
:
templateDetail
.
workflow
.
edges
||
[],
chatConfig
:
templateDetail
.
workflow
.
chatConfig
chatConfig
:
templateDetail
.
workflow
.
chatConfig
,
templateId
:
templateDetail
.
templateId
}).
then
((
res
)
=>
{
}).
then
((
res
)
=>
{
webPushTrack
.
useAppTemplate
({
webPushTrack
.
useAppTemplate
({
id
:
res
,
id
:
res
,
...
...
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