Skip to content

Commit

Permalink
Revert "fix: 1.14 问题修复 (#863)"
Browse files Browse the repository at this point in the history
This reverts commit da5b3dc.
  • Loading branch information
wklken authored Sep 11, 2024
1 parent 365654b commit b0457a8
Show file tree
Hide file tree
Showing 106 changed files with 832 additions and 2,435 deletions.
9 changes: 0 additions & 9 deletions src/dashboard-front/src/components/resource-detail/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,6 @@
</div>
</bk-col>
</bk-row> -->
<bk-row :class="{ 'ag-diff': checkDiff('localData.enable_websocket') }">
<bk-col :span="4">
<label class="ag-key">{{ $t("启用 WebSocket") }}:</label>
</bk-col>
<bk-col :span="10">
<div class="ag-value">{{ localData.enable_websocket ? $t("") : $t("") }}</div>
</bk-col>
</bk-row>
</bk-container>
<template v-if="localData.proxy?.backend_id">
Expand Down
3 changes: 0 additions & 3 deletions src/dashboard-front/src/css/common.css
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,6 @@
.mt5 {
margin-top: 5px !important;
}
.mt8 {
margin-top: 8px !important;
}
.mt10 {
margin-top: 10px !important;
}
Expand Down
6 changes: 0 additions & 6 deletions src/dashboard-front/src/language/lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,6 @@ const lang: ILANG = {
'个资源': ['resources'],
'批量编辑资源': ['Batch Edit Resource'],
'确定要删除实例': ['Confirm to delete the instance'],
'批量编辑资源(共{count}个)': ['Batch edit resources (total {count})'],
'确定要删除以下{count}个资源': ['Be sure to delete the following {count} resources'],
'删除资源后,需要生成新的版本,并发布到目标环境才能生效': ['After a resource is deleted, a new version must be generated and released to the target environment to take effect'],
'是否修改标签': ['Whether to modify labels'],
'请输入资源名称或请求路径,回车结束': ['Please input resource name or path, press Enter to search'],
'全部差异类型': ['All Diff Types'],
'仅显示有差异的资源属性': ['Only show differences'],
Expand Down Expand Up @@ -1591,8 +1587,6 @@ const lang: ILANG = {
'文件名需要跟资源名称完全一致才能导入,请检查文件名': ['Filename must matches resource name'],
'已匹配到资源': ['Resource matched'],
'未匹配到资源': ['Resource not matched'],
'启用 WebSocket': ['Enable WebSocket'],
'启用 WebSocket:': ['Enable WebSocket: '],

// 变量的使用 $t('test', { vari1: 1, vari2: 2 })
// // 变量的使用 $t('test', { vari1: 1, vari2: 2 })
Expand Down
16 changes: 3 additions & 13 deletions src/dashboard-front/src/views/backend-service/add.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
:rules="configRules.weight"
:property="`configs.hosts.${i}.weight`"
label=""
class="weight-input">
style="margin-bottom: 0px;">
<bk-input
class="suffix-slot-cls weights-input"
:placeholder="t('权重')"
Expand Down Expand Up @@ -653,25 +653,15 @@ defineExpose({
display: none;
}
}
.weight-input {
margin-bottom: 0px;
border-left: 1px solid #c4c6cc !important;
:deep(.bk-form-content) {
margin-top: -1px;
}
}
.suffix-slot-cls {
width: 80px;
line-height: 30px;
font-size: 12px;
color: #63656e;
text-align: center;
height: 30px;
height: 28px;
border: none;
box-shadow: none !important;
:deep(.bk-input--text) {
border-radius: 0;
}
border-left: 1px solid #c4c6cc !important;
}
.scheme-select-cls {
color: #63656e;
Expand Down
15 changes: 1 addition & 14 deletions src/dashboard-front/src/views/online-debug/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
v-for="item in stageList"
:id="item.id"
:key="item.id"
:name="getItemName(item)"
:disabled="['unreleased', 'failure'].includes(item?.release?.status)"
:name="item.name"
/>
</bk-select>
<div class="search-source">
Expand Down Expand Up @@ -538,18 +537,6 @@ const resourceGroup = computed(() => {
return group;
});
const getItemName = (item: any) => {
if (!['unreleased', 'failure'].includes(item?.release?.status)) {
return item.name;
}
if (item?.release?.status === 'unreleased') {
return `${item.name} (未发布)`;
}
if (item?.release?.status === 'failure') {
return `${item.name} (发布失败)`;
}
};
const handleStageChange = (payload: number) => {
const hasData = stageList.value.find((item: Record<string, number>) => item.id === payload);
// 如果是未发布或者发布失败则不需要调资源列表
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,6 @@
</bk-checkbox>
</div>
</bk-form-item>
<bk-form-item
:label="t('启用 WebSocket')"
property="enable_websocket"
required>
<bk-switcher v-model="frontConfigData.enable_websocket" theme="primary" size="small"></bk-switcher>
</bk-form-item>
</bk-form>
</template>
<script setup lang="ts">
Expand Down Expand Up @@ -64,7 +58,6 @@ const frontConfigData = ref({
path: '',
method: 'GET',
match_subpath: false,
enable_websocket: false,
});
const cloneData = ref({
Expand Down Expand Up @@ -111,8 +104,8 @@ watch(
() => props.detail,
(val: any) => {
if (Object.keys(val).length) {
const { path, method, match_subpath, enable_websocket } = val;
frontConfigData.value = { path, method, match_subpath, enable_websocket };
const { path, method, match_subpath } = val;
frontConfigData.value = { path, method, match_subpath };
if (props.isClone) {
cloneData.value = { path, method };
setTimeout(() => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@ const props = defineProps({
// 是否强制让 select 进入 focus 态
// 用于某些场景下 select 框不展示 focus 态样式的问题
forceFocus: { type: Boolean, default: false },
// 批量编辑标签时,不需要更新某一资源的标签列表
bathEdit: { type: Boolean, default: false },
});
const { curSelectLabelIds, resourceId, labelsData, width, isAdd, modelValue } = toRefs(props);
Expand Down Expand Up @@ -163,7 +161,7 @@ const handleToggle = async (v: boolean) => {
_forceFocus.value = false;
}
// 新增标签标识
if (isAdd.value || props.bathEdit) return;
if (isAdd.value) return;
setTimeout(async () => {
// 关闭下拉框且
if (!v) {
Expand Down Expand Up @@ -201,7 +199,7 @@ const addOption = async () => {
width: 'auto',
});
optionName.value = '';
if (curLabelIds.value.length < 10 && !props.bathEdit) {
if (curLabelIds.value.length < 10) {
curLabelIds.value.push(ret.id);
if (!isAdd.value) {
await updateResourcesLabels(apigwId, resourceId.value, { label_ids: curLabelIds.value });
Expand Down
25 changes: 0 additions & 25 deletions src/dashboard-front/src/views/resource/setting/detail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -301,29 +301,6 @@
</bk-popover>
</div>
</bk-form-item>
<!-- 是否启用 websocket -->
<bk-form-item class="form-item-cls">
<template #label>
<span class="label-cls">{{ t('启用 WebSocket:') }}</span>
</template>
<div v-if="!frontWsEdit" class="value-container">
<span>{{ formData?.enable_websocket ? t('是') : t('否') }}</span>
<span class="operate-btn">
<i @click="frontWsEdit = true" class="apigateway-icon icon-ag-edit-line"></i>
</span>
</div>
<div class="edit-name mt8" v-else>
<bk-switcher
v-model="formData.enable_websocket"
theme="primary"
size="small"
@change="handleEditSave"
class="method">
</bk-switcher>
</div>
</bk-form-item>
</bk-form>
<div class="title">{{ t('后端配置') }}</div>
Expand Down Expand Up @@ -602,7 +579,6 @@ const permEdit = ref<boolean>(false);
const publicEdit = ref<boolean>(false);
const frontMethodEdit = ref<boolean>(false);
const frontPathEdit = ref<boolean>(false);
const frontWsEdit = ref(false); // 是否启用websocket的编辑态
const backMethodEdit = ref<boolean>(false);
const backServicesEdit = ref<boolean>(false);
const backPathEdit = ref<boolean>(false);
Expand Down Expand Up @@ -879,7 +855,6 @@ const handleEditSave = async () => {
publicEdit.value = false;
frontMethodEdit.value = false;
frontPathEdit.value = false;
frontWsEdit.value = false;
backMethodEdit.value = false;
backServicesEdit.value = false;
backPathEdit.value = false;
Expand Down
1 change: 0 additions & 1 deletion src/dashboard-front/src/views/resource/setting/import.vue
Original file line number Diff line number Diff line change
Expand Up @@ -595,7 +595,6 @@ import {
} from '@/views/resource/setting/types';
import TableResToAction from '@/views/resource/setting/comps/table-res-to-action.vue';
import TableResToUncheck from '@/views/resource/setting/comps/table-res-to-uncheck.vue';
// @ts-ignore
import { useParentElement } from '@vueuse/core';
Expand Down
48 changes: 5 additions & 43 deletions src/dashboard-front/src/views/resource/setting/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@
quick-close
:is-loading="dialogData.loading"
@confirm="handleBatchConfirm"
@closed="handleBatchCancel">
@closed="dialogData.isShow = false">
<div class="delete-content" v-if="isBatchDelete">
<bk-table
row-hover="auto"
Expand All @@ -386,12 +386,12 @@
<bk-alert
class="mt10 mb10"
theme="warning"
:title="t('删除资源后,需要生成新的版本,并发布到目标环境才能生效')"
title="删除资源后,需要生成新的版本,并发布到目标环境才能生效"
/>
</div>
<div v-else>
<bk-form>
<bk-form-item :label="t('基本信息')">
<bk-form-item label="基本信息">
<bk-checkbox
v-model="batchEditData.isPublic"
@change="handlePublicChange">
Expand All @@ -403,24 +403,6 @@
{{ t('允许申请权限') }}
</bk-checkbox>
</bk-form-item>
<bk-form-item :label="t('是否修改标签')">
<div class="edit-labels-container">
<bk-switcher
v-model="batchEditData.isUpdateLabels"
theme="primary"
/>
<SelectCheckBox
class="select-labels"
v-if="batchEditData.isUpdateLabels"
:cur-select-label-ids="[]"
:labels-data="labelsData"
:bath-edit="true"
v-model="batchEditData.labelIds"
@update-success="getLabelsData"
@label-add-success="getLabelsData">
</SelectCheckBox>
</div>
</bk-form-item>
</bk-form>
</div>
</bk-dialog>
Expand Down Expand Up @@ -662,8 +644,6 @@ const versionConfigs = reactive({
const batchEditData = ref({
isPublic: true,
allowApply: true,
isUpdateLabels: false,
labelIds: [],
});
// const showEdit = ref(false);
Expand Down Expand Up @@ -984,11 +964,11 @@ const handleBatchOperate = async (data: IDropList) => {
// 批量删除
if (data.value === 'delete') {
isBatchDelete.value = true;
dialogData.title = t('确定要删除以下{count}个资源', { count: selections.value.length });
dialogData.title = t(`确定要删除以下${selections.value.length}个资源`);
} else {
// 批量编辑
isBatchDelete.value = false;
dialogData.title = t('批量编辑资源(共{count}个)', { count: selections.value.length });
dialogData.title = t(`批量编辑资源共${selections.value.length}个`);
}
};
Expand Down Expand Up @@ -1046,14 +1026,11 @@ const handleBatchConfirm = async () => {
ids,
is_public: batchEditData.value.isPublic,
allow_apply_permission: batchEditData.value.allowApply,
is_update_labels: batchEditData.value.isUpdateLabels,
label_ids: batchEditData.value.labelIds,
};
// 批量编辑
await batchEditResources(props.apigwId, params);
}
dialogData.isShow = false;
batchEditData.value.isUpdateLabels = false;
Message({
message: t(`${isBatchDelete.value ? '删除' : '编辑'}成功`),
theme: 'success',
Expand All @@ -1063,11 +1040,6 @@ const handleBatchConfirm = async () => {
resetSelections();
};
const handleBatchCancel = () => {
dialogData.isShow = false;
batchEditData.value.isUpdateLabels = false;
};
// 处理导入跳转
const handleImport = (v: IDropList) => {
const routerName = v.value === 'doc' ? 'apigwResourceImportDoc' : 'apigwResourceImport';
Expand Down Expand Up @@ -1293,8 +1265,6 @@ watch(
if (!filterData.value.order_by) {
delete filterData.value.order_by;
}
pagination.value.offset = 0;
pagination.value.current = 0;
if (v.length) {
v.forEach((e: any) => {
if (e.id === e.name) {
Expand Down Expand Up @@ -1671,14 +1641,6 @@ onBeforeMount(() => {
color: #3a84ff;
cursor: pointer;
}
.edit-labels-container {
.select-labels {
margin-left: 16px;
margin-top: 0px !important;
display: inline-block;
width: 240px;
}
}
</style>
<style lang="scss">
.content-footer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@
:rules="rules.weight"
:property="`config.hosts.${index}.weight`"
label=""
class="weight-input">
style="margin-bottom: 0px;">
<bk-input
:class="['suffix-slot-cls', 'weights-input', { 'is-error': hostItem.isRoles }]"
:placeholder="$t('权重')"
Expand Down Expand Up @@ -883,25 +883,16 @@ defineExpose({
}
}
}
.weight-input {
margin-bottom: 0px;
border-left: 1px solid #c4c6cc !important;
:deep(.bk-form-content) {
margin-top: -1px;
}
}
.suffix-slot-cls {
width: 80px;
line-height: 30px;
font-size: 12px;
color: #63656e;
text-align: center;
height: 30px;
height: 28px;
border: none;
box-shadow: none !important;
:deep(.bk-input--text) {
border-radius: 0;
}
border-left: 1px solid #c4c6cc !important;
}
.group-text-style {
width: 20px;
Expand Down
Loading

0 comments on commit b0457a8

Please sign in to comment.