Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 开启文件上传开关时设置默认值 #1655

Closed
wants to merge 2 commits into from

Conversation

shaohuzhang1
Copy link
Contributor

fix: 图片理解节点可以作为结束节点 --bug=1049088 --user=刘瑞斌 【应用编排】图片理解模型应该可以作为结束节点 https://www.tapd.cn/57709429/s/1612298
fix: 开启文件上传开关时设置默认值 --bug=1049087 --user=刘瑞斌 【应用编排】开启文件上传后,全局变量列表没有自动生成文件变量 https://www.tapd.cn/57709429/s/1612303

--bug=1049088 --user=刘瑞斌 【应用编排】图片理解模型应该可以作为结束节点 https://www.tapd.cn/57709429/s/1612298
--bug=1049087 --user=刘瑞斌 【应用编排】开启文件上传后,全局变量列表没有自动生成文件变量 https://www.tapd.cn/57709429/s/1612303
Copy link

f2c-ci-robot bot commented Nov 19, 2024

Adding the "do-not-merge/release-note-label-needed" label because no release-note block was detected, please follow our release note process to remove it.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link

f2c-ci-robot bot commented Nov 19, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

const openFileUploadSettingDialog = () => {
FileUploadSettingDialogRef.value?.open(form_data.value.file_upload_setting)
FileUploadSettingDialogRef.value?.open(form_data.value.file_upload_setting || default_upload_setting)
}

const refreshFileUploadForm = (data: any) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码中的问题是:在更新文件上传设置对话框时,原始数据和默认值被覆盖。

解决方案:
需要将form_data.value.file_upload_setting变量重命名,并使用默认值初始化它。这应为:

const defaultUploadSettings = {
  maximumFileSize: new BigInteger(50*1024),
};
...

此外,在FileUploadSettingDialogRef.value.open()函数中传递参数时,请确保正确引用正确的对象(即上标)。例如:

如果要打开一个名为upload_dialog_settings的表单,应当这样写:

FileUploadSettingDialogRef.value?.open(upload_dialog);

这是更安全的方式,特别是在处理用户输入或配置项的地方。
其他地方可能需要注意的是,fileLimit应该是新的数字而不是字符串'50'

@@ -52,7 +52,7 @@ def __init__(self, _id: str, _type: str, x: int, y: int, properties: dict, **kwa
self.__setattr__(keyword, kwargs.get(keyword))


end_nodes = ['ai-chat-node', 'reply-node', 'function-node', 'function-lib-node', 'application-node']
end_nodes = ['ai-chat-node', 'reply-node', 'function-node', 'function-lib-node', 'application-node', 'image-understand-node']


class Flow:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code difference from the given information:

class Flow:
   ...

@@ -5,6 +5,7 @@ const end_nodes: Array<string> = [
WorkflowType.Reply,
WorkflowType.FunctionLib,
WorkflowType.FunctionLibCustom,
WorkflowType.ImageUnderstandNode,
WorkflowType.Application
]
export class WorkFlowInstance {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

代码中缺少一个分号来结束一行,在 export 块中,需要确保每行都有适当的缩进,并正确使用单引号。

以下是修正后的代码:

const end_nodes: Array<string> = [ // 将这里的 {} 改为 [[]]

    WorkflowType.Reply,
    WorkflowType.FunctionLib,
    WorkflowType_functionLibCustom,
    WorkflowType_ImageUnderstandNode,

    WorkflowType.Application
];

这段修改应该没有不合规或潜在问题;如果还存在问题,请告知。

@liuruibin liuruibin closed this Nov 19, 2024
@liuruibin liuruibin deleted the pr@main@fix_file_upload branch November 19, 2024 08:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants