fix: Fix the problem of abnormal menu display and hide switching (#8503)

This commit is contained in:
ssongliu 2025-04-28 18:47:52 +08:00 committed by GitHub
parent 48dc8dcebf
commit 3f9eaecf37
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 85 additions and 53 deletions

View file

@ -9,7 +9,7 @@ import (
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
) )
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Create postgresql database // @Summary Create postgresql database
// @Accept json // @Accept json
// @Param request body dto.PostgresqlDBCreate true "request" // @Param request body dto.PostgresqlDBCreate true "request"
@ -40,7 +40,7 @@ func (b *BaseApi) CreatePostgresql(c *gin.Context) {
helper.Success(c) helper.Success(c)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Bind postgresql user // @Summary Bind postgresql user
// @Accept json // @Accept json
// @Param request body dto.PostgresqlBindUser true "request" // @Param request body dto.PostgresqlBindUser true "request"
@ -62,7 +62,7 @@ func (b *BaseApi) BindPostgresqlUser(c *gin.Context) {
helper.Success(c) helper.Success(c)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Update postgresql database description // @Summary Update postgresql database description
// @Accept json // @Accept json
// @Param request body dto.UpdateDescription true "request" // @Param request body dto.UpdateDescription true "request"
@ -84,7 +84,7 @@ func (b *BaseApi) UpdatePostgresqlDescription(c *gin.Context) {
helper.Success(c) helper.Success(c)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Change postgresql privileges // @Summary Change postgresql privileges
// @Accept json // @Accept json
// @Param request body dto.ChangeDBInfo true "request" // @Param request body dto.ChangeDBInfo true "request"
@ -106,7 +106,7 @@ func (b *BaseApi) ChangePostgresqlPrivileges(c *gin.Context) {
helper.Success(c) helper.Success(c)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Change postgresql password // @Summary Change postgresql password
// @Accept json // @Accept json
// @Param request body dto.ChangeDBInfo true "request" // @Param request body dto.ChangeDBInfo true "request"
@ -137,7 +137,7 @@ func (b *BaseApi) ChangePostgresqlPassword(c *gin.Context) {
helper.Success(c) helper.Success(c)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Page postgresql databases // @Summary Page postgresql databases
// @Accept json // @Accept json
// @Param request body dto.PostgresqlDBSearch true "request" // @Param request body dto.PostgresqlDBSearch true "request"
@ -163,7 +163,7 @@ func (b *BaseApi) SearchPostgresql(c *gin.Context) {
}) })
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Load postgresql database from remote // @Summary Load postgresql database from remote
// @Accept json // @Accept json
// @Param request body dto.PostgresqlLoadDB true "request" // @Param request body dto.PostgresqlLoadDB true "request"
@ -185,7 +185,7 @@ func (b *BaseApi) LoadPostgresqlDBFromRemote(c *gin.Context) {
helper.Success(c) helper.Success(c)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Check before delete postgresql database // @Summary Check before delete postgresql database
// @Accept json // @Accept json
// @Param request body dto.PostgresqlDBDeleteCheck true "request" // @Param request body dto.PostgresqlDBDeleteCheck true "request"
@ -207,7 +207,7 @@ func (b *BaseApi) DeleteCheckPostgresql(c *gin.Context) {
helper.SuccessWithData(c, apps) helper.SuccessWithData(c, apps)
} }
// @Tags Database Postgresql // @Tags Database PostgreSQL
// @Summary Delete postgresql database // @Summary Delete postgresql database
// @Accept json // @Accept json
// @Param request body dto.PostgresqlDBDelete true "request" // @Param request body dto.PostgresqlDBDelete true "request"

View file

@ -3,6 +3,7 @@ package dto
type SettingInfo struct { type SettingInfo struct {
DockerSockPath string `json:"dockerSockPath"` DockerSockPath string `json:"dockerSockPath"`
SystemVersion string `json:"systemVersion"` SystemVersion string `json:"systemVersion"`
SystemIP string `json:"systemIP"`
LocalTime string `json:"localTime"` LocalTime string `json:"localTime"`
TimeZone string `json:"timeZone"` TimeZone string `json:"timeZone"`

View file

@ -194,10 +194,10 @@ func (r *Remote) Recover(info RecoverInfo) error {
} }
if err != nil { if err != nil {
all, _ := io.ReadAll(stderrPipe) all, _ := io.ReadAll(stderrPipe)
global.LOG.Errorf("[Postgresql] DB:[%s] Recover Error: %s", info.Name, string(all)) global.LOG.Errorf("[PostgreSQL] DB:[%s] Recover Error: %s", info.Name, string(all))
return err return err
} }
global.LOG.Infof("[Postgresql] DB:[%s] Restoring: %s", info.Name, readString) global.LOG.Infof("[PostgreSQL] DB:[%s] Restoring: %s", info.Name, readString)
} }
return nil return nil

View file

@ -8479,7 +8479,7 @@ const docTemplate = `{
], ],
"summary": "Create postgresql database", "summary": "Create postgresql database",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [], "BeforeFunctions": [],
@ -8519,7 +8519,7 @@ const docTemplate = `{
], ],
"summary": "Load postgresql database from remote", "summary": "Load postgresql database from remote",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
] ]
} }
}, },
@ -8554,7 +8554,7 @@ const docTemplate = `{
], ],
"summary": "Bind postgresql user", "summary": "Bind postgresql user",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [], "BeforeFunctions": [],
@ -8599,7 +8599,7 @@ const docTemplate = `{
], ],
"summary": "Delete postgresql database", "summary": "Delete postgresql database",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [ "BeforeFunctions": [
@ -8658,7 +8658,7 @@ const docTemplate = `{
], ],
"summary": "Check before delete postgresql database", "summary": "Check before delete postgresql database",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
] ]
} }
}, },
@ -8693,7 +8693,7 @@ const docTemplate = `{
], ],
"summary": "Update postgresql database description", "summary": "Update postgresql database description",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [ "BeforeFunctions": [
@ -8747,7 +8747,7 @@ const docTemplate = `{
], ],
"summary": "Change postgresql password", "summary": "Change postgresql password",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [ "BeforeFunctions": [
@ -8800,7 +8800,7 @@ const docTemplate = `{
], ],
"summary": "Change postgresql privileges", "summary": "Change postgresql privileges",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [], "BeforeFunctions": [],
@ -8848,7 +8848,7 @@ const docTemplate = `{
], ],
"summary": "Page postgresql databases", "summary": "Page postgresql databases",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
] ]
} }
}, },

View file

@ -8475,7 +8475,7 @@
], ],
"summary": "Create postgresql database", "summary": "Create postgresql database",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [], "BeforeFunctions": [],
@ -8515,7 +8515,7 @@
], ],
"summary": "Load postgresql database from remote", "summary": "Load postgresql database from remote",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
] ]
} }
}, },
@ -8550,7 +8550,7 @@
], ],
"summary": "Bind postgresql user", "summary": "Bind postgresql user",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [], "BeforeFunctions": [],
@ -8595,7 +8595,7 @@
], ],
"summary": "Delete postgresql database", "summary": "Delete postgresql database",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [ "BeforeFunctions": [
@ -8654,7 +8654,7 @@
], ],
"summary": "Check before delete postgresql database", "summary": "Check before delete postgresql database",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
] ]
} }
}, },
@ -8689,7 +8689,7 @@
], ],
"summary": "Update postgresql database description", "summary": "Update postgresql database description",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [ "BeforeFunctions": [
@ -8743,7 +8743,7 @@
], ],
"summary": "Change postgresql password", "summary": "Change postgresql password",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [ "BeforeFunctions": [
@ -8796,7 +8796,7 @@
], ],
"summary": "Change postgresql privileges", "summary": "Change postgresql privileges",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
], ],
"x-panel-log": { "x-panel-log": {
"BeforeFunctions": [], "BeforeFunctions": [],
@ -8844,7 +8844,7 @@
], ],
"summary": "Page postgresql databases", "summary": "Page postgresql databases",
"tags": [ "tags": [
"Database Postgresql" "Database PostgreSQL"
] ]
} }
}, },

View file

@ -433,7 +433,7 @@ const message = {
deleteHelper: '" to delete this database', deleteHelper: '" to delete this database',
create: 'Create', create: 'Create',
noMysql: 'Database service (MySQL or MariaDB)', noMysql: 'Database service (MySQL or MariaDB)',
noPostgresql: 'Database service Postgresql', noPostgresql: 'Database service PostgreSQL',
goUpgrade: 'Go for upgrade', goUpgrade: 'Go for upgrade',
goInstall: 'Go for install', goInstall: 'Go for install',
isDelete: 'Deleted', isDelete: 'Deleted',
@ -1535,7 +1535,8 @@ const message = {
sessionTimeoutError: 'The minimum timeout is 300 seconds', sessionTimeoutError: 'The minimum timeout is 300 seconds',
sessionTimeoutHelper: sessionTimeoutHelper:
'If you do not operate the panel for more than {0} seconds, the panel automatically logs out', 'If you do not operate the panel for more than {0} seconds, the panel automatically logs out',
systemIP: 'System Address', systemIP: 'Default access address',
systemIPHelper: 'Default access address for application and container redirection on this node',
proxy: 'Server Proxy', proxy: 'Server Proxy',
proxyHelper: 'After setting up the proxy server, it will be effective in the following scenarios:', proxyHelper: 'After setting up the proxy server, it will be effective in the following scenarios:',
proxyHelper1: 'Downloading and synchronizing installation packages from the app store (Professional)', proxyHelper1: 'Downloading and synchronizing installation packages from the app store (Professional)',

View file

@ -1476,7 +1476,8 @@ const message = {
sessionTimeout: 'セッションタイムアウト', sessionTimeout: 'セッションタイムアウト',
sessionTimeoutError: '最小セッションタイムアウトは300秒です', sessionTimeoutError: '最小セッションタイムアウトは300秒です',
sessionTimeoutHelper: '{0}秒以上操作がない場合パネルは自動的にログアウトされます', sessionTimeoutHelper: '{0}秒以上操作がない場合パネルは自動的にログアウトされます',
systemIP: 'システムアドレス', systemIP: 'デフォルトアクセスアドレス',
systemIPHelper: 'このノード上のアプリケーションとコンテナリダイレクト用のデフォルトアクセスアドレス',
proxy: 'サーバープロキシ', proxy: 'サーバープロキシ',
proxyHelper: 'プロキシサーバーを設定した後次のシナリオで効果的になります', proxyHelper: 'プロキシサーバーを設定した後次のシナリオで効果的になります',
proxyHelper1: proxyHelper1:

View file

@ -425,7 +425,7 @@ const message = {
deleteHelper: '" 입력하세요.', deleteHelper: '" 입력하세요.',
create: '데이터베이스 생성', create: '데이터베이스 생성',
noMysql: '데이터베이스 서비스 (MySQL 또는 MariaDB)', noMysql: '데이터베이스 서비스 (MySQL 또는 MariaDB)',
noPostgresql: '데이터베이스 서비스 Postgresql', noPostgresql: '데이터베이스 서비스 PostgreSQL',
goUpgrade: '업그레이드로 이동', goUpgrade: '업그레이드로 이동',
goInstall: '설치로 이동', goInstall: '설치로 이동',
isDelete: '삭제됨', isDelete: '삭제됨',
@ -1460,7 +1460,8 @@ const message = {
sessionTimeout: '세션 타임아웃', sessionTimeout: '세션 타임아웃',
sessionTimeoutError: '최소 세션 타임아웃은 300초입니다.', sessionTimeoutError: '최소 세션 타임아웃은 300초입니다.',
sessionTimeoutHelper: '패널에서 {0} 이상 조작이 없을 경우 자동으로 로그아웃됩니다.', sessionTimeoutHelper: '패널에서 {0} 이상 조작이 없을 경우 자동으로 로그아웃됩니다.',
systemIP: '시스템 주소', systemIP: '기본 접근 주소',
systemIPHelper: ' 노드에서 애플리케이션 컨테이너 전환을 위한 기본 접근 주소',
proxy: '서버 프록시', proxy: '서버 프록시',
proxyHelper: '프록시 서버를 설정한 다음 시나리오에서 적용됩니다:', proxyHelper: '프록시 서버를 설정한 다음 시나리오에서 적용됩니다:',
proxyHelper1: '설치 패키지 다운로드 스토어 동기화 (전문 버전에서만 제공)', proxyHelper1: '설치 패키지 다운로드 스토어 동기화 (전문 버전에서만 제공)',

View file

@ -431,7 +431,7 @@ const message = {
deleteHelper: '" untuk memadam pangkalan data ini', deleteHelper: '" untuk memadam pangkalan data ini',
create: 'Cipta pangkalan data', create: 'Cipta pangkalan data',
noMysql: 'Perkhidmatan pangkalan data (MySQL atau MariaDB)', noMysql: 'Perkhidmatan pangkalan data (MySQL atau MariaDB)',
noPostgresql: 'Perkhidmatan pangkalan data Postgresql', noPostgresql: 'Perkhidmatan pangkalan data PostgreSQL',
goUpgrade: 'Pergi tingkatkan', goUpgrade: 'Pergi tingkatkan',
goInstall: 'Pergi pasang', goInstall: 'Pergi pasang',
isDelete: 'Dihapuskan', isDelete: 'Dihapuskan',
@ -1521,7 +1521,8 @@ const message = {
sessionTimeout: 'Tempoh tamat sesi', sessionTimeout: 'Tempoh tamat sesi',
sessionTimeoutError: 'Tempoh tamat sesi minimum ialah 300 saat', sessionTimeoutError: 'Tempoh tamat sesi minimum ialah 300 saat',
sessionTimeoutHelper: 'Panel akan log keluar secara automatik jika tiada operasi lebih daripada {0} saat.', sessionTimeoutHelper: 'Panel akan log keluar secara automatik jika tiada operasi lebih daripada {0} saat.',
systemIP: 'Alamat sistem', systemIP: 'Alamat akses lalai',
systemIPHelper: 'Alamat akses lalai untuk aplikasi dan penghantaran semula kontena pada nod ini',
proxy: 'Proksi pelayan', proxy: 'Proksi pelayan',
proxyHelper: 'Ia akan berkuat kuasa dalam senario berikut selepas anda menyediakan pelayan proksi:', proxyHelper: 'Ia akan berkuat kuasa dalam senario berikut selepas anda menyediakan pelayan proksi:',
proxyHelper1: 'Muat turun pakej pemasangan dan penyelarasan dari kedai aplikasi (Edisi Profesional sahaja)', proxyHelper1: 'Muat turun pakej pemasangan dan penyelarasan dari kedai aplikasi (Edisi Profesional sahaja)',

View file

@ -429,7 +429,7 @@ const message = {
deleteHelper: '" para excluir este banco de dados', deleteHelper: '" para excluir este banco de dados',
create: 'Criar banco de dados', create: 'Criar banco de dados',
noMysql: 'Serviço de banco de dados (MySQL ou MariaDB)', noMysql: 'Serviço de banco de dados (MySQL ou MariaDB)',
noPostgresql: 'Serviço de banco de dados Postgresql', noPostgresql: 'Serviço de banco de dados PostgreSQL',
goUpgrade: 'Ir para atualização', goUpgrade: 'Ir para atualização',
goInstall: 'Ir para instalação', goInstall: 'Ir para instalação',
isDelete: 'Excluído', isDelete: 'Excluído',
@ -1506,7 +1506,8 @@ const message = {
sessionTimeout: 'Tempo limite de sessão', sessionTimeout: 'Tempo limite de sessão',
sessionTimeoutError: 'O tempo mínimo de sessão é de 300 segundos', sessionTimeoutError: 'O tempo mínimo de sessão é de 300 segundos',
sessionTimeoutHelper: 'O painel será desconectado automaticamente após {0} segundo(s) de inatividade.', sessionTimeoutHelper: 'O painel será desconectado automaticamente após {0} segundo(s) de inatividade.',
systemIP: 'Endereço do sistema', systemIP: 'Endereço de acesso padrão',
systemIPHelper: 'Endereço de acesso padrão para redirecionamento de aplicativos e containers neste ',
proxy: 'Proxy do servidor', proxy: 'Proxy do servidor',
proxyHelper: 'Será eficaz nos seguintes cenários após configurar o servidor proxy:', proxyHelper: 'Será eficaz nos seguintes cenários após configurar o servidor proxy:',
proxyHelper1: proxyHelper1:

View file

@ -426,7 +426,7 @@ const message = {
deleteHelper: '" для удаления этой базы данных', deleteHelper: '" для удаления этой базы данных',
create: 'Создать базу данных', create: 'Создать базу данных',
noMysql: 'Сервис базы данных (MySQL или MariaDB)', noMysql: 'Сервис базы данных (MySQL или MariaDB)',
noPostgresql: 'Сервис базы данных Postgresql', noPostgresql: 'Сервис базы данных PostgreSQL',
goUpgrade: 'Обновить', goUpgrade: 'Обновить',
goInstall: 'Установить', goInstall: 'Установить',
isDelete: 'Удалено', isDelete: 'Удалено',
@ -1508,7 +1508,8 @@ const message = {
sessionTimeout: 'Время сессии', sessionTimeout: 'Время сессии',
sessionTimeoutError: 'Минимальное время сессии 300 секунд', sessionTimeoutError: 'Минимальное время сессии 300 секунд',
sessionTimeoutHelper: 'Панель автоматически выйдет из системы, если не будет операций более {0} секунд.', sessionTimeoutHelper: 'Панель автоматически выйдет из системы, если не будет операций более {0} секунд.',
systemIP: 'IP-адрес панели', systemIP: 'Адрес доступа по умолчанию',
systemIPHelper: 'Адрес по умолчанию для доступа к приложениям и перенаправления контейнеров на этом узле',
proxy: 'Прокси', proxy: 'Прокси',
proxyHelper: 'После настройки прокси-сервера он будет действовать в следующих сценариях:', proxyHelper: 'После настройки прокси-сервера он будет действовать в следующих сценариях:',
proxyHelper1: proxyHelper1:

View file

@ -425,7 +425,7 @@ const message = {
deleteHelper: '" 刪除此數據庫', deleteHelper: '" 刪除此數據庫',
create: '創建數據庫', create: '創建數據庫',
noMysql: '數據庫服務 (MySQL MariaDB)', noMysql: '數據庫服務 (MySQL MariaDB)',
noPostgresql: '數據庫服務 Postgresql', noPostgresql: '數據庫服務 PostgreSQL',
goUpgrade: '去應用商店升級', goUpgrade: '去應用商店升級',
goInstall: '去應用商店安裝', goInstall: '去應用商店安裝',
isDelete: '已刪除', isDelete: '已刪除',
@ -1455,7 +1455,8 @@ const message = {
sessionTimeout: '超時時間', sessionTimeout: '超時時間',
sessionTimeoutError: '最小超時時間為 300 ', sessionTimeoutError: '最小超時時間為 300 ',
sessionTimeoutHelper: '如果用戶超過 {0} 秒未操作面板面板將自動退出登錄', sessionTimeoutHelper: '如果用戶超過 {0} 秒未操作面板面板將自動退出登錄',
systemIP: '伺服器地址', systemIP: '預設存取地址',
systemIPHelper: '當前節點存取應用容器跳轉的預設存取地址',
proxy: '代理伺服器', proxy: '代理伺服器',
proxyHelper: '設置代理伺服器後將在以下場景中生效', proxyHelper: '設置代理伺服器後將在以下場景中生效',
proxyHelper1: '應用商店的安裝包下載和同步專業版功能', proxyHelper1: '應用商店的安裝包下載和同步專業版功能',

View file

@ -423,7 +423,7 @@ const message = {
deleteHelper: '" 删除此数据库', deleteHelper: '" 删除此数据库',
create: '创建数据库', create: '创建数据库',
noMysql: '数据库服务 (MySQL MariaDB)', noMysql: '数据库服务 (MySQL MariaDB)',
noPostgresql: '数据库服务 Postgresql', noPostgresql: '数据库服务 PostgreSQL',
goUpgrade: '去应用列表升级', goUpgrade: '去应用列表升级',
goInstall: '去应用商店安装', goInstall: '去应用商店安装',
isDelete: '已删除', isDelete: '已删除',
@ -1451,7 +1451,8 @@ const message = {
sessionTimeout: '超时时间', sessionTimeout: '超时时间',
sessionTimeoutError: '最小超时时间为 300 ', sessionTimeoutError: '最小超时时间为 300 ',
sessionTimeoutHelper: '如果用户超过 {0} 秒未操作面板面板将自动退出登录', sessionTimeoutHelper: '如果用户超过 {0} 秒未操作面板面板将自动退出登录',
systemIP: '服务器地址', systemIP: '默认访问地址',
systemIPHelper: '当前节点访问应用容器跳转的默认访问地址',
proxy: '代理服务器', proxy: '代理服务器',
proxyHelper: '设置代理服务器后将在以下场景中生效', proxyHelper: '设置代理服务器后将在以下场景中生效',
proxyHelper1: '应用商店的安装包下载和同步专业版功能', proxyHelper1: '应用商店的安装包下载和同步专业版功能',

View file

@ -68,6 +68,25 @@ const onChangeShow = async (row: any) => {
for (const item of row.children) { for (const item of row.children) {
item.isShow = row.isShow; item.isShow = row.isShow;
} }
return;
}
for (const item of treeData.hideMenu) {
if (!item.children) {
continue;
}
let allHide = true;
for (const item2 of item.children) {
if (item2.isShow) {
allHide = false;
}
if (item2.id === row.id && item2.isShow) {
item.isShow = true;
return;
}
}
if (allHide) {
item.isShow = false;
}
} }
}; };

View file

@ -118,11 +118,7 @@
</span> </span>
</el-form-item> </el-form-item>
<el-form-item <el-form-item :label="$t('setting.systemIP')" prop="systemIP">
v-if="globalStore.currentNode === 'local'"
:label="$t('setting.systemIP')"
prop="systemIP"
>
<el-input disabled v-if="form.systemIP" v-model="form.systemIP"> <el-input disabled v-if="form.systemIP" v-model="form.systemIP">
<template #append> <template #append>
<el-button @click="onChangeSystemIP" icon="Setting"> <el-button @click="onChangeSystemIP" icon="Setting">
@ -207,7 +203,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, reactive, onMounted, computed } from 'vue'; import { ref, reactive, onMounted, computed } from 'vue';
import { ElForm, ElMessageBox } from 'element-plus'; import { ElForm, ElMessageBox } from 'element-plus';
import { getSettingInfo, updateSetting, getSystemAvailable, updateApiConfig } from '@/api/modules/setting'; import {
getSettingInfo,
updateSetting,
getSystemAvailable,
updateApiConfig,
getAgentSettingInfo,
} from '@/api/modules/setting';
import { GlobalStore } from '@/store'; import { GlobalStore } from '@/store';
import { useI18n } from 'vue-i18n'; import { useI18n } from 'vue-i18n';
import { useTheme } from '@/global/use-theme'; import { useTheme } from '@/global/use-theme';
@ -306,6 +308,9 @@ if (globalStore.isIntl) {
} }
const search = async () => { const search = async () => {
const agentRes = await getAgentSettingInfo();
form.systemIP = agentRes.data.systemIP;
const res = await getSettingInfo(); const res = await getSettingInfo();
form.userName = res.data.userName; form.userName = res.data.userName;
form.password = '******'; form.password = '******';
@ -328,7 +333,6 @@ const search = async () => {
form.ipWhiteList = res.data.ipWhiteList; form.ipWhiteList = res.data.ipWhiteList;
form.apiKeyValidityTime = res.data.apiKeyValidityTime; form.apiKeyValidityTime = res.data.apiKeyValidityTime;
form.hideMenu = res.data.hideMenu; form.hideMenu = res.data.hideMenu;
form.systemIP = res.data.systemIP;
form.theme = res.data.theme; form.theme = res.data.theme;
if (isMasterProductPro.value) { if (isMasterProductPro.value) {

View file

@ -18,7 +18,7 @@
import { reactive, ref } from 'vue'; import { reactive, ref } from 'vue';
import i18n from '@/lang'; import i18n from '@/lang';
import { MsgSuccess } from '@/utils/message'; import { MsgSuccess } from '@/utils/message';
import { updateSetting } from '@/api/modules/setting'; import { updateAgentSetting } from '@/api/modules/setting';
import { FormInstance } from 'element-plus'; import { FormInstance } from 'element-plus';
import { checkDomain, checkIpV4V6 } from '@/utils/util'; import { checkDomain, checkIpV4V6 } from '@/utils/util';
@ -57,7 +57,7 @@ const onSaveSystemIP = async (formEl: FormInstance | undefined) => {
if (!formEl) return; if (!formEl) return;
formEl.validate(async (valid) => { formEl.validate(async (valid) => {
if (!valid) return; if (!valid) return;
await updateSetting({ key: 'SystemIP', value: form.systemIP }) await updateAgentSetting({ key: 'SystemIP', value: form.systemIP })
.then(async () => { .then(async () => {
MsgSuccess(i18n.global.t('commons.msg.operationSuccess')); MsgSuccess(i18n.global.t('commons.msg.operationSuccess'));
loading.value = false; loading.value = false;