This commit is contained in:
Logan committed 2026-07-09 14:16:56 +08:00
1 parent 0690285147
commit 5618cd2738
154 files changed
+5021 -3161

No files matched your search

+11 -11
View File
@@ -12,10 +12,10 @@ type PrometheusDataSource struct {
Access string `gorm:"type:varchar(16);default:'server';comment:访问模式: server/proxy" json:"access"`
// Basic Auth
BasicAuth bool `gorm:"default:false;comment:启用基础认证" json:"basic_auth"`
BasicAuthUser string `gorm:"type:varchar(128);comment:认证用户名" json:"basic_auth_user,omitempty"`
BasicAuthPass string `gorm:"type:varchar(256);comment:认证密码" json:"basic_auth_pass,omitempty"`
WithCredentials bool `gorm:"default:false;comment:携带凭证" json:"with_credentials"`
BasicAuth bool `gorm:"default:false;comment:启用基础认证" json:"basic_auth"`
BasicAuthUser string `gorm:"type:varchar(128);comment:认证用户名" json:"basic_auth_user,omitempty"`
BasicAuthPass string `gorm:"type:varchar(256);comment:认证密码" json:"basic_auth_pass,omitempty"`
WithCredentials bool `gorm:"default:false;comment:携带凭证" json:"with_credentials"`
// TLS Client Auth
TLSClientAuth bool `gorm:"default:false;comment:启用TLS客户端认证" json:"tls_client_auth"`
@@ -31,8 +31,8 @@ type PrometheusDataSource struct {
AlertmanagerDS string `gorm:"type:varchar(128);comment:Alertmanager数据源" json:"alertmanager_ds,omitempty"`
// 采集与查询
ScrapeInterval int `gorm:"default:15;comment:采集间隔(秒)" json:"scrape_interval"`
QueryTimeout int `gorm:"default:60;comment:查询超时(秒)" json:"query_timeout"`
ScrapeInterval int `gorm:"default:15;comment:采集间隔(秒)" json:"scrape_interval"`
QueryTimeout int `gorm:"default:60;comment:查询超时(秒)" json:"query_timeout"`
HTTPMethod string `gorm:"type:varchar(8);default:'POST';comment:HTTP方法" json:"http_method"`
// 杂项
@@ -109,9 +109,9 @@ type UpdatePromDSReq struct {
// TestPromDSReq 测试数据源连接请求
type TestPromDSReq struct {
URL string `json:"url" binding:"required"`
BasicAuth bool `json:"basic_auth"`
BasicAuthUser string `json:"basic_auth_user"`
BasicAuthPass string `json:"basic_auth_pass"`
SkipTLSVerify bool `json:"skip_tls_verify"`
URL string `json:"url" binding:"required"`
BasicAuth bool `json:"basic_auth"`
BasicAuthUser string `json:"basic_auth_user"`
BasicAuthPass string `json:"basic_auth_pass"`
SkipTLSVerify bool `json:"skip_tls_verify"`
}