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

feat: 1.14开发 #61

Merged
merged 1 commit into from
Jul 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/dashboard-front/src/language/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1373,6 +1373,12 @@ const lang: ILANG = {
'编辑后端服务': ['Edit back-end services'],
'去查看发布记录': ['Go to the release record'],
'后端服务内容保存成功,正在发布到对应的环境': ['The back-end service content is saved successfully and is being published to the corresponding environment'],
'当前服务 {name},已绑定以下 {num} 个环境,所有修改都将发布到这些环境中:': ['The current service, {name}, is bound to the following {num} environments to which all changes will be published:'],
'当前服务': ['The current service'],
',': [','],
'已绑定以下': ['is bound to the following'],
'个环境,所有修改都将发布到这些环境中:': ['environments to which all changes will be published:'],
'内容保存成功,正在发布至对应环境...': ['The content is saved successfully and is being published to the corresponding environment...'],
'当前后端服务({name})已绑定以下 {num} 个环境,所有修改都将发布到这些环境中:{names}': ['The current backend service ({name}) has bound the following {num} environments to which all changes will be published: {names}'],
'网关环境【prod】中的配置【后端服务地址】不合法。请在网关 `后端服务` 中进行配置。': ['The back-end service address configured in gateway environment prod is invalid. Please configure in Gateway back-end services.'],
'最大 300s': ['Maximum 300s'],
Expand Down
118 changes: 104 additions & 14 deletions src/dashboard-front/src/views/backend-service/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,37 @@
</div>
</template>
</bk-sideslider>

<!-- 提示弹窗 -->
<bk-dialog
v-model:is-show="publishDialog.isShow"
class="custom-main-dialog"
width="500"
>
<div class="dialog-content">
<div class="publish-icon">
<success fill="#3FC06D" />
</div>
<div class="dialog-title">
{{ t('内容保存成功,正在发布至对应环境...') }}
</div>
<div class="dialog-main">
<div class="publish-tips">
{{ t('当前服务') }} <span>{{ baseInfo.name }}</span>{{ t(',') }}
{{ t('已绑定以下') }} <span>{{ publishDialog.stageNames?.length }}</span> {{ t('个环境,所有修改都将发布到这些环境中:') }}
</div>
<div class="publish-stages">
<div class="stage-item" v-for="stage in publishDialog.stageNames" :key="stage">
{{ stage }}
</div>
</div>
</div>
<div class="dialog-footer">
<bk-button theme="primary" @click="toPublishLogs">{{ t('去查看发布记录') }}</bk-button>
<bk-button class="ml10" @click="publishDialog.isShow = false">{{ t('关闭') }}</bk-button>
</div>
</div>
</bk-dialog>
</div>
</template>

Expand All @@ -179,7 +210,7 @@ import {
getBackendServiceDetail,
} from '@/http';
import { useRouter } from 'vue-router';
import { AngleUpFill } from 'bkui-vue/lib/icon';
import { AngleUpFill, Success } from 'bkui-vue/lib/icon';

const props = defineProps({
editId: {
Expand Down Expand Up @@ -215,6 +246,10 @@ const isPublish = ref<boolean>(false);
const isSaveLoading = ref<boolean>(false);
const baseInfoRef = ref<any>(null);
const finaConfigs = ref<any>([]);
const publishDialog = reactive<any>({
isShow: false,
stageNames: [],
});
// scheme 类型
const schemeList = [{ value: 'http' }, { value: 'https' }];
const sidesliderConfi = reactive({
Expand Down Expand Up @@ -390,19 +425,8 @@ const handleConfirm = async () => {
});

if (stageNames?.length) {
InfoBox({
title: t('后端服务内容保存成功,正在发布到对应的环境'),
infoType: 'success',
width: 482,
subTitle: t('当前后端服务({name})已绑定以下 {num} 个环境,所有修改都将发布到这些环境中:{names}', { name: baseInfo.value.name, num: stageNames?.length, names: stageNames?.join(',') }),
confirmText: t('去查看发布记录'),
cancelText: t('关闭'),
onConfirm: () => {
router.push({
name: 'apigwReleaseHistory',
});
},
});
publishDialog.isShow = true;
publishDialog.stageNames = stageNames;
} else {
InfoBox({
title: t('后端服务内容保存成功'),
Expand All @@ -429,6 +453,12 @@ const handleConfirm = async () => {
}
};

const toPublishLogs = () => {
router.push({
name: 'apigwReleaseHistory',
});
};

const setInit = () => {
stageConfig.value = stageList.value.map((item: any) => {
const { name, id, description } = item;
Expand Down Expand Up @@ -708,4 +738,64 @@ defineExpose({
}
}
}
.custom-main-dialog {
:deep(.bk-dialog-title) {
display: none;
}
:deep(.bk-modal-footer) {
display: none;
}
.dialog-content {
.publish-icon {
text-align: center;
margin-bottom: 18px;
font-size: 42px;
line-height: 32px;
}
.dialog-title {
font-size: 20px;
color: #313238;
text-align: center;
margin-bottom: 16px;
}
.dialog-main {
background: #F5F6FA;
border-radius: 2px;
margin-bottom: 25px;
padding: 12px 16px 18px;
.publish-tips {
font-size: 14px;
color: #63656E;
margin-bottom: 10px;
span {
font-weight: 700;
}
}
.publish-stages {
display: flex;
flex-wrap: wrap;
.stage-item {
font-size: 14px;
color: #63656E;
position: relative;
padding-left: 12px;
width: 33%;
&::after {
content: ' ';
position: absolute;
width: 4px;
height: 4px;
border-radius: 50%;
background: #63656E;
top: 10px;
left: 0;
}
}
}
}
.dialog-footer {
text-align: center;
}
}
}
</style>
14 changes: 1 addition & 13 deletions src/dashboard-front/src/views/operate-data/access-log/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@
v-model:modeValue="keyword"
@search="handleSearch"
@choose="handleChoose"
:class="[
'top-search-input',
localLanguage === 'en' ? 'top-search-input-en' : '',
]"
class="top-search-input"
/>
</bk-form-item>
<bk-form-item label="" style="margin-left: 0">
Expand Down Expand Up @@ -282,7 +279,7 @@
return chartData.value?.series?.length > 0;
});

const localLanguage = computed(() => {

Check failure on line 282 in src/dashboard-front/src/views/operate-data/access-log/index.vue

View workflow job for this annotation

GitHub Actions / build (ubuntu-latest, 16.x)

'localLanguage' is assigned a value but never used. Allowed unused vars must match /^_.+/u
return 'zh-cn';
});

Expand Down Expand Up @@ -943,20 +940,11 @@

@media (max-width: 1753px) {
:deep(.search-form) {
width: 700px !important;

.ag-form-item-inline {
margin-left: 0px !important;
margin-top: 10px !important;
}

.top-search-input {
width: 526px;
}

.top-search-input-en {
width: 460px;
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,16 @@
prop="path"
sort
></bk-table-column>
<bk-table-column prop="gateway_label_ids" :label="t('标签')">
<bk-table-column
prop="gateway_label_ids"
:label="t('标签')"
:filter="{
list: labelsList,
checked: chooseLabels,
filterFn: handleMethodFilter,
btnSave: false,
}"
>
<template #default="{ row }">
<template v-if="row?.gateway_label_ids?.length">
<bk-tag
Expand Down Expand Up @@ -186,6 +195,7 @@ const tableDataKey = ref(-1);

// 网关标签
const labels = ref<any[]>([]);
const chooseLabels = ref<string[]>([]);

// 网关id
const apigwId = computed(() => common.apigwId);
Expand Down Expand Up @@ -223,6 +233,17 @@ const customMethodsList = computed(() => {
};
});
});

const labelsList = computed(() => {
tableDataKey.value = +new Date();
return labels.value?.map((item: any) => {
return {
text: item.name,
value: item.id,
};
});
});

// const renderMethodsLabel = () => {
// return h('div', { class: 'resource-setting-custom-label' }, [
// h(
Expand Down Expand Up @@ -360,6 +381,18 @@ const getPageData = () => {
updateTableEmptyConfig();
}

if (chooseLabels.value?.length) {
curAllData = curAllData?.filter((row: any) => {
const flag = chooseLabels.value?.some((item: any) => row?.gateway_label_ids?.includes(item));
if (flag) {
return true;
}
return false;
});

updateTableEmptyConfig();
}

// 当前页数
const page = pagination.value.current;
// limit 页容量
Expand Down Expand Up @@ -399,11 +432,11 @@ const handlePageSizeChange = (limit: number) => {

const updateTableEmptyConfig = () => {
tableEmptyConf.value.isAbnormal = pagination.value.abnormal;
if (searchValue.value || chooseMethod.value?.length || !curPageData.value.length) {
if (searchValue.value || chooseMethod.value?.length || chooseLabels.value?.length || !curPageData.value.length) {
tableEmptyConf.value.keyword = 'placeholder';
return;
}
if (searchValue.value || chooseMethod.value?.length) {
if (searchValue.value || chooseMethod.value?.length || chooseLabels.value?.length) {
tableEmptyConf.value.keyword = '$CONSTANT';
return;
}
Expand All @@ -413,6 +446,7 @@ const updateTableEmptyConfig = () => {
const handleClearFilterKey = () => {
searchValue.value = '';
chooseMethod.value = [];
chooseLabels.value = [];
tableDataKey.value = +new Date();
// handleSearchClear();
pagination.value = Object.assign(pagination.value, {
Expand Down
Loading