feat: OpenResty 卸载不删除网站 (#6297)

Refs https://github.com/1Panel-dev/1Panel/issues/5726
This commit is contained in:
zhengkunwang
2024-08-29 10:39:25 +00:00
committed by GitHub
parent bc8a2511d1
commit c492796cf8
8 changed files with 168 additions and 217 deletions
@@ -91,29 +91,10 @@
</div>
</el-card>
</div>
<div v-if="!data.isExist && !isDB()">
<LayoutContent :title="getTitle(key)" :divider="true">
<template #main>
<div class="app-warn">
<div class="flx-center">
<span>{{ $t('app.checkInstalledWarn', [data.app]) }}</span>
<span @click="goRouter(key)" class="flx-align-center">
<el-icon class="ml-2"><Position /></el-icon>
{{ $t('database.goInstall') }}
</span>
</div>
<div>
<img src="@/assets/images/no_app.svg" />
</div>
</div>
</template>
</LayoutContent>
</div>
</div>
</template>
<script lang="ts" setup>
import { CheckAppInstalled, InstalledOp } from '@/api/modules/app';
import router from '@/routers';
import { onMounted, reactive, ref, watch } from 'vue';
import Status from '@/components/status/index.vue';
import { ElMessageBox } from 'element-plus';
@@ -172,14 +153,6 @@ const setting = () => {
em('setting', false);
};
const goRouter = async (key: string) => {
router.push({ name: 'AppAll', query: { install: key } });
};
const isDB = () => {
return key.value === 'mysql' || key.value === 'mariadb' || key.value === 'postgresql';
};
const onCheck = async () => {
await CheckAppInstalled(key.value, name.value)
.then((res) => {
@@ -239,19 +212,6 @@ const onOperate = async (operation: string) => {
});
};
const getTitle = (key: string) => {
switch (key) {
case 'openresty':
return i18n.global.t('website.website');
case 'mysql':
return 'MySQL ' + i18n.global.t('menu.database');
case 'postgresql':
return 'PostgreSQL ' + i18n.global.t('menu.database');
case 'redis':
return 'Redis ' + i18n.global.t('menu.database');
}
};
onMounted(() => {
key.value = props.appKey;
name.value = props.appName;