feat: The custom parameters can set a default value#5224
feat: The custom parameters can set a default value#5224wangliang181230 wants to merge 1 commit into1Panel-dev:v2from
Conversation
|
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. DetailsInstructions 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-sigs/prow repository. |
|
[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. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
| return json.dumps(data, default=default_serializer, ensure_ascii=False) | ||
| else: | ||
| # 直接输出数组(list)对象 | ||
| return data |
There was a problem hiding this comment.
其他优化1. MySQL 查询 工具,添加 to_json_str 参数,用于控制查询结果是否转为JSON字符串(默认值:1=会转为JSON字符串)
在部分情况下,可设置该参数为0,输出结果不转为JSON字符串,可通过其他工具来处理数据。
同时,input_field_list 字段中添加了 , {"name": "to_json_str", "desc": "结果是否转换为JSON字符串:1=是 | 0=否", "type": "boolean", "source": "custom", "is_required": false, "default_value": "1"}。默认值为 1
| return json_data | ||
|
|
||
| # 关闭数据库连接 | ||
| db.close() |
There was a problem hiding this comment.
其他优化2:代码 db.close() 在 return 之后了,成了无效代码,根本就不会执行该代码。所以 db.close() 放到 finally: 中执行
0bd6c1c to
2268f2f
Compare
| {{ item.desc }} | ||
| </template> | ||
| <AppIcon iconName="app-warning" class="app-warning-icon"></AppIcon> | ||
| </el-tooltip> |
7a20d11 to
f60d4a2
Compare
f60d4a2 to
74ee963
Compare

What this PR does / why we need it?
feat: The custom parameters can set a default value
Summary of your change
新特性:自定义参数,可以设置一个默认值。
界面效果截图:

Please indicate you've done the following: