fix: 解决数据库切换导致的错乱样式问题 (#2259)

pull/2264/head
ssongliu 2023-09-12 10:54:10 +08:00 committed by GitHub
parent d1d0ca92ca
commit 49d217e990
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 8 deletions

View File

@ -576,13 +576,15 @@ var AddDatabases = &gormigrate.Migration{
_ = tx.Where("name = ?", mysqlInfo.Name).First(&mysqlDb).Error
if mysqlDb.ID == 0 {
if err := tx.Create(&model.Database{
Name: mysqlDb.Name,
Type: "mysql",
Version: mysqlInfo.Version,
From: "local",
Address: mysqlInfo.ServiceName,
Username: "root",
Password: mysqlInfo.Password,
AppInstallID: mysqlInfo.ID,
Name: mysqlInfo.Name,
Type: "mysql",
Version: mysqlInfo.Version,
From: "local",
Address: mysqlInfo.ServiceName,
Port: uint(mysqlInfo.Port),
Username: "root",
Password: mysqlInfo.Password,
}).Error; err != nil {
return err
}

View File

@ -164,7 +164,7 @@
</template>
</LayoutContent>
<div v-if="!currentDB">
<div v-if="!currentDB?.id">
<LayoutContent :title="'MySQL ' + $t('menu.database')" :divider="true">
<template #main>
<div class="app-warn">