Skip to content

Commit

Permalink
fix: remove image name with scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
ymh1028 committed Feb 4, 2020
1 parent 70a944b commit c58c7af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/components/Forms/Secret/SecretSettings/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export default class SecretSettings extends React.Component {
<Column>
<Form.Item
label={t('Registry Address')}
desc={t("Needn't Protocol. ex: docker.io")}
desc={t('Example: docker.io')}
rules={[
{ required: true, message: t('Please input registry address') },
{ validator: this.dataValidator },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,11 @@ export default class DropdownContent extends React.Component {
const selectedSecret = imageRegistries.find(
item => item.value === this.secretValue
)
const url = get(selectedSecret, 'url', '')

let url = get(selectedSecret, 'url', '')
if (url) {
// remove url scheme
url = url.replace(/^(http(s)?:\/\/)?(.*)$/, '$3')
return url
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/locales/zh/secret.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export default {

SECRET_NO_CHINESE_CODE_DESC: '密钥中不能包含中文字符',

'Registry Address': '仓库地址',
'Registry verify failed': '镜像仓库校验失败',
'Account Password Secret': '账号密码密钥',

Expand All @@ -47,5 +48,5 @@ export default {

'DATA-KEY': '键(Key)',
'DATA-VALUE': '值(Value)',
"Needn't Protocol. ex: docker.io": '不用添加协议名称, 例:docker.io',
'Example: docker.io': '例:docker.io',
}

0 comments on commit c58c7af

Please sign in to comment.