Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 优化数据库切换效果 #6757

Merged
merged 1 commit into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 5 additions & 16 deletions frontend/src/components/app-status/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@
<script lang="ts" setup>
import { CheckAppInstalled, InstalledOp } from '@/api/modules/app';
import router from '@/routers';
import { onMounted, reactive, ref, watch } from 'vue';
import { onMounted, reactive, ref } from 'vue';
import Status from '@/components/status/index.vue';
import { ElMessageBox } from 'element-plus';
import i18n from '@/lang';
Expand All @@ -125,21 +125,6 @@ const props = defineProps({
},
});

watch(
() => props.appKey,
(val) => {
key.value = val;
onCheck();
},
);
watch(
() => props.appName,
(val) => {
name.value = val;
onCheck();
},
);

let key = ref('');
let name = ref('');

Expand Down Expand Up @@ -250,4 +235,8 @@ onMounted(() => {
name.value = props.appName;
onCheck();
});

defineExpose({
onCheck,
});
</script>
4 changes: 4 additions & 0 deletions frontend/src/views/database/mysql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
v-model:mask-show="maskShow"
@setting="onSetting"
@is-exist="checkExist"
ref="appStatusRef"
></AppStatus>
</template>

Expand Down Expand Up @@ -327,6 +328,8 @@ const dashboardName = ref();
const dashboardKey = ref();
const dashboardVisible = ref(false);

const appStatusRef = ref();

const dialogPortJumpRef = ref();

const data = ref();
Expand Down Expand Up @@ -384,6 +387,7 @@ const onSetting = async () => {
};

const changeDatabase = async () => {
appStatusRef.value.onCheck();
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/database/postgresql/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
v-model:mask-show="maskShow"
@setting="onSetting"
@is-exist="checkExist"
ref="appStatusRef"
></AppStatus>
</template>

Expand Down Expand Up @@ -305,6 +306,7 @@ const postgresqlContainer = ref();
const postgresqlStatus = ref();
const postgresqlVersion = ref();

const appStatusRef = ref();
const dialogRef = ref();
const onOpenDialog = async () => {
let params = {
Expand Down Expand Up @@ -348,6 +350,7 @@ const onSetting = async () => {
};

const changeDatabase = async () => {
appStatusRef.value.onCheck();
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/views/database/redis/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
@before="onBefore"
@after="onAfter"
@setting="onSetting"
ref="appStatusRef"
></AppStatus>
</template>
<template #search v-if="!isOnSetting && currentDB">
Expand Down Expand Up @@ -164,6 +165,7 @@ const redisIsExist = ref(false);
const redisStatus = ref();
const terminalShow = ref(false);

const appStatusRef = ref();
const commandVisible = ref(false);

const redisCliExist = ref();
Expand Down Expand Up @@ -220,6 +222,7 @@ const goRouter = async (target: string) => {
};

const changeDatabase = async () => {
appStatusRef.value.onCheck();
for (const item of dbOptionsLocal.value) {
if (item.database == currentDBName.value) {
currentDB.value = item;
Expand Down
Loading