1
0
mirror of https://github.com/1Panel-dev/1Panel.git synced 2025-01-31 14:08:06 +08:00

fix: 切换菜单设置接口 (#4429)

This commit is contained in:
ssongliu 2024-04-08 17:48:08 +08:00 committed by GitHub
parent 7c928735cd
commit 7ab005540b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View File

@ -95,15 +95,15 @@ func (b *BaseApi) LoadMonitor(c *gin.Context) {
// @Router /hosts/monitor/clean [post]
// @x-panel-log {"bodyKeys":[],"paramKeys":[],"BeforeFunctions":[],"formatZH":"清空监控数据","formatEN":"clean monitor datas"}
func (b *BaseApi) CleanMonitor(c *gin.Context) {
if err := global.DB.Exec("DELETE FROM monitor_bases").Error; err != nil {
if err := global.MonitorDB.Exec("DELETE FROM monitor_bases").Error; err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
if err := global.DB.Exec("DELETE FROM monitor_ios").Error; err != nil {
if err := global.MonitorDB.Exec("DELETE FROM monitor_ios").Error; err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}
if err := global.DB.Exec("DELETE FROM monitor_networks").Error; err != nil {
if err := global.MonitorDB.Exec("DELETE FROM monitor_networks").Error; err != nil {
helper.ErrorWithDetail(c, constant.CodeErrInternalServer, constant.ErrTypeInternalServer, err)
return
}

View File

@ -39,9 +39,9 @@
<script setup lang="ts">
import { reactive, ref } from 'vue';
import DrawerHeader from '@/components/drawer-header/index.vue';
import { DialogProps, ElMessageBox } from 'element-plus';
import { ElMessageBox } from 'element-plus';
import i18n from '@/lang';
import { updateSetting } from '@/api/modules/setting';
import { updateMenu } from '@/api/modules/setting';
import { MsgSuccess } from '@/utils/message';
const drawerVisible = ref();
@ -131,7 +131,7 @@ const saveHideMenus = async () => {
type: 'info',
}).then(async () => {
const updateJson = JSON.stringify(treeData.hideMenu[0]);
await updateSetting({ key: 'XpackHideMenu', value: updateJson })
await updateMenu({ key: 'XpackHideMenu', value: updateJson })
.then(async () => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
loading.value = false;