mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-12-17 21:08:25 +08:00
parent
944463e9a8
commit
4aca66c417
2 changed files with 18 additions and 2 deletions
|
|
@ -89,6 +89,7 @@ import DockerRestart from '@/components/docker-proxy/docker-restart.vue';
|
|||
import { MsgSuccess } from '@/utils/message';
|
||||
import { ElMessageBox } from 'element-plus';
|
||||
import { ref } from 'vue';
|
||||
import { loadDockerStatus } from '@/api/modules/container';
|
||||
|
||||
const props = defineProps({
|
||||
currentTab: String,
|
||||
|
|
@ -107,10 +108,12 @@ const onPing = ref('Disable');
|
|||
const oldStatus = ref();
|
||||
const dockerRef = ref();
|
||||
const operation = ref('restart');
|
||||
const dockerStatus = ref();
|
||||
const withDockerRestart = ref(false);
|
||||
|
||||
const acceptParams = (): void => {
|
||||
loadBaseInfo(true);
|
||||
loadDocker();
|
||||
};
|
||||
const emit = defineEmits(['search', 'update:is-active', 'update:loading', 'update:maskShow', 'update:name']);
|
||||
|
||||
|
|
@ -140,6 +143,11 @@ const loadBaseInfo = async (search: boolean) => {
|
|||
});
|
||||
};
|
||||
|
||||
const loadDocker = async () => {
|
||||
const res = await loadDockerStatus();
|
||||
dockerStatus.value = res.data.isExist;
|
||||
};
|
||||
|
||||
const loadInitMsg = () => {
|
||||
switch (props.currentTab) {
|
||||
case 'base':
|
||||
|
|
@ -201,7 +209,7 @@ const onUnBind = async () => {
|
|||
|
||||
const onOperate = async (op: string) => {
|
||||
operation.value = op;
|
||||
if (baseInfo.value.name === 'iptables') {
|
||||
if (baseInfo.value.name === 'iptables' || !dockerStatus.value) {
|
||||
emit('update:loading', true);
|
||||
emit('update:maskShow', true);
|
||||
await operateFire(operation.value, false)
|
||||
|
|
|
|||
|
|
@ -78,6 +78,7 @@ import { GlobalStore } from '@/store';
|
|||
import { storeToRefs } from 'pinia';
|
||||
import ConfirmDialog from '@/components/confirm-dialog/index.vue';
|
||||
import DockerProxyDialog from '@/components/docker-proxy/dialog.vue';
|
||||
import { loadDockerStatus } from '@/api/modules/container';
|
||||
|
||||
const globalStore = GlobalStore();
|
||||
const emit = defineEmits<{ (e: 'search'): void }>();
|
||||
|
|
@ -105,6 +106,7 @@ const form = reactive({
|
|||
proxyPasswdKeepItem: false,
|
||||
proxyDocker: false,
|
||||
});
|
||||
const dockerStatus = ref();
|
||||
const withDockerRestart = ref(false);
|
||||
const dockerProxyRef = ref();
|
||||
|
||||
|
|
@ -135,6 +137,12 @@ const acceptParams = (params: DialogProps): void => {
|
|||
proxyDockerVisible.value = params.proxyDocker !== '';
|
||||
proxyVisible.value = true;
|
||||
form.proxyPasswdKeepItem = params.passwdKeep === 'Enable';
|
||||
loadDocker();
|
||||
};
|
||||
|
||||
const loadDocker = async () => {
|
||||
const res = await loadDockerStatus();
|
||||
dockerStatus.value = res.data.isExist;
|
||||
};
|
||||
|
||||
const submitChangePassword = async (formEl: FormInstance | undefined) => {
|
||||
|
|
@ -158,7 +166,7 @@ const submitChangePassword = async (formEl: FormInstance | undefined) => {
|
|||
if (form.proxyType === 'http' || form.proxyType === 'https') {
|
||||
params.proxyUrl = form.proxyUrl;
|
||||
}
|
||||
if (isMasterProductPro.value && (params.proxyDocker || proxyDockerVisible.value)) {
|
||||
if (dockerStatus.value && isMasterProductPro.value && (params.proxyDocker || proxyDockerVisible.value)) {
|
||||
dockerProxyRef.value.acceptParams({
|
||||
syncList: 'SyncSystemProxy',
|
||||
open: true,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue