mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-03-17 03:04:46 +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
|
deamonMap["insecure-registries"] = req.Registries
|
||||||
}
|
}
|
||||||
if len(req.Mirrors) == 0 {
|
if len(req.Mirrors) == 0 {
|
||||||
delete(deamonMap, "insecure-mirrors")
|
delete(deamonMap, "registry-mirrors")
|
||||||
} else {
|
} else {
|
||||||
deamonMap["insecure-mirrors"] = req.Mirrors
|
deamonMap["registry-mirrors"] = req.Mirrors
|
||||||
}
|
}
|
||||||
if len(req.Bip) == 0 {
|
if len(req.Bip) == 0 {
|
||||||
delete(deamonMap, "bip")
|
delete(deamonMap, "bip")
|
||||||
|
@ -415,6 +415,8 @@ export default {
|
|||||||
imageRepo: 'Image repo',
|
imageRepo: 'Image repo',
|
||||||
repoHelper: 'Does it include a mirror repository/organization/project?',
|
repoHelper: 'Does it include a mirror repository/organization/project?',
|
||||||
auth: 'Auth',
|
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',
|
compose: 'Compose',
|
||||||
composeTemplate: 'Compose template',
|
composeTemplate: 'Compose template',
|
||||||
|
@ -423,6 +423,8 @@ export default {
|
|||||||
imageRepo: '镜像仓库',
|
imageRepo: '镜像仓库',
|
||||||
repoHelper: '是否包含镜像仓库/组织/项目?',
|
repoHelper: '是否包含镜像仓库/组织/项目?',
|
||||||
auth: '认证',
|
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: '编排',
|
compose: '编排',
|
||||||
composeTemplate: '编排模版',
|
composeTemplate: '编排模版',
|
||||||
|
@ -13,8 +13,8 @@
|
|||||||
<el-form-item :label="$t('container.mirrors')" prop="mirrors">
|
<el-form-item :label="$t('container.mirrors')" prop="mirrors">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:placeholder="$t('container.tagHelper')"
|
:placeholder="$t('container.mirrorHelper')"
|
||||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||||
v-model="form.mirrors"
|
v-model="form.mirrors"
|
||||||
/>
|
/>
|
||||||
<span class="input-help">{{ $t('container.mirrorsHelper') }}</span>
|
<span class="input-help">{{ $t('container.mirrorsHelper') }}</span>
|
||||||
@ -22,8 +22,8 @@
|
|||||||
<el-form-item :label="$t('container.registries')" prop="registries">
|
<el-form-item :label="$t('container.registries')" prop="registries">
|
||||||
<el-input
|
<el-input
|
||||||
type="textarea"
|
type="textarea"
|
||||||
:placeholder="$t('container.tagHelper')"
|
:placeholder="$t('container.registrieHelper')"
|
||||||
:autosize="{ minRows: 2, maxRows: 10 }"
|
:autosize="{ minRows: 3, maxRows: 10 }"
|
||||||
v-model="form.registries"
|
v-model="form.registries"
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -127,21 +127,28 @@ const onSubmitSave = async () => {
|
|||||||
if (confShowType.value === 'all') {
|
if (confShowType.value === 'all') {
|
||||||
let param = {
|
let param = {
|
||||||
file: dockerConf.value,
|
file: dockerConf.value,
|
||||||
path: '/opt/1Panel/docker/config/daemon.json',
|
path: '/opt/1Panel/docker/conf/daemon.json',
|
||||||
};
|
};
|
||||||
await updateDaemonJsonByfile(param);
|
await updateDaemonJsonByfile(param);
|
||||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
let itemMirrors = form.mirrors.split('\n');
|
||||||
|
let itemRegistries = form.registries.split('\n');
|
||||||
let param = {
|
let param = {
|
||||||
status: form.status,
|
status: form.status,
|
||||||
bip: form.bip,
|
bip: form.bip,
|
||||||
registryMirrors: form.mirrors.split('\n'),
|
registryMirrors: itemMirrors.filter(function (el) {
|
||||||
insecureRegistries: form.registries.split('\n'),
|
return el !== null && el !== '' && el !== undefined;
|
||||||
|
}),
|
||||||
|
insecureRegistries: itemRegistries.filter(function (el) {
|
||||||
|
return el !== null && el !== '' && el !== undefined;
|
||||||
|
}),
|
||||||
liveRestore: form.liveRestore,
|
liveRestore: form.liveRestore,
|
||||||
cgroupDriver: form.cgroupDriver,
|
cgroupDriver: form.cgroupDriver,
|
||||||
};
|
};
|
||||||
await updateDaemonJson(param);
|
await updateDaemonJson(param);
|
||||||
|
search();
|
||||||
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
ElMessage.success(i18n.global.t('commons.msg.operationSuccess'));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@
|
|||||||
v-model="quickCmd"
|
v-model="quickCmd"
|
||||||
clearable
|
clearable
|
||||||
filterable
|
filterable
|
||||||
@blur="quickInput(quickCmd)"
|
@change="quickInput(quickCmd)"
|
||||||
style="width: 25%"
|
style="width: 25%"
|
||||||
:placeholder="$t('terminal.quickCommand')"
|
:placeholder="$t('terminal.quickCommand')"
|
||||||
>
|
>
|
||||||
@ -267,6 +267,7 @@ function quickInput(val: any) {
|
|||||||
if (val !== '') {
|
if (val !== '') {
|
||||||
if (ctx) {
|
if (ctx) {
|
||||||
ctx.refs[`Ref${terminalValue.value}`] && ctx.refs[`Ref${terminalValue.value}`][0].onSendMsg(val + '\n');
|
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