feat: 修改APP状态页

This commit is contained in:
zhengkunwang223 2023-02-03 13:59:17 +08:00 committed by zhengkunwang223
parent 8c599d7b75
commit 5ed3df14ec
6 changed files with 79 additions and 30 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 15 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@ -32,14 +32,22 @@
</el-card> </el-card>
</div> </div>
<div v-else> <div v-else>
<div class="app-warn"> <LayoutContent :title="getTitle(key)" :divider="true">
<div> <template #main>
<span>{{ $t('app.checkInstalledWarn', [data.app]) }}</span> <div class="app-warn">
</div> <div>
<el-link icon="Position" @click="goRouter('/apps')" type="primary"> <span>{{ $t('app.checkInstalledWarn', [data.app]) }}</span>
{{ $t('database.goInstall') }} <span @click="goRouter('/apps')">
</el-link> <el-icon><Position /></el-icon>
</div> {{ $t('database.goInstall') }}
</span>
<div>
<img src="@/assets/images/no_app.svg" />
</div>
</div>
</div>
</template>
</LayoutContent>
</div> </div>
</div> </div>
</template> </template>
@ -50,6 +58,7 @@ import { onMounted, reactive, ref } from 'vue';
import Status from '@/components/status/index.vue'; import Status from '@/components/status/index.vue';
import { ElMessage, ElMessageBox } from 'element-plus'; import { ElMessage, ElMessageBox } from 'element-plus';
import i18n from '@/lang'; import i18n from '@/lang';
import LayoutContent from '@/layout/layout-content.vue';
const props = defineProps({ const props = defineProps({
appKey: { appKey: {
@ -116,6 +125,17 @@ const onOperate = async (operation: string) => {
}); });
}; };
const getTitle = (key: string) => {
switch (key) {
case 'nginx':
return i18n.global.t('website.website');
case 'mysql':
return 'Mysql ' + i18n.global.t('menu.database');
case 'redis':
return 'Redis ' + i18n.global.t('menu.database');
}
};
onMounted(() => { onMounted(() => {
key.value = props.appKey; key.value = props.appKey;
onCheck(); onCheck();
@ -145,11 +165,25 @@ onMounted(() => {
.app-warn { .app-warn {
text-align: center; text-align: center;
margin-top: 200px; margin-top: 100px;
span { span:first-child {
font-weight: 500; // font-weight: 500;
font-size: 16px; // font-size: 16px;
color: #bbbfc4; color: #bbbfc4;
} }
span:nth-child(2) {
color: $primary-color;
cursor: pointer;
}
span:nth-child(2):hover {
color: #74a4f3;
}
img {
width: 300px;
height: 300px;
}
} }
</style> </style>

View File

@ -252,7 +252,7 @@ export default {
noMysql: '当前未检测到 {0} 数据库请进入应用商店点击安装', noMysql: '当前未检测到 {0} 数据库请进入应用商店点击安装',
mysqlBadStatus: '当前 mysql 应用状态异常请在', mysqlBadStatus: '当前 mysql 应用状态异常请在',
adjust: '中查看原因或修改配置', adjust: '中查看原因或修改配置',
goInstall: '安装', goInstall: '应用商店安装',
source: '来源', source: '来源',
backup: '备份', backup: '备份',
permission: '权限', permission: '权限',

View File

@ -76,9 +76,14 @@
.update-prompt { .update-prompt {
text-align: center; text-align: center;
margin-top: 100px;
span { span {
font-weight: 500;
font-size: 16px;
color: #bbbfc4; color: #bbbfc4;
} }
img {
width: 300px;
height: 300px;
}
} }

View File

@ -3,20 +3,25 @@
<template #toolbar> <template #toolbar>
<el-row :gutter="5"> <el-row :gutter="5">
<el-col :span="20"> <el-col :span="20">
<div> <el-button
<el-button @click="changeTag('all')" type="primary" :plain="activeTag !== 'all'"> class="tag-button"
{{ $t('app.all') }} :class="activeTag === 'all' ? '' : 'no-active'"
@click="changeTag('all')"
:type="activeTag === 'all' ? 'primary' : ''"
:plain="activeTag !== 'all'"
>
{{ $t('app.all') }}
</el-button>
<div v-for="item in tags" :key="item.key" style="display: inline">
<el-button
class="tag-button"
:class="activeTag === item.key ? '' : 'no-active'"
@click="changeTag(item.key)"
:type="activeTag === item.key ? 'primary' : ''"
:plain="activeTag !== item.key"
>
{{ item.name }}
</el-button> </el-button>
<div v-for="item in tags" :key="item.key" style="display: inline">
<el-button
class="tag-button"
@click="changeTag(item.key)"
type="primary"
:plain="activeTag !== item.key"
>
{{ item.name }}
</el-button>
</div>
</div> </div>
</el-col> </el-col>
<el-col :span="4"> <el-col :span="4">
@ -39,8 +44,11 @@
<el-button @click="sync" type="primary" link v-if="mode === 'installed'">{{ $t('app.sync') }}</el-button> <el-button @click="sync" type="primary" link v-if="mode === 'installed'">{{ $t('app.sync') }}</el-button>
</template> </template>
<template #main> <template #main>
<div class="update-prompt"> <div class="update-prompt" v-if="mode === 'update'">
<span v-if="mode === 'update'">{{ $t('app.updatePrompt') }}</span> <span>{{ $t('app.updatePrompt') }}</span>
<div>
<img src="@/assets/images/no_update_app.svg" />
</div>
</div> </div>
<el-row :gutter="5"> <el-row :gutter="5">
<el-col v-for="(installed, index) in data" :key="index" :span="12"> <el-col v-for="(installed, index) in data" :key="index" :span="12">