From 3d1c1ca303eb2fe7a89b5a7024ea721686432eaf Mon Sep 17 00:00:00 2001
From: leafage-collb <3303710797@qq.com>
Date: Thu, 23 May 2024 11:26:20 +0800
Subject: [PATCH 1/8] =?UTF-8?q?fix:=20=E5=A2=9E=E5=BC=BA=E6=9C=8D=E5=8A=A1?=
=?UTF-8?q?=E5=90=AF=E5=8A=A8tooltip=E6=A0=B7=E5=BC=8F=E9=94=99=E4=B9=B1?=
=?UTF-8?q?=E4=BF=AE=E5=A4=8D=20#=20Reviewed,=20transaction=20id:=208561?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/engine/cloud-deployment/app-services.vue | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue
index 07f8924392..940baf55fd 100644
--- a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue
+++ b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue
@@ -796,7 +796,6 @@ export default {
}
}
#switcher-tooltip{
- padding: 4px 0px;
border: 1px solid #DCDEE5;
border-radius: 2px;
.item{
@@ -809,6 +808,12 @@ export default {
&:hover {
background: #F5F7FA;
}
+ &:first-child {
+ margin-top: 4px;
+ }
+ &:last-child {
+ margin-bottom: 4px;
+ }
}
}
From e36cec79b366c5d9539b74b65a991669cbdc30e6 Mon Sep 17 00:00:00 2001
From: leafage-collb <3303710797@qq.com>
Date: Thu, 23 May 2024 16:33:23 +0800
Subject: [PATCH 2/8] =?UTF-8?q?feat:=20=E7=8E=AF=E5=A2=83=E5=8F=98?=
=?UTF-8?q?=E9=87=8F=E5=86=B2=E7=AA=81=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
webfe/package_vue/src/language/lang/en.js | 1 +
webfe/package_vue/src/language/lang/zh.js | 1 +
webfe/package_vue/src/store/modules/var.js | 61 +++++----
.../engine/cloud-deployment/deploy-env.vue | 123 +++++++++++++-----
4 files changed, 126 insertions(+), 60 deletions(-)
diff --git a/webfe/package_vue/src/language/lang/en.js b/webfe/package_vue/src/language/lang/en.js
index eb73170c77..b8a0b5bb36 100644
--- a/webfe/package_vue/src/language/lang/en.js
+++ b/webfe/package_vue/src/language/lang/en.js
@@ -2595,4 +2595,5 @@ export default {
'增强服务实例已分配,不能再修改配置信息': 'The enhanced service instance has been allocated and configuration information cannot be modified anymore.',
新建测试版本: 'Create Test Version',
提交并开始测试: 'Submit and Start Testing',
+ '环境变量不生效,KEY 与增强服务(Sentry)内置环境变量冲突': 'Environmental variables do not take effect, KEY conflicts with built-in environmental variables of enhanced service (Sentry)',
};
diff --git a/webfe/package_vue/src/language/lang/zh.js b/webfe/package_vue/src/language/lang/zh.js
index 2adeb8eb83..5cafab6306 100644
--- a/webfe/package_vue/src/language/lang/zh.js
+++ b/webfe/package_vue/src/language/lang/zh.js
@@ -2735,4 +2735,5 @@ export default {
'增强服务实例已分配,不能再修改配置信息': '增强服务实例已分配,不能再修改配置信息',
新建测试版本: '新建测试版本',
提交并开始测试: '提交并开始测试',
+ '环境变量不生效,KEY 与增强服务(Sentry)内置环境变量冲突': '环境变量不生效,KEY 与增强服务(Sentry)内置环境变量冲突',
};
diff --git a/webfe/package_vue/src/store/modules/var.js b/webfe/package_vue/src/store/modules/var.js
index c51c42a076..0586e55199 100644
--- a/webfe/package_vue/src/store/modules/var.js
+++ b/webfe/package_vue/src/store/modules/var.js
@@ -28,67 +28,66 @@ export default {
mutations: {},
actions: {
/**
- * 获取所有运行时基础镜像
- */
- getAllImages({ }, { appCode, moduleId }) {
+ * 获取所有运行时基础镜像
+ */
+ getAllImages({}, { appCode, moduleId }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/runtime/list/`;
return http.get(url);
},
/**
- * 获取运行时基础信息
- */
- getRuntimeInfo({ }, { appCode, moduleId }) {
+ * 获取运行时基础信息
+ */
+ getRuntimeInfo({}, { appCode, moduleId }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/runtime/`;
return http.get(url);
},
/**
- * 保存运行时基础信息
- */
- updateRuntimeInfo({ }, { appCode, moduleId, data }) {
+ * 保存运行时基础信息
+ */
+ updateRuntimeInfo({}, { appCode, moduleId, data }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/runtime/`;
return http.post(url, data);
},
/**
- * 从模块导入环境变量
- * @param {Object} params 包括appCode, moduleId, sourceModuleName
- */
- exportModuleEnv({ }, { appCode, moduleId, sourceModuleName }) {
+ * 从模块导入环境变量
+ * @param {Object} params 包括appCode, moduleId, sourceModuleName
+ */
+ exportModuleEnv({}, { appCode, moduleId, sourceModuleName }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/config_vars/clone_from/${sourceModuleName}`;
return http.post(url, {});
},
/**
- * 应用基本信息
- */
- getBasicInfo({ }, { appCode }) {
+ * 应用基本信息
+ */
+ getBasicInfo({}, { appCode }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/config_vars/builtin/app/`;
return http.get(url);
},
/**
- * 应用运行时信息
- */
- getBkPlatformInfo({ }, { appCode }) {
+ * 应用运行时信息
+ */
+ getBkPlatformInfo({}, { appCode }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/config_vars/builtin/bk_platform/`;
return http.get(url);
},
/**
- * 蓝鲸体系内平台信息
- */
- getAppRuntimeInfo({ }, { appCode }) {
+ * 蓝鲸体系内平台信息
+ */
+ getAppRuntimeInfo({}, { appCode }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/config_vars/builtin/runtime/`;
return http.get(url);
},
-
/**
* 保存环境变量数据
*/
- saveEnvItem({ }, { appCode, moduleId, data }) {
+ saveEnvItem({}, { appCode, moduleId, data }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/config_vars/batch/`;
return http.post(url, data);
},
@@ -96,7 +95,7 @@ export default {
/**
* 新增单个环境变量
*/
- createdEnvVariable({ }, { appCode, moduleId, data }) {
+ createdEnvVariable({}, { appCode, moduleId, data }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/config_vars/`;
return http.post(url, data);
},
@@ -104,7 +103,7 @@ export default {
/**
* 修改单个环境变量
*/
- updateEnvVariable({ }, { appCode, moduleId, varId, data }) {
+ updateEnvVariable({}, { appCode, moduleId, varId, data }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/config_vars/${varId}/`;
return http.put(url, data);
},
@@ -112,9 +111,17 @@ export default {
/**
* 删除单个环境变量
*/
- deleteEnvVariable({ }, { appCode, moduleId, varId }) {
+ deleteEnvVariable({}, { appCode, moduleId, varId }) {
const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/config_vars/${varId}/`;
return http.delete(url, {});
},
+
+ /**
+ * 获取增强服务内置环境变量
+ */
+ getConfigVarKeys({}, { appCode, moduleId }) {
+ const url = `${BACKEND_URL}/api/bkapps/applications/${appCode}/modules/${moduleId}/services/config_var_keys/`;
+ return http.get(url, {});
+ },
},
};
diff --git a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/deploy-env.vue b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/deploy-env.vue
index 9bb9da2ca1..a5f51cbb01 100644
--- a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/deploy-env.vue
+++ b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/deploy-env.vue
@@ -117,32 +117,41 @@
prop="key"
>
-
-
+
-
-
-
-
+
+
+
+
+
+
+ {{ row.key }}
+
+
+
- {{ row.key }}
@@ -648,6 +657,7 @@ export default {
envEnums: ENV_ENUM,
isBatchEdit: false,
activeEnvValue: 'all',
+ builtInEnvVars: {},
};
},
computed: {
@@ -671,20 +681,42 @@ export default {
this.init();
},
methods: {
- init() {
+ async init() {
this.isLoading = true;
+ await this.getConfigVarKeys();
this.getEnvVarList();
},
- getEnvVarList() {
+ // 是否已存在该环境变量
+ isEnvVarAlreadyExists(varKey) {
+ let flag = false;
+ // 检查是否已存在该环境变量
+ for (const key in this.builtInEnvVars) {
+ if (this.builtInEnvVars[key].includes(varKey)) {
+ flag = true;
+ break;
+ }
+ }
+ return flag;
+ },
+ getEnvVarList(isUpdate = true) {
this.isTableLoading = true;
this.$http.get(`${BACKEND_URL}/api/bkapps/applications/${this.appCode}/modules/${this.curModuleId}/config_vars/?order_by=${this.curSortKey}`).then((response) => {
- this.envVarList = [...response];
+ if (isUpdate) this.envVarList = [...response];
// 添加自定义属性
this.envVarList.forEach((v) => {
this.$set(v, 'isEdit', false);
+ this.$set(v, 'isPresent', this.isEnvVarAlreadyExists(v.key));
+ if (!v.id) {
+ const id = response.find(item => item.key === v.key)?.id;
+ this.$set(v, 'id', id);
+ }
});
this.envLocalVarList = cloneDeep(this.envVarList);
- this.handleFilterEnv(this.activeEnvValue);
+ if (isUpdate) {
+ this.handleFilterEnv(this.activeEnvValue);
+ } else {
+ this.$store.commit('cloudApi/updatePageEdit', false);
+ }
}, (errRes) => {
const errorMsg = errRes.message;
this.$paasMessage({
@@ -772,6 +804,7 @@ export default {
// 删除冗余数据
delete data.isEdit;
delete data.isAdd;
+ delete data.isPresent;
try {
await this.$store.dispatch('envVar/createdEnvVariable', {
appCode: this.appCode,
@@ -798,6 +831,7 @@ export default {
async updateEnvVariable(data, i) {
// 删除冗余数据
delete data.isEdit;
+ delete data.isPresent;
try {
await this.$store.dispatch('envVar/updateEnvVariable', {
appCode: this.appCode,
@@ -829,6 +863,7 @@ export default {
params.forEach((v) => {
delete v.is_global;
delete v.isEdit;
+ delete v.isPresent;
});
await this.$store.dispatch('envVar/saveEnvItem', { appCode: this.appCode, moduleId: this.curModuleId, data: params });
@@ -841,12 +876,8 @@ export default {
theme: 'success',
message: this.$t(`${tipsType}环境变量成功`),
});
- this.envVarList.forEach((v) => {
- this.$set(v, 'isEdit', false);
- });
- // 更新本地数据
- this.envLocalVarList = cloneDeep(this.envVarList);
- this.$store.commit('cloudApi/updatePageEdit', false);
+ // 批量更新不打乱当前顺序,重新复制当前新建id
+ this.getEnvVarList(false);
} catch (error) {
const errorMsg = error.message;
this.$paasMessage({
@@ -1363,6 +1394,22 @@ export default {
this.getEnvVarList();
}
},
+
+ // 获取增强服务内置环境变量
+ async getConfigVarKeys() {
+ try {
+ const varKeys = await this.$store.dispatch('envVar/getConfigVarKeys', {
+ appCode: this.appCode,
+ moduleId: this.curModuleId,
+ });
+ this.builtInEnvVars = varKeys;
+ } catch (e) {
+ this.$paasMessage({
+ theme: 'error',
+ message: e.detail || e.message || this.$t('接口异常'),
+ });
+ }
+ },
},
};
@@ -1864,6 +1911,16 @@ a.is-disabled {
/deep/ .bk-table-empty-block {
display: none;
}
+ .var-key-wrapper {
+ display: flex;
+ align-items: center;
+ i {
+ margin-left: 5px;
+ font-size: 14px;
+ color: #EA3636;
+ transform: translateY(0);
+ }
+ }
}
.mr6 {
margin-right: 6px;
From b0dee0c1e62c0403bf0fb4b2fdce1198aa964220 Mon Sep 17 00:00:00 2001
From: leafage-collb <3303710797@qq.com>
Date: Fri, 24 May 2024 10:13:29 +0800
Subject: [PATCH 3/8] =?UTF-8?q?fix:=20=E9=83=A8=E7=BD=B2=E7=AE=A1=E7=90=86?=
=?UTF-8?q?=EF=BC=9A=E7=89=88=E6=9C=AC=E5=88=97=E8=A1=A8=E5=BA=94=E8=AF=A5?=
=?UTF-8?q?=E6=8C=89=E6=9B=B4=E6=96=B0=E6=97=B6=E9=97=B4=E5=80=92=E5=BA=8F?=
=?UTF-8?q?=E5=B1=95=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../cloud-deploy-manage/comps/deploy-dialog.vue | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deploy-manage/comps/deploy-dialog.vue b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deploy-manage/comps/deploy-dialog.vue
index caf1722c55..bf77ce19cb 100644
--- a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deploy-manage/comps/deploy-dialog.vue
+++ b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deploy-manage/comps/deploy-dialog.vue
@@ -757,6 +757,10 @@ export default {
this.isLoading = false;
}
},
+ // 排序
+ sortingRules(a, b) {
+ return new Date(b.last_update).getTime() - new Date(a.last_update).getTime();
+ },
async getModuleBranches(favBranchName) {
this.isBranchesLoading = true;
this.branchErrorTips = '';
@@ -771,10 +775,14 @@ export default {
moduleId: this.curModuleId,
});
+ // last_update有值,根据时间排序
+ if (res.results[0]?.last_update) {
+ res.results.sort(this.sortingRules);
+ }
+
// Smart 应用(预发布/生产)显示最新分支
if (this.isSmartApp) {
- const sortList = res.results.sort(this.sortData);
- this.branchValue = `${sortList[0].type}:${sortList[0].name}`;
+ this.branchValue = `${res.results[0]?.type}:${res.results[0]?.name}`;
}
this.branchesData = res.results;
const branchesList = [];
From 2a628aa4ac209ee49440f86cc62b768fde9eb30b Mon Sep 17 00:00:00 2001
From: leafage-collb <3303710797@qq.com>
Date: Fri, 24 May 2024 10:14:13 +0800
Subject: [PATCH 4/8] =?UTF-8?q?update:=20=E6=8F=92=E4=BB=B6=E7=89=88?=
=?UTF-8?q?=E6=9C=AC=E7=AE=A1=E7=90=86=EF=BC=9A=E6=8F=92=E4=BB=B6=E4=B8=8B?=
=?UTF-8?q?=E6=9E=B6=E5=90=8E=E8=AE=BF=E9=97=AE=E5=85=A5=E5=8F=A3=E4=B8=8D?=
=?UTF-8?q?=E5=8F=AF=E7=82=B9=E5=87=BB=20#=20Reviewed,=20transaction=20id:?=
=?UTF-8?q?=208622?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../views/plugin-center/plugin/version-manager/index.vue | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue
index 93f881e538..f917733c3e 100644
--- a/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue
+++ b/webfe/package_vue/src/views/plugin-center/plugin/version-manager/index.vue
@@ -636,6 +636,12 @@ export default {
const res = await this.$store.dispatch('plugin/getPluginAccessEntry', {
pluginId: this.pluginId,
});
+ // 已下架
+ if (res.is_offlined) {
+ this.isAccessDisabled = true;
+ this.accessDisabledTips = this.$t('该插件已下架。如需继续使用,请创建新版本。');
+ return;
+ }
this.pluginDefaultInfo = res;
this.isAccessDisabled = false;
} catch (e) {
From 1f412860380bc40eab125f536a4af03db4669380 Mon Sep 17 00:00:00 2001
From: leafage-collb <3303710797@qq.com>
Date: Fri, 24 May 2024 11:00:23 +0800
Subject: [PATCH 5/8] =?UTF-8?q?fix:=20=E5=90=AF=E7=94=A8tooltips=E6=A0=B7?=
=?UTF-8?q?=E5=BC=8F=E4=BF=AE=E5=A4=8D=20#=20Reviewed,=20transaction=20id:?=
=?UTF-8?q?=208633?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../app/engine/cloud-deployment/app-services.vue | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue
index 940baf55fd..2ae83f7db3 100644
--- a/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue
+++ b/webfe/package_vue/src/views/dev-center/app/engine/cloud-deployment/app-services.vue
@@ -332,7 +332,7 @@ export default {
theme: 'light',
content: '#switcher-tooltip',
placement: 'bottom',
- extCls: 'tips-cls',
+ extCls: 'services-tips-cls',
},
startData: [{ value: 'start', label: this.$t('直接启用') }, { value: 'shared', label: this.$t('从其他模块共享') }],
isShowDialog: false,
@@ -819,11 +819,12 @@ export default {