Skip to content

Commit

Permalink
fix:体验提单修复 (#1353)
Browse files Browse the repository at this point in the history
  • Loading branch information
leafage-collb authored Jun 6, 2024
1 parent f3c476f commit 1f6e1b4
Show file tree
Hide file tree
Showing 8 changed files with 134 additions and 74 deletions.
3 changes: 2 additions & 1 deletion webfe/package_vue/src/language/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ export default {
前端jQuery组件库: 'Front-end jQuery component library',
'提供表单、表格、富文本、按钮等丰富的UI组件,包括PC版、移动版。': 'Provides rich UI components such as forms, tables, rich text, buttons, etc., including PC version and mobile version.',
前端Vue组件库: 'Front-end Vue component library',
'基于Vue 2.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。': 'Based on Vue 2.0, it provides common components such as buttons, drop-down boxes, date pickers, and dialog boxes.',
'基于 Vue2.0、Vue3.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。': 'Provides common components such as buttons, dropdown boxes, date pickers, and dialogs based on Vue 2.0 and Vue 3.0.',
前端套餐样例库: 'Front-end package sample library',
'提供成套的样例页面,即拿即用。': 'A complete set of sample pages is provided, ready to use.',
'蓝鲸前端开发脚手架(BKUI_CLI)': 'BlueKing front-end development scaffolding (BKUI_CLI)',
Expand Down Expand Up @@ -2600,4 +2600,5 @@ export default {
重启次数: 'Restart Count',
测试报告: 'Test report',
终止测试: 'Terminate Test',
授权期限: 'Authorization Period',
};
4 changes: 2 additions & 2 deletions webfe/package_vue/src/language/lang/zh.js
Original file line number Diff line number Diff line change
Expand Up @@ -1692,8 +1692,7 @@ export default {
'提供表单、表格、富文本、按钮等丰富的UI组件,包括PC版、移动版。':
'提供表单、表格、富文本、按钮等丰富的UI组件,包括PC版、移动版。',
前端Vue组件库: '前端Vue组件库',
'基于Vue 2.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。':
'基于Vue 2.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。',
'基于 Vue2.0、Vue3.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。': '基于 Vue2.0、Vue3.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。',
前端套餐样例库: '前端套餐样例库',
'提供成套的样例页面,即拿即用。': '提供成套的样例页面,即拿即用。',
'蓝鲸前端开发脚手架(BKUI_CLI)': '蓝鲸前端开发脚手架(BKUI_CLI)',
Expand Down Expand Up @@ -2740,4 +2739,5 @@ export default {
重启次数: '重启次数',
测试报告: '测试报告',
终止测试: '终止测试',
授权期限: '授权期限',
};
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
style="margin-top: 25px;"
>
<bk-form-item
:label="$t('有效时间')"
:label="$t('授权期限')"
required
property="expired"
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ export default {
if (this.curAppModule?.region !== 'ieod' || this.isCloudNativeApp || !this.isEngineEnabled) {
panels = panels.filter(tab => tab.name !== 'appMobileMarket');
}
// 普通应用不支持
if (!this.isCloudNativeApp) {
// 普通应用不支持 | feature判断
if (!this.isCloudNativeApp || !this.curAppInfo.feature?.ENABLE_PERSISTENT_STORAGE) {
panels = panels.filter(tab => tab.name !== 'storage');
}
return panels;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,15 +331,25 @@
style="flex: 1 1 25%; width: 0;"
>
<template v-if="isReadOnlyRow(index)">
<div
v-bk-tooltips="{
content: varItem.key === '*' ? '*\&nbsp' : varItem.key,
trigger: 'mouseenter',
maxWidth: 400,
extCls: 'env-var-popover'
}"
class="desc-form-content"
>{{ varItem.key }}</div>
<div class="variable-key-wrapper">
<div
v-bk-tooltips="{
content: varItem.key === '*' ? '*\&nbsp' : varItem.key,
trigger: 'mouseenter',
maxWidth: 400,
extCls: 'env-var-popover'
}"
class="desc-form-content"
>{{ varItem.key }}</div>
<i
v-if="varItem.conflictingService"
class="paasng-icon paasng-remind"
v-bk-tooltips="{
content: $t('环境变量不生效,KEY 与{s}增强服务的内置环境变量冲突', { s: varItem.conflictingService }),
width: 200
}">
</i>
</div>
</template>
<template v-else>
<bk-input
Expand Down Expand Up @@ -813,7 +823,7 @@
</div>
</template>

<script>import _ from 'lodash';
<script>import { cloneDeep, includes } from 'lodash';
import dropdown from '@/components/ui/Dropdown';
import tooltipConfirm from '@/components/ui/TooltipConfirm';
import appBaseMixin from '@/mixins/app-base-mixin';
Expand Down Expand Up @@ -943,6 +953,7 @@ export default {
bkPlatformLoading: false,
},
targetListData: [],
builtInEnvVars: {},
};
},
computed: {
Expand Down Expand Up @@ -988,7 +999,7 @@ export default {
return builds;
},
globalEnvName() {
if (_.includes(this.availableEnv, 'stag') && _.includes(this.availableEnv, 'prod')) {
if (includes(this.availableEnv, 'stag') && includes(this.availableEnv, 'prod')) {
return '_global_';
}
return this.availableEnv[0];
Expand Down Expand Up @@ -1257,10 +1268,11 @@ export default {
this.curFile = {};
this.isFileTypeError = false;
},
init() {
async init() {
this.isLoading = true;
this.isEdited = false;
this.curSortKey = '-created';
await this.getConfigVarKeys();
this.loadConfigVar();
this.fetchReleaseInfo();
this.getAllImages();
Expand Down Expand Up @@ -1317,8 +1329,8 @@ export default {
this.runtimeImage = res.image ? res.image : '';
if (res.buildpacks) {
this.runtimeBuild = res.buildpacks.map(item => item.id);
this.targetListData = _.cloneDeep(this.runtimeBuild);
this.curBuildpacks = _.cloneDeep(this.runtimeBuild);
this.targetListData = cloneDeep(this.runtimeBuild);
this.curBuildpacks = cloneDeep(this.runtimeBuild);
}
} catch (e) {
this.$paasMessage({
Expand Down Expand Up @@ -1373,6 +1385,18 @@ export default {
});
}
},
// 是否已存在该环境变量
isEnvVarAlreadyExists(varKey) {
let existingKey = '';
// 检查是否已存在该环境变量
for (const key in this.builtInEnvVars) {
if (this.builtInEnvVars[key].includes(varKey)) {
existingKey = key;
break;
}
}
return existingKey;
},
// Load all env vars for current selected tab
loadConfigVar() {
this.isVarLoading = true;
Expand All @@ -1382,7 +1406,10 @@ export default {
} else {
this.envVarList = response.filter(envVar => envVar.environment_name === this.activeEnvTab);
}
this.envVarListBackup = JSON.parse(JSON.stringify(this.envVarList));
this.envVarList.forEach((item) => {
item.conflictingService = this.isEnvVarAlreadyExists(item.key);
});
this.envVarListBackup = cloneDeep(this.envVarList);
}, (errRes) => {
const errorMsg = errRes.message;
this.$paasMessage({
Expand All @@ -1396,10 +1423,10 @@ export default {
});
},
isReadOnlyRow(rowIndex) {
return !_.includes(this.editRowList, rowIndex);
return !includes(this.editRowList, rowIndex);
},
isEnvAvailable(envName) {
return _.includes(this.availableEnv, envName);
return includes(this.availableEnv, envName);
},
editingRowToggle(rowItem = {}, rowIndex, type = '') {
if (type === 'cancel') {
Expand All @@ -1415,7 +1442,7 @@ export default {
});
}
}
if (_.includes(this.editRowList, rowIndex)) {
if (includes(this.editRowList, rowIndex)) {
this.editRowList.pop(rowIndex);
} else {
this.editRowList.push(rowIndex);
Expand Down Expand Up @@ -1566,7 +1593,7 @@ export default {
// 数据还原
handleHideRuntimeDialog() {
setTimeout(() => {
this.targetListData = _.cloneDeep(this.curBuildpacks);
this.targetListData = cloneDeep(this.curBuildpacks);
}, 200);
},
Expand Down Expand Up @@ -1668,6 +1695,22 @@ export default {
}
});
},
// 获取应用增强服务内置环境变量
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('接口异常'),
});
}
},
},
};
</script>
Expand Down Expand Up @@ -1774,6 +1817,7 @@ export default {
.desc-form-content {
display: inline-block;
padding: 0 10px;
padding-right: 25px;
width: 100%;
height: 32px;
border: 1px solid #dcdee5;
Expand Down Expand Up @@ -2103,6 +2147,17 @@ export default {
}
}
}
.variable-key-wrapper {
position: relative;
.paasng-remind {
position: absolute;
right: 10px;
top: 50%;
transform: translateY(-50%);
font-size: 14px;
color: #EA3636;
}
}
</style>

<style lang="scss">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,9 @@
</td>
<template v-for="field of fieldSelectedList">
<td :key="field" class="field">
<div>{{log.detail[field] || '--' }}</div>
<!-- eslint-disable-next-line vue/no-v-html -->
<div v-if="log.detail[field]" v-html="log.detail[field]"></div>
<span v-else>--</span>
</td>
</template>
</tr>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@
v-for="(value, key) in row.service_instance.credentials"
:key="key"
class="config-width"
v-bk-overflow-tips
>
<span class="gray">{{ key }}: </span><span class="break-all">{{ value }}</span><br>
</div>
Expand All @@ -122,6 +123,7 @@
<div
v-for="(value, key) in row.service_instance.hidden_fields"
:key="key"
v-bk-overflow-tips
>
<span class="gray">{{ key }}: </span>
<span
Expand Down Expand Up @@ -1209,6 +1211,8 @@ export default {
width: 85%;
display: inline-block;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
}
.ps-table-slide-up .paas-loading-panel .table-empty-cls .empty-tips {
color: #999;
Expand All @@ -1223,13 +1227,11 @@ export default {
}
.instance-details-table-cls {
.bk-table-body .cell {
display: inline-table;
}
.bk-table-row.bk-table-row-last td {
border-bottom: none;
}
.credential-information {
overflow: hidden;
}
.gray {
color: #c4c6cc;
Expand Down
90 changes: 45 additions & 45 deletions webfe/package_vue/src/views/services/static/magic-box.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,52 +3,52 @@
</template>

<script>
import serviceGeneral from '@/components/serviceGeneral';
export default {
components: {
serviceGeneral
},
data () {
return {
apiData: {
name: 'MagicBox',
apititle: 'MagicBox',
hasLink: true,
link: this.GLOBAL.LINK.MAGICBOX_INDEX,
image: '/static/images/service-pic8.png',
apiexplain: this.$t('蓝鲸MagicBox提供丰富的PC端、移动端前端UI组件,更有样例套餐助您快速搭建前端页面。同时蓝鲸MagicBox提供可视化开发服务,支持在线拖拽页面,所见即所得。'),
apiList: [
{
'title': this.$t('运维开发平台'),
'explain': this.$t('支持在线拖拽,使用MagicBox提供的组件,自由布局页面。'),
'url': this.GLOBAL.LINK.LESSCODE_INDEX
},
{
'title': this.$t('前端jQuery组件库'),
'explain': this.$t('提供表单、表格、富文本、按钮等丰富的UI组件,包括PC版、移动版。'),
'url': this.GLOBAL.LINK.MAGICBOX_JQUERY
},
{
'title': this.$t('前端Vue组件库'),
'explain': this.$t('基于Vue 2.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。'),
'url': this.GLOBAL.LINK.MAGICBOX_VUE
},
{
'title': this.$t('前端套餐样例库'),
'explain': this.$t('提供成套的样例页面,即拿即用。'),
'url': this.GLOBAL.LINK.MAGICBOX_TPL
},
{
'title': this.$t('蓝鲸前端开发脚手架(BKUI_CLI)'),
'explain': this.$t('基于 Vue.js 研发的一键构建蓝鲸体系前端工程的脚手架工具,包括了基础工程化能力、基础 mock 服务、蓝鲸前端Vue组件库等。'),
'url': this.GLOBAL.LINK.MAGICBOX_BKUI_CLI,
'isDoc': true
}
]
}
};
}
import serviceGeneral from '@/components/serviceGeneral';
export default {
components: {
serviceGeneral,
},
data() {
return {
apiData: {
name: 'MagicBox',
apititle: 'MagicBox',
hasLink: true,
link: this.GLOBAL.LINK.MAGICBOX_INDEX,
image: '/static/images/service-pic8.png',
apiexplain: this.$t('蓝鲸MagicBox提供丰富的PC端、移动端前端UI组件,更有样例套餐助您快速搭建前端页面。同时蓝鲸MagicBox提供可视化开发服务,支持在线拖拽页面,所见即所得。'),
apiList: [
{
title: this.$t('运维开发平台'),
explain: this.$t('支持在线拖拽,使用MagicBox提供的组件,自由布局页面。'),
url: this.GLOBAL.LINK.LESSCODE_INDEX,
},
{
title: this.$t('前端jQuery组件库'),
explain: this.$t('提供表单、表格、富文本、按钮等丰富的UI组件,包括PC版、移动版。'),
url: this.GLOBAL.LINK.MAGICBOX_JQUERY,
},
{
title: this.$t('前端Vue组件库'),
explain: this.$t('基于 Vue2.0、Vue3.0,提供按钮、下拉选框、日期选择器、对话框等常用组件。'),
url: this.GLOBAL.LINK.MAGICBOX_VUE,
},
{
title: this.$t('前端套餐样例库'),
explain: this.$t('提供成套的样例页面,即拿即用。'),
url: this.GLOBAL.LINK.MAGICBOX_TPL,
},
{
title: this.$t('蓝鲸前端开发脚手架(BKUI_CLI)'),
explain: this.$t('基于 Vue.js 研发的一键构建蓝鲸体系前端工程的脚手架工具,包括了基础工程化能力、基础 mock 服务、蓝鲸前端Vue组件库等。'),
url: this.GLOBAL.LINK.MAGICBOX_BKUI_CLI,
isDoc: true,
},
],
},
};
},
};
</script>

<style lang="css" scoped>
Expand Down

0 comments on commit 1f6e1b4

Please sign in to comment.