mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-11-08 02:36:01 +08:00
fix: Add a restart prompt for HTTP-type mirror repositories (#9252)
Refs #8978
This commit is contained in:
parent
8c3145e1c6
commit
7624670ee0
9 changed files with 40 additions and 15 deletions
|
|
@ -833,6 +833,7 @@ const message = {
|
|||
|
||||
repo: 'Registries',
|
||||
createRepo: 'Add',
|
||||
createRepoHelper: 'Adding an HTTP-type repository requires restarting the Docker service.',
|
||||
httpRepo: 'Choosing HTTP protocol requires restarting the Docker service to add it into insecure registries.',
|
||||
delInsecure: 'Deletion of credit',
|
||||
delInsecureHelper:
|
||||
|
|
|
|||
|
|
@ -829,6 +829,7 @@ const message = {
|
|||
|
||||
repo: 'レジストリ',
|
||||
createRepo: '追加',
|
||||
createRepoHelper: 'HTTPタイプのリポジトリを追加するにはDockerサービスの再起動が必要です。',
|
||||
httpRepo:
|
||||
'HTTPプロトコルを選択するには、Dockerサービスを再起動して不安定なレジストリに追加する必要があります。',
|
||||
delInsecure: 'クレジットの削除',
|
||||
|
|
|
|||
|
|
@ -819,6 +819,7 @@ const message = {
|
|||
|
||||
repo: '레지스트리',
|
||||
createRepo: '추가',
|
||||
createRepoHelper: 'HTTP 타입 저장소 추가 시 Docker 서비스 재시작이 필요합니다.',
|
||||
httpRepo: 'HTTP 프로토콜을 선택하면 Docker 서비스를 재시작하여 불안정한 레지스트리에 추가해야 합니다.',
|
||||
delInsecure: '신뢰할 수 없는 항목 삭제',
|
||||
delInsecureHelper:
|
||||
|
|
|
|||
|
|
@ -845,6 +845,7 @@ const message = {
|
|||
|
||||
repo: 'Pendaftaran',
|
||||
createRepo: 'Tambah',
|
||||
createRepoHelper: 'Menambah repositori jenis HTTP memerlukan mulakan semula perkhidmatan Docker.',
|
||||
httpRepo:
|
||||
'Memilih protokol HTTP memerlukan memulakan semula perkhidmatan Docker untuk menambahkannya ke pendaftaran tidak selamat.',
|
||||
delInsecure: 'Padamkan pendaftaran tidak selamat',
|
||||
|
|
|
|||
|
|
@ -841,6 +841,7 @@ const message = {
|
|||
|
||||
repo: 'Registries',
|
||||
createRepo: 'Adicionar',
|
||||
createRepoHelper: 'Adicionar um repositório do tipo HTTP requer reinicialização do serviço Docker.',
|
||||
httpRepo:
|
||||
'Escolher o protocolo HTTP requer reiniciar o serviço Docker para adicioná-lo a registries inseguros.',
|
||||
delInsecure: 'Remover da lista de segurança',
|
||||
|
|
|
|||
|
|
@ -843,6 +843,7 @@ const message = {
|
|||
|
||||
repo: 'Реестры',
|
||||
createRepo: 'Добавить',
|
||||
createRepoHelper: 'Добавление репозитория HTTP-типа требует перезапуска службы Docker.',
|
||||
httpRepo: 'Выбор HTTP протокола требует перезапуска службы Docker для добавления в небезопасные реестры.',
|
||||
delInsecure: 'Удаление учетных данных',
|
||||
delInsecureHelper: 'Это перезапустит службу Docker для удаления из небезопасных реестров. Хотите продолжить?',
|
||||
|
|
|
|||
|
|
@ -804,6 +804,7 @@ const message = {
|
|||
|
||||
repo: '倉庫',
|
||||
createRepo: '新增倉庫',
|
||||
createRepoHelper: '添加 HTTP 類型倉庫需要重啟 Docker 服務。',
|
||||
downloadUrl: '下載網址',
|
||||
imageRepo: '鏡像倉庫',
|
||||
repoHelper: '是否包含鏡像倉庫/組織/項目?',
|
||||
|
|
|
|||
|
|
@ -806,6 +806,7 @@ const message = {
|
|||
|
||||
repo: '仓库',
|
||||
createRepo: '添加仓库',
|
||||
createRepoHelper: '添加 http 类型仓库需要重启 Docker 服务。',
|
||||
downloadUrl: '下载地址',
|
||||
imageRepo: '镜像仓库',
|
||||
repoHelper: '是否包含镜像仓库/组织/项目?',
|
||||
|
|
|
|||
|
|
@ -81,6 +81,8 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-drawer>
|
||||
|
||||
<ConfirmDialog ref="confirmDialog" @confirm="submit" />
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
|
|
@ -105,6 +107,8 @@ const drawerVisible = ref(false);
|
|||
const dialogData = ref<DialogProps>({
|
||||
title: '',
|
||||
});
|
||||
const confirmDialog = ref();
|
||||
|
||||
const acceptParams = (params: DialogProps): void => {
|
||||
dialogData.value = params;
|
||||
title.value = i18n.global.t('commons.button.' + dialogData.value.title);
|
||||
|
|
@ -114,6 +118,7 @@ const emit = defineEmits<{ (e: 'search'): void }>();
|
|||
|
||||
const handleClose = () => {
|
||||
drawerVisible.value = false;
|
||||
emit('search');
|
||||
};
|
||||
const rules = reactive({
|
||||
name: [Rules.requiredInput, Rules.name],
|
||||
|
|
@ -142,21 +147,23 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
if (!formEl) return;
|
||||
formEl.validate(async (valid) => {
|
||||
if (!valid) return;
|
||||
loading.value = true;
|
||||
if (dialogData.value.title === 'add') {
|
||||
await createImageRepo(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisible.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
if (dialogData.value.rowData.protocol === 'https') {
|
||||
submit();
|
||||
return;
|
||||
}
|
||||
await updateImageRepo(dialogData.value.rowData!)
|
||||
let params = {
|
||||
header: i18n.global.t('container.createRepo'),
|
||||
operationInfo: i18n.global.t('container.createRepoHelper'),
|
||||
submitInputInfo: i18n.global.t('database.restartNow'),
|
||||
};
|
||||
confirmDialog.value!.acceptParams(params);
|
||||
});
|
||||
};
|
||||
|
||||
const submit = async () => {
|
||||
loading.value = true;
|
||||
if (dialogData.value.title === 'add') {
|
||||
await createImageRepo(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
|
|
@ -166,9 +173,19 @@ const onSubmit = async (formEl: FormInstance | undefined) => {
|
|||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
});
|
||||
return;
|
||||
}
|
||||
await updateImageRepo(dialogData.value.rowData!)
|
||||
.then(() => {
|
||||
loading.value = false;
|
||||
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
|
||||
emit('search');
|
||||
drawerVisible.value = false;
|
||||
})
|
||||
.catch(() => {
|
||||
loading.value = false;
|
||||
});
|
||||
};
|
||||
|
||||
defineExpose({
|
||||
acceptParams,
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue