fix: 解决容器镜像加速或仓库空行导致 Docker 无法正常启用的问题 (#1437)

release-1.3
ssongliu 1 year ago committed by wanghe-fit2cloud
parent f808e81958
commit 662eae1ba4

@ -136,12 +136,14 @@ func (u *DockerService) UpdateConf(req dto.SettingUpdate) error {
switch req.Key { switch req.Key {
case "Registries": case "Registries":
req.Value = strings.TrimRight(req.Value, ",")
if len(req.Value) == 0 { if len(req.Value) == 0 {
delete(daemonMap, "insecure-registries") delete(daemonMap, "insecure-registries")
} else { } else {
daemonMap["insecure-registries"] = strings.Split(req.Value, ",") daemonMap["insecure-registries"] = strings.Split(req.Value, ",")
} }
case "Mirrors": case "Mirrors":
req.Value = strings.TrimRight(req.Value, ",")
if len(req.Value) == 0 { if len(req.Value) == 0 {
delete(daemonMap, "registry-mirrors") delete(daemonMap, "registry-mirrors")
} else { } else {

@ -18,13 +18,13 @@
:stroke-width="12" :stroke-width="12"
:percentage="uploadPrecent" :percentage="uploadPrecent"
></el-progress> ></el-progress>
<div v-if="type === 'mysql'" class="el-upload__tip"> <div v-if="type === 'mysql'" style="width: 80%" class="el-upload__tip">
<span class="input-help">{{ $t('database.supportUpType') }}</span> <span class="input-help">{{ $t('database.supportUpType') }}</span>
<span class="input-help"> <span class="input-help">
{{ $t('database.zipFormat') }} {{ $t('database.zipFormat') }}
</span> </span>
</div> </div>
<div v-else class="el-upload__tip"> <div v-else style="width: 80%" class="el-upload__tip">
<span class="input-help">{{ $t('website.supportUpType') }}</span> <span class="input-help">{{ $t('website.supportUpType') }}</span>
<span class="input-help"> <span class="input-help">
{{ $t('website.zipFormat', [type + '.json']) }} {{ $t('website.zipFormat', [type + '.json']) }}

Loading…
Cancel
Save