Python Sandbox (#4380)

* Python3 Sandbox (#3944)

* update python box (#4251)

* update python box

* Adjust the height of the NodeCode border.

* update python sandbox and add test systemcall bash

* update sandbox

* add VERSION_RELEASE (#4376)

* save empty docx

* fix pythonbox log error

* fix: js template

---------

Co-authored-by: dogfar <37035781+dogfar@users.noreply.github.com>
Co-authored-by: gggaaallleee <91131304+gggaaallleee@users.noreply.github.com>
Co-authored-by: gggaaallleee <1293587368@qq.com>
This commit is contained in:
Archer
2025-03-28 13:45:09 +08:00
committed by GitHub
parent 8323c2d27e
commit 565a966d19
23 changed files with 777 additions and 92 deletions

View File

@@ -1,7 +1,23 @@
export const JS_TEMPLATE = `function main({data1, data2}){
return {
result: data1,
data2
}
return {
result: data1,
data2
}
}`;
export const PY_TEMPLATE = `def main(data1, data2):
return {
"result": data1,
"data2": data2
}
`;
export enum SandboxCodeTypeEnum {
js = 'js',
py = 'py'
}
export const SNADBOX_CODE_TEMPLATE = {
[SandboxCodeTypeEnum.js]: JS_TEMPLATE,
[SandboxCodeTypeEnum.py]: PY_TEMPLATE
};

View File

@@ -68,12 +68,14 @@ export const CodeNode: FlowNodeTemplateType = {
key: NodeInputKeyEnum.codeType,
renderTypeList: [FlowNodeInputTypeEnum.hidden],
label: '',
valueType: WorkflowIOValueTypeEnum.string,
value: 'js'
},
{
key: NodeInputKeyEnum.code,
renderTypeList: [FlowNodeInputTypeEnum.custom],
label: '',
valueType: WorkflowIOValueTypeEnum.string,
value: JS_TEMPLATE
}
],