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