mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-19 08:19:15 +08:00
fix: 解决 docker daemon.json 配置不生效的问题
This commit is contained in:
parent
755fb514ef
commit
793078b441
@ -85,9 +85,9 @@ func (u *DockerService) UpdateConf(req dto.DaemonJsonConf) error {
|
||||
deamonMap["insecure-registries"] = req.Registries
|
||||
}
|
||||
if len(req.Mirrors) == 0 {
|
||||
delete(deamonMap, "insecure-mirrors")
|
||||
delete(deamonMap, "registry-mirrors")
|
||||
} else {
|
||||
deamonMap["insecure-mirrors"] = req.Mirrors
|
||||
deamonMap["registry-mirrors"] = req.Mirrors
|
||||
}
|
||||
if len(req.Bip) == 0 {
|
||||
delete(deamonMap, "bip")
|
||||
|
@ -415,6 +415,8 @@ export default {
|
||||
imageRepo: 'Image repo',
|
||||
repoHelper: 'Does it include a mirror repository/organization/project?',
|
||||
auth: 'Auth',
|
||||
mirrorHelper: 'One in a row, for example:\nhttps://hub-mirror.c.163.com \nhttps://reg-mirror.qiniu.com',
|
||||
registrieHelper: 'One in a row, for example:\n172.16.10.111:8081 \n172.16.10.112:8081',
|
||||
|
||||
compose: 'Compose',
|
||||
composeTemplate: 'Compose template',
|
||||
|
@ -423,6 +423,8 @@ export default {
|
||||
imageRepo: '镜像仓库',
|
||||
repoHelper: '是否包含镜像仓库/组织/项目?',
|
||||
auth: '认证',
|
||||
mirrorHelper: '一行一个,例:\nhttps://hub-mirror.c.163.com \nhttps://reg-mirror.qiniu.com',
|
||||
registrieHelper: '一行一个,例:\n172.16.10.111:8081 \n172.16.10.112:8081',
|
||||
|
||||
compose: '编排',
|
||||
composeTemplate: '编排模版',
|
||||
|
@ -13,8 +13,8 @@
|
||||
<el-form-item :label="$t('container.mirrors')" prop="mirrors">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:placeholder="$t('container.tagHelper')"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
:placeholder="$t('container.mirrorHelper')"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
v-model="form.mirrors"
|
||||
/>
|
||||
<span class="input-help">{{ $t('container.mirrorsHelper') }}</span>
|
||||
@ -22,8 +22,8 @@
|
||||
<el-form-item :label="$t('container.registries')" prop="registries">
|
||||
<el-input
|
||||
type="textarea"
|
||||
:placeholder="$t('container.tagHelper')"
|
||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
||||
:placeholder="$t('container.registrieHelper')"
|
||||
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||
v-model="form.registries"
|
||||
/>
|
||||
</el-form-item>
|
||||
@ -127,21 +127,28 @@ const onSubmitSave = async () => {
|
||||
if (confShowType.value === 'all') {
|
||||
let param = {
|
||||
file: dockerConf.value,
|
||||
path: '/opt/1Panel/docker/config/daemon.json',
|
||||
path: '/opt/1Panel/docker/conf/daemon.json',
|
||||
};
|
||||
await updateDaemonJsonByfile(param);
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
return;
|
||||
}
|
||||
let itemMirrors = form.mirrors.split('\n');
|
||||
let itemRegistries = form.registries.split('\n');
|
||||
let param = {
|
||||
status: form.status,
|
||||
bip: form.bip,
|
||||
registryMirrors: form.mirrors.split('\n'),
|
||||
insecureRegistries: form.registries.split('\n'),
|
||||
registryMirrors: itemMirrors.filter(function (el) {
|
||||
return el !== null && el !== '' && el !== undefined;
|
||||
}),
|
||||
insecureRegistries: itemRegistries.filter(function (el) {
|
||||
return el !== null && el !== '' && el !== undefined;
|
||||
}),
|
||||
liveRestore: form.liveRestore,
|
||||
cgroupDriver: form.cgroupDriver,
|
||||
};
|
||||
await updateDaemonJson(param);
|
||||
search();
|
||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||
};
|
||||
|
||||
|
@ -39,7 +39,7 @@
|
||||
v-model="quickCmd"
|
||||
clearable
|
||||
filterable
|
||||
@blur="quickInput(quickCmd)"
|
||||
@change="quickInput(quickCmd)"
|
||||
style="width: 25%"
|
||||
:placeholder="$t('terminal.quickCommand')"
|
||||
>
|
||||
@ -267,6 +267,7 @@ function quickInput(val: any) {
|
||||
if (val !== '') {
|
||||
if (ctx) {
|
||||
ctx.refs[`Ref${terminalValue.value}`] && ctx.refs[`Ref${terminalValue.value}`][0].onSendMsg(val + '\n');
|
||||
quickCmd.value = '';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user