diff --git a/backend/app/service/database_common.go b/backend/app/service/database_common.go index 75d6973e6..d7112803f 100644 --- a/backend/app/service/database_common.go +++ b/backend/app/service/database_common.go @@ -50,10 +50,6 @@ func (u *DBCommonService) LoadDatabaseFile(req dto.OperationWithNameAndType) (st filePath = path.Join(global.CONF.System.DataDir, fmt.Sprintf("apps/postgresql/%s/data/postgresql.conf", req.Name)) case "redis-conf": filePath = path.Join(global.CONF.System.DataDir, fmt.Sprintf("apps/redis/%s/conf/redis.conf", req.Name)) - case "mysql-slow-logs": - filePath = path.Join(global.CONF.System.DataDir, fmt.Sprintf("apps/mysql/%s/data/1Panel-slow.log", req.Name)) - case "mariadb-slow-logs": - filePath = path.Join(global.CONF.System.DataDir, fmt.Sprintf("apps/mariadb/%s/db/data/1Panel-slow.log", req.Name)) } if _, err := os.Stat(filePath); err != nil { return "", buserr.New("ErrHttpReqNotFound") diff --git a/backend/app/service/file.go b/backend/app/service/file.go index 854352744..5d186a276 100644 --- a/backend/app/service/file.go +++ b/backend/app/service/file.go @@ -481,6 +481,10 @@ func (f *FileService) ReadLogByLine(req request.FileReadByLineReq) (*response.Fi logFilePath = path.Join(global.CONF.System.TmpDir, fmt.Sprintf("docker_logs/%s", req.Name)) case "ollama-model": logFilePath = path.Join(global.CONF.System.DataDir, "log", "AITools", req.Name) + case "mysql-slow-logs": + logFilePath = path.Join(global.CONF.System.DataDir, fmt.Sprintf("apps/mysql/%s/data/1Panel-slow.log", req.Name)) + case "mariadb-slow-logs": + logFilePath = path.Join(global.CONF.System.DataDir, fmt.Sprintf("apps/mariadb/%s/db/data/1Panel-slow.log", req.Name)) } lines, isEndOfFile, total, err := files.ReadFileByLine(logFilePath, req.Page, req.PageSize, req.Latest) diff --git a/frontend/src/views/database/mysql/setting/slow-log/index.vue b/frontend/src/views/database/mysql/setting/slow-log/index.vue index 6f70758c9..17659be9a 100644 --- a/frontend/src/views/database/mysql/setting/slow-log/index.vue +++ b/frontend/src/views/database/mysql/setting/slow-log/index.vue @@ -16,63 +16,27 @@ {{ $t('commons.button.save') }} -
- - {{ $t('commons.button.watch') }} - -
- - {{ $t('file.download') }} - - +