mirror of https://github.com/1Panel-dev/1Panel
fix: 解决数据库切换导致的错乱样式问题 (#2259)
parent
d1d0ca92ca
commit
49d217e990
|
@ -576,11 +576,13 @@ var AddDatabases = &gormigrate.Migration{
|
||||||
_ = tx.Where("name = ?", mysqlInfo.Name).First(&mysqlDb).Error
|
_ = tx.Where("name = ?", mysqlInfo.Name).First(&mysqlDb).Error
|
||||||
if mysqlDb.ID == 0 {
|
if mysqlDb.ID == 0 {
|
||||||
if err := tx.Create(&model.Database{
|
if err := tx.Create(&model.Database{
|
||||||
Name: mysqlDb.Name,
|
AppInstallID: mysqlInfo.ID,
|
||||||
|
Name: mysqlInfo.Name,
|
||||||
Type: "mysql",
|
Type: "mysql",
|
||||||
Version: mysqlInfo.Version,
|
Version: mysqlInfo.Version,
|
||||||
From: "local",
|
From: "local",
|
||||||
Address: mysqlInfo.ServiceName,
|
Address: mysqlInfo.ServiceName,
|
||||||
|
Port: uint(mysqlInfo.Port),
|
||||||
Username: "root",
|
Username: "root",
|
||||||
Password: mysqlInfo.Password,
|
Password: mysqlInfo.Password,
|
||||||
}).Error; err != nil {
|
}).Error; err != nil {
|
||||||
|
|
|
@ -164,7 +164,7 @@
|
||||||
</template>
|
</template>
|
||||||
</LayoutContent>
|
</LayoutContent>
|
||||||
|
|
||||||
<div v-if="!currentDB">
|
<div v-if="!currentDB?.id">
|
||||||
<LayoutContent :title="'MySQL ' + $t('menu.database')" :divider="true">
|
<LayoutContent :title="'MySQL ' + $t('menu.database')" :divider="true">
|
||||||
<template #main>
|
<template #main>
|
||||||
<div class="app-warn">
|
<div class="app-warn">
|
||||||
|
|
Loading…
Reference in New Issue