1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 优化容器菜单页面状态加载样式 (#356)

This commit is contained in:
ssongliu 2023-03-22 15:32:29 +08:00 committed by GitHub
parent fa983bdcc9
commit 39e3e8f214
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 145 additions and 117 deletions

View File

@ -179,9 +179,12 @@
top: 220px; top: 220px;
left: 45%; left: 45%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
width: 300px; width: 400px;
text-align: center; text-align: center;
font-size: 14px; font-size: 14px;
.bt {
margin-top: -2px;
}
} }
.table-button { .table-button {

View File

@ -3,20 +3,13 @@
<div v-show="isOnDetail"> <div v-show="isOnDetail">
<ComposeDetial @back="backList" ref="composeDetailRef" /> <ComposeDetial @back="backList" ref="composeDetailRef" />
</div> </div>
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" link class="bt" @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent <LayoutContent v-if="!isOnDetail" :title="$t('container.compose')" :class="{ mask: dockerStatus != 'Running' }">
v-loading="loading"
v-if="!isOnDetail"
:title="$t('container.compose')"
:class="{ mask: dockerStatus != 'Running' }"
>
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -111,13 +104,21 @@ const paginationConfig = reactive({
}); });
const searchName = ref(); const searchName = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
} dockerStatus.value = res.data;
if (dockerStatus.value === 'Running') {
search();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -1,17 +1,11 @@
<template> <template>
<div> <div v-loading="loading">
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" class="bt" link @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent <LayoutContent :title="$t('container.container')" :class="{ mask: dockerStatus != 'Running' }">
v-loading="loading"
:title="$t('container.container')"
:class="{ mask: dockerStatus != 'Running' }"
>
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -141,13 +135,21 @@ const paginationConfig = reactive({
}); });
const searchName = ref(); const searchName = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
} dockerStatus.value = res.data;
if (dockerStatus.value === 'Running') {
search();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -1,14 +1,12 @@
<template> <template>
<div v-loading="loading"> <div v-loading="loading">
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" link class="bt" @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent v-loading="loading" :title="$t('container.image')" :class="{ mask: dockerStatus != 'Running' }"> <LayoutContent :title="$t('container.image')" :class="{ mask: dockerStatus != 'Running' }">
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -110,14 +108,22 @@ const paginationConfig = reactive({
}); });
const searchName = ref(); const searchName = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
loadRepos(); dockerStatus.value = res.data;
} if (dockerStatus.value === 'Running') {
search();
loadRepos();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -1,18 +1,12 @@
<template> <template>
<div> <div v-loading="loading">
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" link class="bt" @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent <LayoutContent :title="$t('container.network')" :class="{ mask: dockerStatus != 'Running' }">
v-loading="loading"
:title="$t('container.network')"
:class="{ mask: dockerStatus != 'Running' }"
>
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -124,13 +118,21 @@ const paginationConfig = reactive({
}); });
const searchName = ref(); const searchName = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
} dockerStatus.value = res.data;
if (dockerStatus.value === 'Running') {
search();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -1,14 +1,12 @@
<template> <template>
<div> <div v-loading="loading">
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" link class="bt" @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent v-loading="loading" :title="$t('container.repo')" :class="{ mask: dockerStatus != 'Running' }"> <LayoutContent :title="$t('container.repo')" :class="{ mask: dockerStatus != 'Running' }">
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -99,13 +97,21 @@ const paginationConfig = reactive({
}); });
const searchName = ref(); const searchName = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
} dockerStatus.value = res.data;
if (dockerStatus.value === 'Running') {
search();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -1,18 +1,12 @@
<template> <template>
<div> <div v-loading="loading">
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" link class="bt" @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent <LayoutContent :title="$t('container.composeTemplate')" :class="{ mask: dockerStatus != 'Running' }">
v-loading="loading"
:title="$t('container.composeTemplate')"
:class="{ mask: dockerStatus != 'Running' }"
>
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -96,13 +90,21 @@ const searchName = ref();
const detailRef = ref(); const detailRef = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
} dockerStatus.value = res.data;
if (dockerStatus.value === 'Running') {
search();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -1,14 +1,12 @@
<template> <template>
<div> <div v-loading="loading">
<el-card width="30%" v-if="dockerStatus != 'Running'" class="mask-prompt"> <el-card v-if="dockerStatus != 'Running'" class="mask-prompt">
<span style="font-size: 14px">{{ $t('container.serviceUnavailable') }}</span> <span>{{ $t('container.serviceUnavailable') }}</span>
<el-button type="primary" link style="font-size: 14px; margin-bottom: 5px" @click="goSetting"> <el-button type="primary" link class="bt" @click="goSetting"> {{ $t('container.setting') }} </el-button>
{{ $t('container.setting') }} <span>{{ $t('container.startIn') }}</span>
</el-button>
<span style="font-size: 14px">{{ $t('container.startIn') }}</span>
</el-card> </el-card>
<LayoutContent v-loading="loading" :title="$t('container.volume')" :class="{ mask: dockerStatus != 'Running' }"> <LayoutContent :title="$t('container.volume')" :class="{ mask: dockerStatus != 'Running' }">
<template #toolbar> <template #toolbar>
<el-row> <el-row>
<el-col :span="16"> <el-col :span="16">
@ -104,13 +102,21 @@ const paginationConfig = reactive({
}); });
const searchName = ref(); const searchName = ref();
const dockerStatus = ref(); const dockerStatus = ref('Running');
const loadStatus = async () => { const loadStatus = async () => {
const res = await loadDockerStatus(); loading.value = true;
dockerStatus.value = res.data; await loadDockerStatus()
if (dockerStatus.value === 'Running') { .then((res) => {
search(); loading.value = false;
} dockerStatus.value = res.data;
if (dockerStatus.value === 'Running') {
search();
}
})
.catch(() => {
dockerStatus.value = 'Failed';
loading.value = false;
});
}; };
const goSetting = async () => { const goSetting = async () => {
router.push({ name: 'ContainerSetting' }); router.push({ name: 'ContainerSetting' });

View File

@ -112,7 +112,7 @@
v-if="mysqlStatus != 'Running' && !isOnSetting && mysqlIsExist && !loading" v-if="mysqlStatus != 'Running' && !isOnSetting && mysqlIsExist && !loading"
class="mask-prompt" class="mask-prompt"
> >
<span style="font-size: 14px">{{ $t('commons.service.serviceNotStarted', ['MySQL']) }}</span> <span>{{ $t('commons.service.serviceNotStarted', ['MySQL']) }}</span>
</el-card> </el-card>
<Setting ref="settingRef" style="margin-top: 20px" /> <Setting ref="settingRef" style="margin-top: 20px" />

View File

@ -24,7 +24,7 @@
</LayoutContent> </LayoutContent>
<el-card width="30%" v-if="redisStatus != 'Running' && !isOnSetting && redisIsExist" class="mask-prompt"> <el-card width="30%" v-if="redisStatus != 'Running' && !isOnSetting && redisIsExist" class="mask-prompt">
<span style="font-size: 14px">{{ $t('commons.service.serviceNotStarted', ['Redis']) }}</span> <span>{{ $t('commons.service.serviceNotStarted', ['Redis']) }}</span>
</el-card> </el-card>
<Setting ref="settingRef" style="margin-top: 30px" /> <Setting ref="settingRef" style="margin-top: 30px" />