Skip to content

Commit

Permalink
fix(frontend): 新建开区取消授权IP必填限制 #3488
Browse files Browse the repository at this point in the history
  • Loading branch information
jinquantianxia authored and zhangzhw8 committed Mar 7, 2024
1 parent f431bec commit acaa9b1
Show file tree
Hide file tree
Showing 11 changed files with 34 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
:columns="columns"
:container-height="600"
:data-source="getPermissionRules"
:remote-pagination="false"
:settings="settings" />
</div>
<template #footer>
Expand Down
2 changes: 1 addition & 1 deletion dbm-ui/frontend/src/services/model/es/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ export default class Es {
}

get domainDisplayName() {
const port = this.es_datanode_hot[0]?.port;
const { port } = this.es_master[0];
const displayName = port ? `${this.domain}:${port}` : this.domain;
return displayName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
import IpSelector from '@components/ip-selector/IpSelector.vue';

import type { IDataRow } from './Row.vue';
import useValidtor from './useValidtor';
import useValidtor, { type Rules } from './useValidtor';

interface Props {
clusterData?: IDataRow['clusterData']
Expand All @@ -112,11 +112,11 @@
const isShowOverflowTip = computed(() => isOverflow.value && showEditIcon.value);

const rules = [
{
validator: (value: string[]) => value.length > 0,
message: t('授权 IP 不能为空'),
},
];
// {
// validator: (value: string[]) => value.length > 0,
// message: t('授权 IP 不能为空'),
// },
] as Rules;

const {
message: errorMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</RenderTableHeadColumn>
<RenderTableHeadColumn
:min-width="100"
:required="false"
:width="190">
{{ t('授权 IP') }}
</RenderTableHeadColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@
};
onMounted(() => {
if (props.ruleIdList.length === 0) {
return;
}
tableRef.value.fetchData({
cluster_id: props.clusterId,
rule_ids: props.ruleIdList.join(','),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<BkCollapse v-model="activeCollapses">
<Vuedraggable
v-model="allRenderMenuGroupList"
item-key="id">
item-key="id"
@end="handleDragEnd">
<template #item="{element}">
<RenderMenuGroup
:id="element.id"
Expand Down Expand Up @@ -102,13 +103,12 @@
immediate: true,
});

// 拖动排序
watch(allRenderMenuGroupList, () => {
const handleDragEnd = () => {
userProfileStore.updateProfile({
label: UserPersonalSettings.MYSQL_TOOLBOX_MENUS,
values: allRenderMenuGroupList.value.map(item => item.id),
});
});
};

</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
<BkCollapse v-model="activeCollapses">
<Vuedraggable
v-model="allRenderMenuGroupList"
item-key="id">
item-key="id"
@end="handleDragEnd">
<template #item="{element}">
<RenderMenuGroup
:id="element.id"
Expand Down Expand Up @@ -103,13 +104,12 @@
immediate: true,
});

// 拖动排序
watch(allRenderMenuGroupList, () => {
const handleDragEnd = () => {
userProfileStore.updateProfile({
label: UserPersonalSettings.REDIS_TOOLBOX_MENUS,
values: allRenderMenuGroupList.value.map(item => item.id),
});
});
};

</script>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
import IpSelector from '@components/ip-selector/IpSelector.vue';

import type { IDataRow } from './Row.vue';
import useValidtor from './useValidtor';
import useValidtor, { type Rules } from './useValidtor';

interface Props {
clusterData?: IDataRow['clusterData']
Expand All @@ -111,11 +111,11 @@
const isShowOverflowTip = computed(() => isOverflow.value && showEditIcon.value);

const rules = [
{
validator: (value: string[]) => value.length > 0,
message: t('授权 IP 不能为空'),
},
];
// {
// validator: (value: string[]) => value.length > 0,
// message: t('授权 IP 不能为空'),
// },
] as Rules;

const {
message: errorMessage,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
</RenderTableHeadColumn>
<RenderTableHeadColumn
:min-width="100"
:required="false"
:width="190">
{{ t('授权 IP') }}
</RenderTableHeadColumn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
};
onMounted(() => {
if (props.ruleIdList.length === 0) {
return;
}
tableRef.value.fetchData({
cluster_id: props.clusterId,
rule_ids: props.ruleIdList.join(','),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@
<BkCollapse v-model="activeCollapses">
<Vuedraggable
v-model="allRenderMenuGroupList"
item-key="id">
item-key="id"
@end="handleDragEnd">
<template #item="{element}">
<RenderMenuGroup
:id="element.id"
Expand Down Expand Up @@ -103,14 +104,12 @@
immediate: true,
});

// 拖动排序
watch(allRenderMenuGroupList, () => {
const handleDragEnd = () => {
userProfileStore.updateProfile({
label: UserPersonalSettings.SPIDER_TOOLBOX_MENUS,
values: allRenderMenuGroupList.value.map(item => item.id),
});
});

};
</script>

<style lang="less">
Expand Down

0 comments on commit acaa9b1

Please sign in to comment.