From 622e1559abb8375ac409e4accbcce96279b7bfe8 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Tue, 10 Sep 2024 16:44:16 +0800 Subject: [PATCH 01/14] =?UTF-8?q?feat:=20=E7=89=88=E6=9C=AC=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=94=AF=E6=8C=81=E8=8B=B1=E6=96=87=20#16?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module_settings.py | 2 +- version_logs_md_en/V1.4.0_2024-01-24.md | 7 +++++++ version_logs_md_en/V1.5.0_2024-02-22.md | 6 ++++++ version_logs_md_en/V1.6.0_2024-03-27.md | 4 ++++ version_logs_md_en/V1.7.0_2024-06-06.md | 8 ++++++++ version_logs_md_en/V1.8.0_2024-08-01.md | 5 +++++ 6 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 version_logs_md_en/V1.4.0_2024-01-24.md create mode 100644 version_logs_md_en/V1.5.0_2024-02-22.md create mode 100644 version_logs_md_en/V1.6.0_2024-03-27.md create mode 100644 version_logs_md_en/V1.7.0_2024-06-06.md create mode 100644 version_logs_md_en/V1.8.0_2024-08-01.md diff --git a/module_settings.py b/module_settings.py index 5f249e4..fd80274 100644 --- a/module_settings.py +++ b/module_settings.py @@ -242,7 +242,7 @@ def check_engine_admin_permission(request, *args, **kwargs): BK_APIGW_GRANT_APPS = env.BK_APIGW_GRANT_APPS # version log config - VERSION_LOG = {"FILE_TIME_FORMAT": "%Y-%m-%d"} + VERSION_LOG = {"FILE_TIME_FORMAT": "%Y-%m-%d", "LANGUAGE_MAPPINGS": {"en": "en"}} # bk notice config DISABLE_REGISTER_BKFLOW_TO_BKNOTICE = env.DISABLE_REGISTER_BKFLOW_TO_BKNOTICE diff --git a/version_logs_md_en/V1.4.0_2024-01-24.md b/version_logs_md_en/V1.4.0_2024-01-24.md new file mode 100644 index 0000000..fe2d48d --- /dev/null +++ b/version_logs_md_en/V1.4.0_2024-01-24.md @@ -0,0 +1,7 @@ +# V1.4.0 Release Notes + +- [ Feature ] Support for embedded process orchestration canvas +- [ Feature ] Support for process task execution +- [ Feature ] Support for highly extensible & customizable features +- [ Feature ] Support for multiple access methods +- [ Feature ] Support for multiple integration methods \ No newline at end of file diff --git a/version_logs_md_en/V1.5.0_2024-02-22.md b/version_logs_md_en/V1.5.0_2024-02-22.md new file mode 100644 index 0000000..8ee73eb --- /dev/null +++ b/version_logs_md_en/V1.5.0_2024-02-22.md @@ -0,0 +1,6 @@ +# V1.5.0 Release Notes + +- [ Feature ] Support for vertical process canvas +- [ Feature ] Mock functionality for processes +- [ Feature ] Support for webhook module +- [ Feature ] Support for BlueKing plugin space call limit \ No newline at end of file diff --git a/version_logs_md_en/V1.6.0_2024-03-27.md b/version_logs_md_en/V1.6.0_2024-03-27.md new file mode 100644 index 0000000..1b72d0a --- /dev/null +++ b/version_logs_md_en/V1.6.0_2024-03-27.md @@ -0,0 +1,4 @@ +# V1.6.0 Release Notes + +- [ Feature ] Management interface supports quick space configuration for space administrators +- [ Feature ] Management interface supports quick access to space and module information for system administrators \ No newline at end of file diff --git a/version_logs_md_en/V1.7.0_2024-06-06.md b/version_logs_md_en/V1.7.0_2024-06-06.md new file mode 100644 index 0000000..53c2eef --- /dev/null +++ b/version_logs_md_en/V1.7.0_2024-06-06.md @@ -0,0 +1,8 @@ +# V1.7.0 Release Notes + +- [ Feature ] BKFlow welcome introduction page +- [ Feature ] Management interface supports users creating new spaces to experience full functionality +- [ Feature ] Support for decision table functionality based on processes +- [ Improvement ] Management interface interaction optimization +- [ Improvement ] Management interface space list optimization +- [ Bugfix ] Fixed several bugs diff --git a/version_logs_md_en/V1.8.0_2024-08-01.md b/version_logs_md_en/V1.8.0_2024-08-01.md new file mode 100644 index 0000000..a9c4af4 --- /dev/null +++ b/version_logs_md_en/V1.8.0_2024-08-01.md @@ -0,0 +1,5 @@ +# V1.8.0 Release Notes + +- [ Feature ] Page support for internationalization +- [ Feature ] Community version functionality support +- [ Bugfix ] Fixed several bugs \ No newline at end of file From 0cea4a30209f0d6b1bccd8d4878e7b01de05385c Mon Sep 17 00:00:00 2001 From: v_xugzhou <941071842@qq.com> Date: Wed, 11 Sep 2024 09:25:03 +0800 Subject: [PATCH 02/14] =?UTF-8?q?fix:=20=E4=B8=AD=E5=BF=83=E5=AF=BC?= =?UTF-8?q?=E8=88=AA=E5=9B=BD=E9=99=85=E5=8C=96=E8=A7=84=E8=8C=83=E8=B0=83?= =?UTF-8?q?=E6=95=B4=20--bug=3D130458497=20#=20Reviewed,=20transaction=20i?= =?UTF-8?q?d:=2018036?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/config/i18n/en.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/config/i18n/en.js b/frontend/src/config/i18n/en.js index 7dc73b5..51283e8 100644 --- a/frontend/src/config/i18n/en.js +++ b/frontend/src/config/i18n/en.js @@ -218,7 +218,7 @@ const en = { 系统管理: 'System Management', 中文: 'Chinese', 产品文档: 'Documentation', - 版本日志: 'Release note', + 版本日志: 'Release Notes', 流程: 'Process', 任务: 'Task', 调试任务: 'Debug Task', @@ -889,7 +889,7 @@ const en = { '流程任务事件并进行自动化扩展。': 'process and task events and automate scaling.', 支持计算和存储资源隔离: 'Computing & Storage Resource Isolation', '任务执行和数据可与其他接入空间隔离。': 'Task execution data can be isolated from other access spaces.', - 退出登录: 'Sign out', + 退出登录: 'Sign Out', 首页: 'Home', 字段标识已经存在: 'Field identifier already exists', key值只能由数字和字母组成且不能以数字开头: 'Key value can only consist of letters and numbers and cannot start with a number', From e6d4ea9ab7381def7371c1a94167a2f79c4c7632 Mon Sep 17 00:00:00 2001 From: normal-wls Date: Fri, 13 Sep 2024 11:00:18 +0800 Subject: [PATCH 03/14] =?UTF-8?q?perf:=20=E4=B8=8B=E6=8B=89=E6=A1=86?= =?UTF-8?q?=E5=8F=98=E9=87=8F=E7=A7=BB=E9=99=A4=E8=BF=9C=E7=A8=8B=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E6=BA=90=E9=80=89=E9=A1=B9=20#20=20(#21)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * perf: 下拉框变量移除远程数据源选项 #20 * fix: flake8 fix #20 --- bkflow/pipeline_plugins/query/select.py | 81 +++++++++---------- .../static/variables/select.js | 34 ++++---- 2 files changed, 58 insertions(+), 57 deletions(-) diff --git a/bkflow/pipeline_plugins/query/select.py b/bkflow/pipeline_plugins/query/select.py index aab868b..5522134 100644 --- a/bkflow/pipeline_plugins/query/select.py +++ b/bkflow/pipeline_plugins/query/select.py @@ -21,55 +21,54 @@ import logging -import requests -from django.conf import settings from django.http import JsonResponse -from django.utils.translation import ugettext_lazy as _ logger = logging.getLogger("root") def variable_select_source_data_proxy(request): """ - @summary: 获取下拉框源数据的通用接口 + @summary: 获取下拉框源数据的通用接口,暂时关闭该接口 @param request: @return: """ - url = request.GET.get("url") - try: - response = requests.get(url=url, verify=False, timeout=10) - except Exception as e: - logger.exception("variable select get data from url[url={url}] raise error: {error}".format(url=url, error=e)) - text = _("请求数据异常: {error}").format(error=e) - data = [{"text": text, "value": ""}] - return JsonResponse(data, safe=False) + return JsonResponse([{"text": "text1", "value": "value1"}]) - try: - data = response.json() - except Exception: - try: - content = response.content.decode(response.encoding) - logger.exception( - "variable select get data from url[url={url}] is not a valid JSON: {data}".format( - url=url, data=content[:500] - ) - ) - except Exception: - logger.exception("variable select get data from url[url={url}] data is not a valid JSON".format(url=url)) - text = _("返回数据格式错误,不是合法 JSON 格式") - data = [{"text": text, "value": ""}] - return JsonResponse(data, safe=False) - - # 支持开发者对远程数据源数据配置处理函数,进行再处理 - post_process_function = getattr(settings, "REMOTE_SOURCE_DATA_TRANSFORM_FUNCTION", None) - if post_process_function and callable(post_process_function): - try: - data = post_process_function(data) - except Exception as e: - logger.exception( - "variable select transforming data from remote resource url[url={url}] " - "raise error: {error}".format(url=url, error=e) - ) - text = _("远程数据源数据转换失败: {error}").format(error=e) - data = [{"text": text, "value": ""}] - return JsonResponse(data, safe=False) + # url = request.GET.get("url") + # try: + # response = requests.get(url=url, verify=False, timeout=10) + # except Exception as e: + # logger.exception("variable select get data from url[url={url}] raise error: {error}".format(url=url, error=e)) + # text = _("请求数据异常: {error}").format(error=e) + # data = [{"text": text, "value": ""}] + # return JsonResponse(data, safe=False) + # + # try: + # data = response.json() + # except Exception: + # try: + # content = response.content.decode(response.encoding) + # logger.exception( + # "variable select get data from url[url={url}] is not a valid JSON: {data}".format( + # url=url, data=content[:500] + # ) + # ) + # except Exception: + # logger.exception("variable select get data from url[url={url}] data is not a valid JSON".format(url=url)) + # text = _("返回数据格式错误,不是合法 JSON 格式") + # data = [{"text": text, "value": ""}] + # return JsonResponse(data, safe=False) + # + # # 支持开发者对远程数据源数据配置处理函数,进行再处理 + # post_process_function = getattr(settings, "REMOTE_SOURCE_DATA_TRANSFORM_FUNCTION", None) + # if post_process_function and callable(post_process_function): + # try: + # data = post_process_function(data) + # except Exception as e: + # logger.exception( + # "variable select transforming data from remote resource url[url={url}] " + # "raise error: {error}".format(url=url, error=e) + # ) + # text = _("远程数据源数据转换失败: {error}").format(error=e) + # data = [{"text": text, "value": ""}] + # return JsonResponse(data, safe=False) diff --git a/bkflow/pipeline_plugins/static/variables/select.js b/bkflow/pipeline_plugins/static/variables/select.js index 80da7db..d5eafa0 100644 --- a/bkflow/pipeline_plugins/static/variables/select.js +++ b/bkflow/pipeline_plugins/static/variables/select.js @@ -16,6 +16,7 @@ hookable: true, items: [{name: gettext("自定义"), value: "0"}, {name: gettext("远程数据源"), value: "1"}], value: "0", + hidden: true, validation: [ { type: "required" @@ -29,7 +30,7 @@ attrs: { name: gettext("选项"), hookable: true, - placeholder: gettext('请输入数据源信息,自定义数据源格式为 [{"text": "", "value": ""}...],若是远程数据源则填写返回该格式数据的 URL'), + placeholder: gettext('请输入数据源信息,自定义数据源格式为 [{"text": "", "value": ""}...]'), validation: [ { type: "required" @@ -73,10 +74,11 @@ let remote_url = ""; let items = []; let placeholder = ''; - if (metaConfig.datasource === "1") { - remote_url = $.context.get('site_url') + 'api/plugin_query/variable_select_source_data_proxy/?url=' + metaConfig.items_text; - remote = true; - } else { + // if (metaConfig.datasource === "1") { + // remote_url = $.context.get('site_url') + 'api/plugin_query/variable_select_source_data_proxy/?url=' + metaConfig.items_text; + // remote = true; + // } + if (metaConfig.datasource === "0") { try { items = JSON.parse(metaConfig.items_text); } catch (err) { @@ -92,16 +94,16 @@ let multiple = false; let default_val = metaConfig.default || ''; - if (metaConfig.type === "1") { - multiple = true; - default_val = []; - if (metaConfig.default) { - let vals = metaConfig.default.split(','); - for (let i in vals) { - default_val.push(vals[i].trim()); - } - } - } + // if (metaConfig.type === "1") { + // multiple = true; + // default_val = []; + // if (metaConfig.default) { + // let vals = metaConfig.default.split(','); + // for (let i in vals) { + // default_val.push(vals[i].trim()); + // } + // } + // } return { tag_code: this.tag_code, type: "select", @@ -115,7 +117,7 @@ remote_url: remote_url, placeholder: placeholder, remote_data_init: function (data) { - return data + return data; }, validation: [ { From 4316885d9b5cc4a4e5ca80700e43e9e449b57475 Mon Sep 17 00:00:00 2001 From: v_xugzhou <941071842@qq.com> Date: Wed, 9 Oct 2024 10:02:02 +0800 Subject: [PATCH 04/14] =?UTF-8?q?fix:=201.8.0=E4=BA=A7=E5=93=81=E9=AA=8C?= =?UTF-8?q?=E6=94=B6=E9=97=AE=E9=A2=98=20--story=3D131115507=20#=20Reviewe?= =?UTF-8?q?d,=20transaction=20id:=2019969?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 4 ++-- .../src/components/layout/NavigationHeadLeft.vue | 3 ++- frontend/src/config/i18n/cn.js | 13 ++++++++----- frontend/src/config/i18n/en.js | 13 ++++++++----- frontend/src/mixins/tableHeader.js | 5 +++-- frontend/src/scss/common.scss | 3 +++ .../src/views/admin/Space/DecisionTable/index.vue | 6 +++--- frontend/src/views/admin/Space/Task/index.vue | 6 +++--- .../admin/Space/Template/CreateTaskDialog.vue | 5 +++-- .../admin/Space/Template/CreateTemplateDialog.vue | 2 ++ frontend/src/views/admin/Space/Template/index.vue | 4 ++-- frontend/src/views/admin/common/SpaceDialog.vue | 14 +++++++++++++- 12 files changed, 52 insertions(+), 26 deletions(-) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 35f673b..37cbf87 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -191,8 +191,8 @@ body { min-width: 1366px; } .with-system-notice { - height: calc(100vh - 40px); - /deep/.container-content { + height: calc(100vh - 40px) !important; + .container-content { max-height: calc(100vh - 92px)!important; } } diff --git a/frontend/src/components/layout/NavigationHeadLeft.vue b/frontend/src/components/layout/NavigationHeadLeft.vue index 1506a95..675847d 100644 --- a/frontend/src/components/layout/NavigationHeadLeft.vue +++ b/frontend/src/components/layout/NavigationHeadLeft.vue @@ -59,7 +59,8 @@ }, methods: { onHandleNavClick(nav) { - if (this.navActive === nav.id) return; + const { meta } = this.$route; + if (this.navActive === nav.id && meta.admin) return; if (nav.id === 'space-manager') { this.$router.push({ name: 'spaceAdmin' }); diff --git a/frontend/src/config/i18n/cn.js b/frontend/src/config/i18n/cn.js index c324f75..9377401 100644 --- a/frontend/src/config/i18n/cn.js +++ b/frontend/src/config/i18n/cn.js @@ -386,11 +386,11 @@ const cn = { '描述:': '描述:', '关联流程:': '关联流程:', 请选择: '请选择', - 'ID/名称/创建人/更新人/所属模板 Id/所属作用域类型/所属作用域值': 'ID/名称/创建人/更新人/所属模板 Id/所属作用域类型/所属作用域值', + 'ID/名称/创建人/更新人/所属模板 ID/所属作用域类型/所属作用域值': 'ID/名称/创建人/更新人/所属模板 ID/所属作用域类型/所属作用域值', 操作: '操作', 所属作用域类型: '所属作用域类型', 所属作用域值: '所属作用域值', - '所属模板 Id': '所属模板 Id', + '所属模板 ID': '所属模板 ID', 创建人: '创建人', 更新人: '更新人', 恢复默认值: '恢复默认值', @@ -399,7 +399,7 @@ const cn = { '数据格式不正确,应为JSON格式': '数据格式不正确,应为JSON格式', '确认" {0} "恢复默认值?': '确认" {0} "恢复默认值?', '删除成功!': '删除成功!', - 'ID/任务名称/创建人/执行人/所属模板 Id/所属作用域类型/所属作用域值': 'ID/任务名称/创建人/执行人/所属模板 Id/所属作用域类型/所属作用域值', + 'ID/任务名称/创建人/执行人/所属模板 ID/所属作用域类型/所属作用域值': 'ID/任务名称/创建人/执行人/所属模板 ID/所属作用域类型/所属作用域值', 引擎操作: '引擎操作', 任务名称: '任务名称', 执行人: '执行人', @@ -409,14 +409,14 @@ const cn = { 未知: '未知', '任务删除成功!': '任务删除成功!', 新建任务: '新建任务', - 模板Id: '模板Id', + 模板ID: '模板ID', 请求参数: '请求参数', '请求参数格式不正确,应为JSON格式': '请求参数格式不正确,应为JSON格式', 任务创建成功: '任务创建成功', 新建流程: '新建流程', 流程名称: '流程名称', 流程创建成功: '流程创建成功', - 'ID/模板名称/创建人/更新人/启用/所属作用域类型/所属作用域值': 'ID/模板名称/创建人/更新人/启用/所属作用域类型/所属作用域值', + 'ID/流程名称/创建人/更新人/启用/所属作用域类型/所属作用域值': 'ID/流程名称/创建人/更新人/启用/所属作用域类型/所属作用域值', 创建流程: '创建流程', '当前已选择 x 条数据': '当前已选择 {num} 条数据', ',': ',', @@ -903,6 +903,9 @@ const cn = { 天: '天 | {n} 天 | {n} 天', 新建全局变量: '新建全局变量', error_handle_秒: '秒', + 流程的入参: '流程的入参', + scopeType: '指对应资源在接入平台所属的作用域范围的类型。如该资源属于业务 1,则该字段的值可设为"project"。', + scopeValue: '指对应资源在接入平台所属的作用域范围的值。如该资源属于业务1,则该字段的值可设为"1"。', }; export default cn; diff --git a/frontend/src/config/i18n/en.js b/frontend/src/config/i18n/en.js index 51283e8..32a24d4 100644 --- a/frontend/src/config/i18n/en.js +++ b/frontend/src/config/i18n/en.js @@ -386,11 +386,11 @@ const en = { '描述:': 'Description:', '关联流程:': 'Related Process:', 请选择: 'Please Select', - 'ID/名称/创建人/更新人/所属模板 Id/所属作用域类型/所属作用域值': 'ID/Name/Created by/Updater/Template ID/Scope Type/Scope Value', + 'ID/名称/创建人/更新人/所属模板 ID/所属作用域类型/所属作用域值': 'ID/Name/Created by/Updater/Template ID/Scope Type/Scope Value', 操作: 'Operation', 所属作用域类型: 'Scope Type', 所属作用域值: 'Scope Value', - '所属模板 Id': 'Template ID', + '所属模板 ID': 'Template ID', 创建人: 'Created by', 更新人: 'Updater', 恢复默认值: 'Reset', @@ -399,7 +399,7 @@ const en = { '数据格式不正确,应为JSON格式': 'Incorrect data format, should be in JSON format', '确认" {0} "恢复默认值?': 'Confirm to reset value for "{0}"?', '删除成功!': 'Deleted Successfully!', - 'ID/任务名称/创建人/执行人/所属模板 Id/所属作用域类型/所属作用域值': 'ID/Task Name/Created by/Executor/Template ID/Scope Type/Scope Value', + 'ID/任务名称/创建人/执行人/所属模板 ID/所属作用域类型/所属作用域值': 'ID/Task Name/Created by/Executor/Template ID/Scope Type/Scope Value', 引擎操作: 'Engine Operation', 任务名称: 'Task Name', 执行人: 'Executor', @@ -409,14 +409,14 @@ const en = { 未知: 'Unknown', '任务删除成功!': 'Task Deleted Successfully!', 新建任务: 'Create Task', - 模板Id: 'Template ID', + 模板ID: 'Template ID', 请求参数: 'Request Parameters', '请求参数格式不正确,应为JSON格式': 'Request parameters are not in the correct format, should be in JSON format', 任务创建成功: 'Task Created Successfully', 新建流程: 'Add', 流程名称: 'Process Name', 流程创建成功: 'Process Created Successfully', - 'ID/模板名称/创建人/更新人/启用/所属作用域类型/所属作用域值': 'ID/Template Name/Created by/Updater/Enabled/Scope Type/Scope Value', + 'ID/流程名称/创建人/更新人/启用/所属作用域类型/所属作用域值': 'ID/Flow Name/Created by/Updater/Enabled/Scope Type/Scope Value', 创建流程: 'Add', '当前已选择 x 条数据': 'Currently Selected {num} Items', ',': ', ', @@ -903,6 +903,9 @@ const en = { 天: 'Day | one day | {n} days', 新建全局变量: 'Add Global Variables', error_handle_秒: 'Sec Interval', + 流程的入参: 'Input Parameters of the Process', + scopeType: 'Indicates the type of the scope to which the corresponding resource belongs in the access platform. For example, if the resource belongs to Business 1, the value of this field can be set to "project".', + scopeValue: 'Indicates the value of the scope to which the corresponding resource belongs in the access platform. For example, if the resource belongs to Business 1, the value of this field can be set to "1".', }; export default en; diff --git a/frontend/src/mixins/tableHeader.js b/frontend/src/mixins/tableHeader.js index ebc8f47..e0b6e36 100644 --- a/frontend/src/mixins/tableHeader.js +++ b/frontend/src/mixins/tableHeader.js @@ -1,5 +1,6 @@ import TableRenderHeader from '@/components/common/TableRenderHeader.vue'; +import i18n from '@/config/i18n/index.js'; const tableHeader = { methods: { @@ -17,8 +18,8 @@ const tableHeader = { ; } if (['scope_type', 'scope_value'].includes(column.property)) { const tips = column.property === 'scope_type' - ? '指对应资源在接入平台所属的作用域范围的类型,方便接入平台对资源进行自定义过滤。如该资源属于业务 1,则该字段的值可设为"project"。' - : '指对应资源在接入平台所属的作用域范围的值,方便接入平台对资源进行自定义过滤。如该资源属于业务1,则该字段的值可设为"1"。'; + ? i18n.t('scopeType') + : i18n.t('scopeValue'); return h('span', { class: 'scope-column-label', }, [ diff --git a/frontend/src/scss/common.scss b/frontend/src/scss/common.scss index 4c785d5..d0947ef 100644 --- a/frontend/src/scss/common.scss +++ b/frontend/src/scss/common.scss @@ -391,7 +391,10 @@ white-space: nowrap; word-wrap: normal; text-overflow: ellipsis; + } } + .bk-table-fixed-right { + border-bottom: none; } } // 异常提示固定高度 diff --git a/frontend/src/views/admin/Space/DecisionTable/index.vue b/frontend/src/views/admin/Space/DecisionTable/index.vue index 5993f27..8763ed4 100644 --- a/frontend/src/views/admin/Space/DecisionTable/index.vue +++ b/frontend/src/views/admin/Space/DecisionTable/index.vue @@ -3,7 +3,7 @@ @@ -126,7 +126,7 @@ }, { id: 'template_id', - label: i18n.t('所属模板 Id'), + label: i18n.t('所属模板 ID'), width: 100, }, { @@ -170,7 +170,7 @@ }, { id: 'template_id', - name: i18n.t('所属模板 Id'), + name: i18n.t('所属模板 ID'), }, { id: 'scope_type', diff --git a/frontend/src/views/admin/Space/Task/index.vue b/frontend/src/views/admin/Space/Task/index.vue index 22a3025..60b1e5b 100644 --- a/frontend/src/views/admin/Space/Task/index.vue +++ b/frontend/src/views/admin/Space/Task/index.vue @@ -3,7 +3,7 @@ @@ -128,7 +128,7 @@ }, { id: 'template_id', - label: i18n.t('所属模板 Id'), + label: i18n.t('所属模板 ID'), width: 100, }, { @@ -187,7 +187,7 @@ }, { id: 'template_id', - name: i18n.t('所属模板 Id'), + name: i18n.t('所属模板 ID'), }, { id: 'scope_type', diff --git a/frontend/src/views/admin/Space/Template/CreateTaskDialog.vue b/frontend/src/views/admin/Space/Template/CreateTaskDialog.vue index d7ef761..9402179 100644 --- a/frontend/src/views/admin/Space/Template/CreateTaskDialog.vue +++ b/frontend/src/views/admin/Space/Template/CreateTaskDialog.vue @@ -15,7 +15,7 @@ :label-width="100" :model="taskFormData">
+ :options="{ language: 'json', placeholder: { '${key}': 'value' } }" />
diff --git a/frontend/src/views/admin/Space/Template/CreateTemplateDialog.vue b/frontend/src/views/admin/Space/Template/CreateTemplateDialog.vue index cd8ec19..ea057b1 100644 --- a/frontend/src/views/admin/Space/Template/CreateTemplateDialog.vue +++ b/frontend/src/views/admin/Space/Template/CreateTemplateDialog.vue @@ -26,6 +26,7 @@ @@ -193,7 +193,7 @@ }, { id: 'name', - name: i18n.t('模板名称'), + name: i18n.t('流程名称'), isDefaultOption: true, }, { diff --git a/frontend/src/views/admin/common/SpaceDialog.vue b/frontend/src/views/admin/common/SpaceDialog.vue index 36cdb14..c067ac1 100644 --- a/frontend/src/views/admin/common/SpaceDialog.vue +++ b/frontend/src/views/admin/common/SpaceDialog.vue @@ -20,7 +20,7 @@ :key="field.key" :label="field.label" :required="true" - :rules="rules.required" + :rules="field.key === 'platform_url' ? rules.url: rules.required" :property="field.key"> /^(https?:\/\/)/.test(val), + message: i18n.t('请提供以 https:// 或 http:// 开头的服务地址'), + trigger: 'blur', + }, + ], }, editLoading: false, }; From 63c53bd4ce2eb7202f93b1c42f52d115ab2be8df Mon Sep 17 00:00:00 2001 From: v_xugzhou <941071842@qq.com> Date: Wed, 9 Oct 2024 10:45:53 +0800 Subject: [PATCH 05/14] =?UTF-8?q?fix:=20=E7=A9=BA=E9=97=B4=E9=85=8D?= =?UTF-8?q?=E7=BD=AE-=E5=90=8D=E7=A7=B0=E5=9B=BD=E9=99=85=E5=8C=96=20--sto?= =?UTF-8?q?ry=3D131115479=20#=20Reviewed,=20transaction=20id:=2019974?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/config/i18n/cn.js | 1 + frontend/src/config/i18n/en.js | 1 + frontend/src/views/admin/Space/SpaceConfig/index.vue | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/config/i18n/cn.js b/frontend/src/config/i18n/cn.js index 9377401..86667b4 100644 --- a/frontend/src/config/i18n/cn.js +++ b/frontend/src/config/i18n/cn.js @@ -906,6 +906,7 @@ const cn = { 流程的入参: '流程的入参', scopeType: '指对应资源在接入平台所属的作用域范围的类型。如该资源属于业务 1,则该字段的值可设为"project"。', scopeValue: '指对应资源在接入平台所属的作用域范围的值。如该资源属于业务1,则该字段的值可设为"1"。', + 名字: '名字', }; export default cn; diff --git a/frontend/src/config/i18n/en.js b/frontend/src/config/i18n/en.js index 32a24d4..dbcf130 100644 --- a/frontend/src/config/i18n/en.js +++ b/frontend/src/config/i18n/en.js @@ -906,6 +906,7 @@ const en = { 流程的入参: 'Input Parameters of the Process', scopeType: 'Indicates the type of the scope to which the corresponding resource belongs in the access platform. For example, if the resource belongs to Business 1, the value of this field can be set to "project".', scopeValue: 'Indicates the value of the scope to which the corresponding resource belongs in the access platform. For example, if the resource belongs to Business 1, the value of this field can be set to "1".', + 名字: 'Name', }; export default en; diff --git a/frontend/src/views/admin/Space/SpaceConfig/index.vue b/frontend/src/views/admin/Space/SpaceConfig/index.vue index c018dcb..d98cce1 100644 --- a/frontend/src/views/admin/Space/SpaceConfig/index.vue +++ b/frontend/src/views/admin/Space/SpaceConfig/index.vue @@ -118,7 +118,7 @@ const TABLE_FIELDS = [ { id: 'name', - label: 'Name', + label: i18n.t('名字'), }, { id: 'desc', From 216637bf320a73d66ce6ad393b36337b42d5015a Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Wed, 9 Oct 2024 11:07:19 +0800 Subject: [PATCH 06/14] =?UTF-8?q?fix:=201.8.0=E9=AA=8C=E6=94=B6=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E5=A4=8D=20--story=3D131115465?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/0007_alter_space_app_code.py | 18 ++++++++++++++++++ bkflow/space/models.py | 2 +- 2 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 bkflow/space/migrations/0007_alter_space_app_code.py diff --git a/bkflow/space/migrations/0007_alter_space_app_code.py b/bkflow/space/migrations/0007_alter_space_app_code.py new file mode 100644 index 0000000..a2f7418 --- /dev/null +++ b/bkflow/space/migrations/0007_alter_space_app_code.py @@ -0,0 +1,18 @@ +# Generated by Django 3.2.15 on 2024-10-09 03:06 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('space', '0006_auto_20240823_1544'), + ] + + operations = [ + migrations.AlterField( + model_name='space', + name='app_code', + field=models.CharField(max_length=32, verbose_name='应用ID'), + ), + ] diff --git a/bkflow/space/models.py b/bkflow/space/models.py index 5da8d5f..a03d95e 100644 --- a/bkflow/space/models.py +++ b/bkflow/space/models.py @@ -58,7 +58,7 @@ class Space(CommonModel): id = models.AutoField(_("空间ID"), primary_key=True) # 空间名不允许重复 name = models.CharField(_("空间名称"), max_length=32, null=False, blank=False, unique=True) - app_code = models.CharField(_("APP Code"), max_length=32, null=False, blank=False) + app_code = models.CharField(_("应用ID"), max_length=32, null=False, blank=False) desc = models.CharField(_("空间描述"), max_length=128, null=True, blank=True) platform_url = models.CharField(_("平台提供服务的地址"), max_length=256, null=False, blank=False) create_type = models.CharField( From 72b237038098c66a09b491b152d5097a5d1445c7 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Wed, 9 Oct 2024 12:58:32 +0800 Subject: [PATCH 07/14] feat: release 1.8.1 #31 --- app_desc.yaml | 2 +- scripts/start_new_version.sh | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app_desc.yaml b/app_desc.yaml index fcc4a66..9d1e2a3 100644 --- a/app_desc.yaml +++ b/app_desc.yaml @@ -1,5 +1,5 @@ spec_version: 2 -app_version: "1.8.0" +app_version: "1.8.1" app: region: default bk_app_code: &APP_CODE bk_flow_engine diff --git a/scripts/start_new_version.sh b/scripts/start_new_version.sh index bb63906..49d5f1b 100644 --- a/scripts/start_new_version.sh +++ b/scripts/start_new_version.sh @@ -4,17 +4,15 @@ RELEASE_VERSION=$1 C_OS="$(uname)" MAC_OS="Darwin" -ver=$(grep 'app_version:' app_desc_ce.yaml | cut -c 14-) +ver=$(grep 'app_version:' app_desc.yaml | cut -c 14-) echo "current version: ${ver}" # version num replace if [ "$C_OS" == "$MAC_OS" ];then echo "app_version: \"${ver}\"" - sed -i.bak "s/app_version: ${ver}/app_version: \"${RELEASE_VERSION}\"/" app_desc_ce.yaml - sed -i.bak "s/app_version: ${ver}/app_version: \"${RELEASE_VERSION}\"/" app_desc_sg.yaml - rm app_desc_ce.yaml.bak app_desc_sg.yaml.bak + sed -i.bak "s/app_version: ${ver}/app_version: \"${RELEASE_VERSION}\"/" app_desc.yaml + rm app_desc.yaml.bak else - sed -i "s/app_version: ${ver}/app_version: \"${RELEASE_VERSION}\"/" app_desc_ce.yaml - sed -i "s/app_version: ${ver}/app_version: \"${RELEASE_VERSION}\"/" app_desc_sg.yaml + sed -i "s/app_version: ${ver}/app_version: \"${RELEASE_VERSION}\"/" app_desc.yaml fi From 7ffd21a2cff15094455dcf8b99def04f33e61a0a Mon Sep 17 00:00:00 2001 From: v_xugzhou <941071842@qq.com> Date: Wed, 9 Oct 2024 17:21:44 +0800 Subject: [PATCH 08/14] =?UTF-8?q?fix:=20=E6=97=A5=E6=9C=9F=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E8=8C=83=E5=9B=B4=E5=8F=98=E9=87=8F=E5=80=BC=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=20#33=20#=20Reviewed,=20transaction=20id:=2020048?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/utils/checkDataType.js | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/utils/checkDataType.js b/frontend/src/utils/checkDataType.js index 6198a85..3d0fc1e 100644 --- a/frontend/src/utils/checkDataType.js +++ b/frontend/src/utils/checkDataType.js @@ -35,6 +35,7 @@ export const getDefaultValueFormat = (scheme) => { case 'tree': case 'upload': case 'cascader': + case 'datetime_range': valueFormat = { type: 'Array', value: [], From 10f74650d8ebe0f4775756accb28510e317815f6 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Mon, 14 Oct 2024 13:18:54 +0800 Subject: [PATCH 09/14] =?UTF-8?q?feat:=20=E6=96=87=E6=A1=A3=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E8=B7=B3=E8=BD=AC=E6=94=AF=E6=8C=81=E4=B8=AD=E8=8B=B1?= =?UTF-8?q?=E6=96=87=20--story=3D132104161?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bkflow/interface/context_processors.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bkflow/interface/context_processors.py b/bkflow/interface/context_processors.py index 9eedfc1..2b66dff 100644 --- a/bkflow/interface/context_processors.py +++ b/bkflow/interface/context_processors.py @@ -27,6 +27,7 @@ def bkflow_settings(request): frontend_entry_url = "{}bkflow".format(settings.STATIC_URL) if settings.RUN_VER == "open" else "/static/bkflow" enable_notice_center = int(EnvironmentVariables.objects.get_var("ENABLE_NOTICE_CENTER", 0)) language = request.COOKIES.get("blueking_language", "zh-cn") + doc_lang_mappings = {"zh-cn": "ZH", "en": "EN"} run_ver_key = "BKAPP_RUN_VER_NAME" if language == "zh-cn" else "BKAPP_RUN_VER_NAME_{}".format(language.upper()) ctx = { @@ -36,7 +37,8 @@ def bkflow_settings(request): "MEMBER_SELECTOR_DATA_HOST": settings.MEMBER_SELECTOR_DATA_HOST, "APP_CODE": settings.APP_CODE, "USERNAME": request.user.username, - "BK_DOC_URL": f"{env.BK_DOC_CENTER_HOST}/markdown/ZH/BKFlow/1.8/UserGuide/Introduce/introduce.md", + "BK_DOC_URL": f"{env.BK_DOC_CENTER_HOST}/markdown/{doc_lang_mappings.get(language, 'ZH')}/BKFlow/1.8" + f"/UserGuide/Introduce/introduce.md", # 是否开启通知中心 "ENABLE_NOTICE_CENTER": enable_notice_center, "BK_PAAS_SHARED_RES_URL": env.BKPAAS_SHARED_RES_URL, From 050f0444ffd13a93b098852586b58c4cf50fdccd Mon Sep 17 00:00:00 2001 From: v_xugzhou <941071842@qq.com> Date: Mon, 14 Oct 2024 15:49:30 +0800 Subject: [PATCH 10/14] =?UTF-8?q?chore:=20=E5=87=BA=E7=8E=B0=E5=85=A8?= =?UTF-8?q?=E5=B1=80=E5=85=AC=E5=91=8A=E6=97=B6=E4=BC=9A=E9=A2=9D=E5=A4=96?= =?UTF-8?q?=E5=87=BA=E4=B8=80=E4=B8=AA=E6=BB=9A=E5=8A=A8=E6=9D=A1=E9=97=AE?= =?UTF-8?q?=E9=A2=98=E4=BC=98=E5=8C=96=20--story=3D131115507=20#=20Reviewe?= =?UTF-8?q?d,=20transaction=20id:=2020554?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/App.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 37cbf87..45924c7 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -192,6 +192,7 @@ body { } .with-system-notice { height: calc(100vh - 40px) !important; + .navigation-nav, .container-content { max-height: calc(100vh - 92px)!important; } From 62db74bf165cdfa3611b924b7edfdcf193ff5ffc Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Mon, 21 Oct 2024 15:45:32 +0800 Subject: [PATCH 11/14] =?UTF-8?q?fix:=20=E5=A4=84=E7=90=86=20fast=5Fcreate?= =?UTF-8?q?=5Ftask=20=E9=80=9A=E7=9F=A5=E4=BA=BA=E8=A6=86=E7=9B=96?= =?UTF-8?q?=E9=97=AE=E9=A2=98=20#39?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bkflow/apigw/serializers/task.py | 1 + bkflow/apigw/views/create_task_without_template.py | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/bkflow/apigw/serializers/task.py b/bkflow/apigw/serializers/task.py index 6201330..fd88c3d 100644 --- a/bkflow/apigw/serializers/task.py +++ b/bkflow/apigw/serializers/task.py @@ -85,6 +85,7 @@ class CreateTaskWithoutTemplateSerializer(serializers.Serializer): description = serializers.CharField(help_text=_("任务描述"), required=False) constants = serializers.JSONField(help_text=_("任务启动参数"), required=False, default={}) pipeline_tree = serializers.JSONField(help_text=_("任务树"), required=True) + notify_config = serializers.JSONField(help_text=_("通知配置"), required=False, default={}) class PipelineTreeSerializer(serializers.Serializer): diff --git a/bkflow/apigw/views/create_task_without_template.py b/bkflow/apigw/views/create_task_without_template.py index bc70792..bff72fe 100644 --- a/bkflow/apigw/views/create_task_without_template.py +++ b/bkflow/apigw/views/create_task_without_template.py @@ -46,7 +46,8 @@ def create_task_without_template(request, space_id): "notify_type": {"fail": [], "success": []}, "notify_receivers": {"more_receiver": "", "receiver_group": []}, } - create_task_data.setdefault("extra_info", {}).update({"notify_config": DEFAULT_NOTIFY_CONFIG}) + notify_config = create_task_data.pop("notify_config", {}) or DEFAULT_NOTIFY_CONFIG + create_task_data.setdefault("extra_info", {}).update({"notify_config": notify_config}) client = TaskComponentClient(space_id=space_id) result = client.create_task(create_task_data) From 8dc37094439af6e96c11d338a45ee7ffd94bfd31 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Mon, 21 Oct 2024 15:48:15 +0800 Subject: [PATCH 12/14] =?UTF-8?q?feat:=20=E6=8E=A5=E5=8F=A3=20get=5Ftask?= =?UTF-8?q?=5Flist=20=E6=94=AF=E6=8C=81=E7=8A=B6=E6=80=81=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=20#41?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bkflow/apigw/views/get_task_list.py | 2 ++ bkflow/task/views.py | 2 ++ 2 files changed, 4 insertions(+) diff --git a/bkflow/apigw/views/get_task_list.py b/bkflow/apigw/views/get_task_list.py index 3e9d872..0316e44 100644 --- a/bkflow/apigw/views/get_task_list.py +++ b/bkflow/apigw/views/get_task_list.py @@ -44,6 +44,8 @@ def get_task_list(request, space_id): "create_at_start": "create_time__gte", "create_at_end": "create_time__lte", "name": "name__icontains", + "is_started": "is_started", + "is_finished": "is_finished", } for k, v in filter_map.items(): if k in data: diff --git a/bkflow/task/views.py b/bkflow/task/views.py index 8fc07e9..3ecbf0c 100644 --- a/bkflow/task/views.py +++ b/bkflow/task/views.py @@ -73,6 +73,8 @@ class Meta: "start_time": ["gte", "lte"], "finish_time": ["gte", "lte"], "create_method": ["exact"], + "is_started": ["exact"], + "is_finished": ["exact"], } From 07ec2692e950a8778adb8b5ad97efab23cbcfb79 Mon Sep 17 00:00:00 2001 From: waylon <1158341873@qq.com> Date: Thu, 24 Oct 2024 11:48:52 +0800 Subject: [PATCH 13/14] =?UTF-8?q?feat:=20create=5Fspace=20api=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=20APP=20=E7=99=BD=E5=90=8D=E5=8D=95=20#44?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bkflow/apigw/views/create_space.py | 3 ++- config/default.py | 2 ++ env.py | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/bkflow/apigw/views/create_space.py b/bkflow/apigw/views/create_space.py index 6f85605..467426d 100644 --- a/bkflow/apigw/views/create_space.py +++ b/bkflow/apigw/views/create_space.py @@ -21,6 +21,7 @@ from apigw_manager.apigw.decorators import apigw_require from blueapps.account.decorators import login_exempt +from django.conf import settings from django.db import transaction from django.views.decorators.csrf import csrf_exempt from django.views.decorators.http import require_POST @@ -46,7 +47,7 @@ def create_space(request): } """ data = json.loads(request.body) - if hasattr(request, "app"): + if hasattr(request, "app") and request.app.bk_app_code not in settings.APP_WHITE_LIST: data["app_code"] = request.app.bk_app_code ser = CreateSpaceSerializer(data=data) diff --git a/config/default.py b/config/default.py index 094d687..6788a60 100644 --- a/config/default.py +++ b/config/default.py @@ -85,6 +85,8 @@ APP_INTERNAL_FROM_SUPERUSER_HEADER_KEY = "Bkflow-Internal-From-SuperUser" APP_INTERNAL_TOKEN_REQUEST_META_KEY = "HTTP_BKFLOW_INTERNAL_TOKEN" +APP_WHITE_LIST = env.APP_WHITE_LIST_STR.split(",") if env.APP_WHITE_LIST_STR else [] + # PAAS SERVICE DETECTION BKPAAS_SERVICE_ADDRESSES_BKSAAS = os.getenv("BKPAAS_SERVICE_ADDRESSES_BKSAAS") BKSAAS_DEFAULT_MODULE_NAME = "default" diff --git a/env.py b/env.py index eac6a7e..11f0d90 100644 --- a/env.py +++ b/env.py @@ -131,3 +131,6 @@ # 文档中心链接 BK_DOC_CENTER_HOST = os.getenv("BK_DOC_CENTER_HOST", os.getenv("BK_DOCS_URL_PREFIX", "")).rstrip("/") + +# APP 白名单 +APP_WHITE_LIST_STR = os.getenv("BKAPP_APP_WHITE_LIST", "") # 逗号分隔的字符串 From a0c6285209054ae1b649e7f4ea60f412bccd0f14 Mon Sep 17 00:00:00 2001 From: guohelu <19503896967@163.com> Date: Mon, 28 Oct 2024 11:04:10 +0800 Subject: [PATCH 14/14] =?UTF-8?q?feat:=20http=20=E6=8F=92=E4=BB=B6?= =?UTF-8?q?=E6=94=AF=E6=8C=81=20json=20=E8=BD=AC=E4=B9=89=20#40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bkflow/pipeline_plugins/components/collections/http/v1_0.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bkflow/pipeline_plugins/components/collections/http/v1_0.py b/bkflow/pipeline_plugins/components/collections/http/v1_0.py index be15c56..c36aa98 100644 --- a/bkflow/pipeline_plugins/components/collections/http/v1_0.py +++ b/bkflow/pipeline_plugins/components/collections/http/v1_0.py @@ -21,6 +21,7 @@ from __future__ import absolute_import +import json import traceback from copy import deepcopy @@ -133,6 +134,8 @@ def plugin_schedule(self, data, parent_data, callback_data=None): other = {"headers": {}, "timeout": timeout} if method.upper() not in ["GET", "HEAD"]: + if not isinstance(body, str): + body = json.dumps(body) other["data"] = body.encode("utf-8") other["headers"] = {"Content-type": "application/json"}