diff --git a/src/locales/en.json b/src/locales/en.json index 10ae1749..ac84bc87 100644 --- a/src/locales/en.json +++ b/src/locales/en.json @@ -110,6 +110,7 @@ "All TCP": "All TCP", "All UDP": "All UDP", "All data downloaded.": "All data downloaded.", + "All network segments are indicated by \"*\", not \"0.0.0.0/0\"": "All network segments are indicated by \"*\", not \"0.0.0.0/0\"", "Allocate IP": "Allocate IP", "Allocation Pools": "Allocation Pools", "Allowed Address Pair": "Allowed Address Pair", diff --git a/src/locales/zh.json b/src/locales/zh.json index 63db1f18..6bb069aa 100644 --- a/src/locales/zh.json +++ b/src/locales/zh.json @@ -110,6 +110,7 @@ "All TCP": "所有TCP协议", "All UDP": "所有UDP协议", "All data downloaded.": "所有数据已完成下载。", + "All network segments are indicated by \"*\", not \"0.0.0.0/0\"": "所有网络段用 “*” 表示,协议不支持 “0.0.0.0/0” 表示所有网段", "Allocate IP": "申请IP", "Allocation Pools": "分配地址池", "Allowed Address Pair": "可用地址对", diff --git a/src/pages/share/containers/Share/Detail/AccessRule/actions/Create.jsx b/src/pages/share/containers/Share/Detail/AccessRule/actions/Create.jsx index bfd56c1b..e33acdd8 100644 --- a/src/pages/share/containers/Share/Detail/AccessRule/actions/Create.jsx +++ b/src/pages/share/containers/Share/Detail/AccessRule/actions/Create.jsx @@ -63,16 +63,26 @@ export class Create extends ModalAction { return getOptions(shareAccessLevel); } - get defaultValue() { - return { isPublic: true }; - } - get typeTip() { return t( "'ip' rule represents IPv4 or IPv6 address, 'cert' rule represents TLS certificate, 'user' rule represents username or usergroup, 'cephx' rule represents ceph auth ID." ); } + get nameForStateUpdate() { + return ['access_type']; + } + + getAccessExtra() { + const { access_type: type } = this.state; + const { detail: { share_proto: proto } = {} } = this.containerProps || {}; + const ipTipTypes = ['NFS', 'CIFS']; + if (ipTipTypes.includes(proto) && type === 'ip') { + return t('All network segments are indicated by "*", not "0.0.0.0/0"'); + } + return ''; + } + get formItems() { return [ { @@ -95,6 +105,7 @@ export class Create extends ModalAction { label: t('Access To'), type: 'input', required: true, + extra: this.getAccessExtra(), }, metadataFormItem, ];