Feat/add workflow sys params (#9108)

Co-authored-by: Joel <iamjoel007@gmail.com>
This commit is contained in:
Joe
2024-10-10 11:15:52 +08:00
committed by GitHub
parent 62051d5171
commit e947103b6d
12 changed files with 74 additions and 3 deletions

View File

@@ -405,9 +405,9 @@ const WorkflowWrap = memo(() => {
const initialFeatures: FeaturesData = {
file: {
image: {
enabled: !!features.file_upload?.image.enabled,
number_limits: features.file_upload?.image.number_limits || 3,
transfer_methods: features.file_upload?.image.transfer_methods || ['local_file', 'remote_url'],
enabled: !!features.file_upload?.image?.enabled,
number_limits: features.file_upload?.image?.number_limits || 3,
transfer_methods: features.file_upload?.image?.transfer_methods || ['local_file', 'remote_url'],
},
},
opening: {

View File

@@ -116,6 +116,19 @@ const formatItem = (
variable: 'sys.files',
type: VarType.arrayFile,
})
res.vars.push({
variable: 'sys.app_id',
type: VarType.string,
})
res.vars.push({
variable: 'sys.workflow_id',
type: VarType.string,
})
res.vars.push({
variable: 'sys.workflow_run_id',
type: VarType.string,
})
break
}

View File

@@ -121,6 +121,39 @@ const Panel: FC<NodePanelProps<StartNodeType>> = ({
</div>
}
/>
<VarItem
readonly
payload={{
variable: 'sys.app_id',
} as any}
rightContent={
<div className='text-xs font-normal text-gray-500'>
String
</div>
}
/>
<VarItem
readonly
payload={{
variable: 'sys.workflow_id',
} as any}
rightContent={
<div className='text-xs font-normal text-gray-500'>
String
</div>
}
/>
<VarItem
readonly
payload={{
variable: 'sys.workflow_run_id',
} as any}
rightContent={
<div className='text-xs font-normal text-gray-500'>
String
</div>
}
/>
</div>
</>