From d3e2c8e9d33751b11ccdf150a7f01272cbafdc2c Mon Sep 17 00:00:00 2001
From: ssongliu <73214554+ssongliu@users.noreply.github.com>
Date: Tue, 5 Aug 2025 19:15:00 +0800
Subject: [PATCH] fix: Add remote database connection timeout record (#9868)
---
agent/app/dto/database.go | 1 +
agent/app/model/database.go | 1 +
agent/app/service/database.go | 1 +
agent/init/migration/migrations/init.go | 2 +-
frontend/src/lang/modules/en.ts | 2 +-
frontend/src/lang/modules/ja.ts | 2 +-
frontend/src/lang/modules/ko.ts | 2 +-
frontend/src/lang/modules/ms.ts | 2 +-
frontend/src/lang/modules/pt-br.ts | 2 +-
frontend/src/lang/modules/ru.ts | 2 +-
frontend/src/lang/modules/tr.ts | 2 +-
frontend/src/lang/modules/zh-Hant.ts | 2 +-
frontend/src/lang/modules/zh.ts | 2 +-
frontend/src/views/cronjob/cronjob/record/index.vue | 2 +-
frontend/src/views/database/mysql/remote/index.vue | 1 -
frontend/src/views/database/postgresql/remote/index.vue | 1 -
frontend/src/views/database/redis/remote/index.vue | 1 -
frontend/src/views/setting/snapshot/status/index.vue | 2 +-
18 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/agent/app/dto/database.go b/agent/app/dto/database.go
index 3ec0d36dc..b99ce5ac5 100644
--- a/agent/app/dto/database.go
+++ b/agent/app/dto/database.go
@@ -260,6 +260,7 @@ type DatabaseInfo struct {
ClientCert string `json:"clientCert"`
SkipVerify bool `json:"skipVerify"`
+ Timeout uint `json:"timeout"`
Description string `json:"description"`
}
diff --git a/agent/app/model/database.go b/agent/app/model/database.go
index be3230152..b6f0a0bb9 100644
--- a/agent/app/model/database.go
+++ b/agent/app/model/database.go
@@ -18,5 +18,6 @@ type Database struct {
ClientCert string `json:"clientCert"`
SkipVerify bool `json:"skipVerify"`
+ Timeout uint `json:"timeout"`
Description string `json:"description"`
}
diff --git a/agent/app/service/database.go b/agent/app/service/database.go
index 5fc7afe19..648ddeca4 100644
--- a/agent/app/service/database.go
+++ b/agent/app/service/database.go
@@ -325,6 +325,7 @@ func (u *DatabaseService) Update(req dto.DatabaseUpdate) error {
upMap["port"] = req.Port
upMap["username"] = req.Username
upMap["password"] = pass
+ upMap["timeout"] = req.Timeout
upMap["description"] = req.Description
upMap["ssl"] = req.SSL
upMap["client_key"] = req.ClientKey
diff --git a/agent/init/migration/migrations/init.go b/agent/init/migration/migrations/init.go
index b029b0df1..b27159a07 100644
--- a/agent/init/migration/migrations/init.go
+++ b/agent/init/migration/migrations/init.go
@@ -19,7 +19,7 @@ import (
)
var AddTable = &gormigrate.Migration{
- ID: "20250729-add-table",
+ ID: "20250805-add-table",
Migrate: func(tx *gorm.DB) error {
return tx.AutoMigrate(
&model.AppDetail{},
diff --git a/frontend/src/lang/modules/en.ts b/frontend/src/lang/modules/en.ts
index 9f405ac13..a1d6725ab 100644
--- a/frontend/src/lang/modules/en.ts
+++ b/frontend/src/lang/modules/en.ts
@@ -572,7 +572,7 @@ const message = {
longQueryTime: 'threshold(s)',
thresholdRangeHelper: 'Please enter the correct threshold (1 - 600).',
- timeout: 'Timeout',
+ timeout: 'Timeout(s)',
timeoutHelper: 'Idle connection timeout period. 0 indicates that the connection is on continuously.',
maxclients: 'Max clients',
requirepassHelper:
diff --git a/frontend/src/lang/modules/ja.ts b/frontend/src/lang/modules/ja.ts
index f78e5918e..efa7af64e 100644
--- a/frontend/src/lang/modules/ja.ts
+++ b/frontend/src/lang/modules/ja.ts
@@ -559,7 +559,7 @@ const message = {
longQueryTime: 'しきい値',
thresholdRangeHelper: '正しいしきい値(1-600)を入力してください。',
- timeout: 'タイムアウト',
+ timeout: 'タイムアウト(s)',
timeoutHelper: 'アイドル接続タイムアウト期間。0は、接続が継続的にオンになっていることを示します。',
maxclients: 'マックスクライアント',
requirepassHelper:
diff --git a/frontend/src/lang/modules/ko.ts b/frontend/src/lang/modules/ko.ts
index a0bffb115..a22cc74ce 100644
--- a/frontend/src/lang/modules/ko.ts
+++ b/frontend/src/lang/modules/ko.ts
@@ -556,7 +556,7 @@ const message = {
longQueryTime: '임계값(s)',
thresholdRangeHelper: '올바른 임계값을 입력하십시오 (1 - 600).',
- timeout: '타임아웃',
+ timeout: '타임아웃(s)',
timeoutHelper: '유휴 연결의 타임아웃 기간. 0은 연결이 지속적으로 유지됨을 의미합니다.',
maxclients: '최대 클라이언트',
requirepassHelper:
diff --git a/frontend/src/lang/modules/ms.ts b/frontend/src/lang/modules/ms.ts
index b569c1ac3..a2e90089e 100644
--- a/frontend/src/lang/modules/ms.ts
+++ b/frontend/src/lang/modules/ms.ts
@@ -571,7 +571,7 @@ const message = {
longQueryTime: 'Ambang (saat)',
thresholdRangeHelper: 'Sila masukkan ambang yang betul (1 - 600).',
- timeout: 'Tamat masa',
+ timeout: 'Tamat masa(saat)',
timeoutHelper: 'Tempoh tamat masa sambungan tidak aktif. 0 menunjukkan sambungan sentiasa aktif.',
maxclients: 'Klien maksimum',
requirepassHelper:
diff --git a/frontend/src/lang/modules/pt-br.ts b/frontend/src/lang/modules/pt-br.ts
index eb8e0d654..b5dbe29ef 100644
--- a/frontend/src/lang/modules/pt-br.ts
+++ b/frontend/src/lang/modules/pt-br.ts
@@ -568,7 +568,7 @@ const message = {
longQueryTime: 'limite (segundos)',
thresholdRangeHelper: 'Por favor, insira o limite correto (1 - 600).',
- timeout: 'Tempo limite',
+ timeout: 'Tempo limite(segundos)',
timeoutHelper: 'Período de timeout de conexão ociosa. 0 indica que a conexão permanece ativa continuamente.',
maxclients: 'Máximo de clientes',
requirepassHelper:
diff --git a/frontend/src/lang/modules/ru.ts b/frontend/src/lang/modules/ru.ts
index 187d8beed..f642e4a1a 100644
--- a/frontend/src/lang/modules/ru.ts
+++ b/frontend/src/lang/modules/ru.ts
@@ -563,7 +563,7 @@ const message = {
longQueryTime: 'порог (сек)',
thresholdRangeHelper: 'Пожалуйста, введите корректный порог (1 - 600).',
- timeout: 'Таймаут',
+ timeout: 'Таймаут(сек)',
timeoutHelper: 'Период таймаута неактивного подключения. 0 означает, что подключение постоянно активно.',
maxclients: 'Макс. клиентов',
requirepassHelper:
diff --git a/frontend/src/lang/modules/tr.ts b/frontend/src/lang/modules/tr.ts
index b9a47258c..98e95e4d4 100644
--- a/frontend/src/lang/modules/tr.ts
+++ b/frontend/src/lang/modules/tr.ts
@@ -579,7 +579,7 @@ const message = {
longQueryTime: 'eşik(saniye)',
thresholdRangeHelper: 'Lütfen doğru eşik değerini girin (1 - 600).',
- timeout: 'Zaman aşımı',
+ timeout: 'Zaman aşımı(saniye)',
timeoutHelper: 'Boştaki bağlantı zaman aşımı süresi. 0, bağlantının sürekli açık olduğunu gösterir.',
maxclients: 'Maksimum istemci',
requirepassHelper:
diff --git a/frontend/src/lang/modules/zh-Hant.ts b/frontend/src/lang/modules/zh-Hant.ts
index c99dded31..d000baba7 100644
--- a/frontend/src/lang/modules/zh-Hant.ts
+++ b/frontend/src/lang/modules/zh-Hant.ts
@@ -554,7 +554,7 @@ const message = {
longQueryTime: '閾值(秒)',
thresholdRangeHelper: '請輸入正確的閾值(1 - 600)',
- timeout: '超時時間',
+ timeout: '超時時間(秒)',
timeoutHelper: '空閑連接超時時間,0表示不斷開',
maxclients: '最大連接數',
requirepassHelper: '留空代表沒有設置密碼,修改需要單獨保存並且重啟容器!',
diff --git a/frontend/src/lang/modules/zh.ts b/frontend/src/lang/modules/zh.ts
index 67c51fe52..2bae8ad81 100644
--- a/frontend/src/lang/modules/zh.ts
+++ b/frontend/src/lang/modules/zh.ts
@@ -552,7 +552,7 @@ const message = {
longQueryTime: '阈值(秒)',
thresholdRangeHelper: '请输入正确的阈值(1 - 600)',
- timeout: '超时时间',
+ timeout: '超时时间(秒)',
timeoutHelper: '空闲连接超时时间,0表示不断开',
maxclients: '最大连接数',
requirepassHelper: '留空代表没有设置密码,修改需要单独保存并且重启容器!',
diff --git a/frontend/src/views/cronjob/cronjob/record/index.vue b/frontend/src/views/cronjob/cronjob/record/index.vue
index dc074ef73..efd69c6ab 100644
--- a/frontend/src/views/cronjob/cronjob/record/index.vue
+++ b/frontend/src/views/cronjob/cronjob/record/index.vue
@@ -115,7 +115,7 @@
:current-page="searchInfo.page"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
- :pager-count="3"
+ :pager-count="5"
:page-sizes="[6, 8, 10, 12, 14]"
small
layout="total, sizes, prev, pager, next"
diff --git a/frontend/src/views/database/mysql/remote/index.vue b/frontend/src/views/database/mysql/remote/index.vue
index 27f152014..99a9abb9a 100644
--- a/frontend/src/views/database/mysql/remote/index.vue
+++ b/frontend/src/views/database/mysql/remote/index.vue
@@ -134,7 +134,6 @@ const onOpenDialog = async (
title,
rowData: { ...rowData },
};
- params.rowData.timeout = 30;
dialogRef.value!.acceptParams(params);
};
diff --git a/frontend/src/views/database/postgresql/remote/index.vue b/frontend/src/views/database/postgresql/remote/index.vue
index 9977083e6..513987675 100644
--- a/frontend/src/views/database/postgresql/remote/index.vue
+++ b/frontend/src/views/database/postgresql/remote/index.vue
@@ -134,7 +134,6 @@ const onOpenDialog = async (
title,
rowData: { ...rowData },
};
- params.rowData.timeout = 30;
dialogRef.value!.acceptParams(params);
};
diff --git a/frontend/src/views/database/redis/remote/index.vue b/frontend/src/views/database/redis/remote/index.vue
index 8f00813d5..85a8f7aa1 100644
--- a/frontend/src/views/database/redis/remote/index.vue
+++ b/frontend/src/views/database/redis/remote/index.vue
@@ -134,7 +134,6 @@ const onOpenDialog = async (
title,
rowData: { ...rowData },
};
- params.rowData.timeout = 30;
dialogRef.value!.acceptParams(params);
};
diff --git a/frontend/src/views/setting/snapshot/status/index.vue b/frontend/src/views/setting/snapshot/status/index.vue
index d3986fd97..8e0921ccf 100644
--- a/frontend/src/views/setting/snapshot/status/index.vue
+++ b/frontend/src/views/setting/snapshot/status/index.vue
@@ -119,7 +119,7 @@
-
+