diff --git a/internal/web/actions/default/servers/logs/settings.go b/internal/web/actions/default/servers/logs/settings.go index c646c70c..4f668acb 100644 --- a/internal/web/actions/default/servers/logs/settings.go +++ b/internal/web/actions/default/servers/logs/settings.go @@ -27,9 +27,11 @@ func (this *SettingsAction) RunGet(params struct{}) { } var config = &serverconfigs.AccessLogQueueConfig{ - MaxLength: 0, - CountPerSecond: 0, - Percent: 100, + MaxLength: 0, + CountPerSecond: 0, + Percent: 100, + EnableAutoPartial: true, + RowsPerTable: 500_000, } if len(settingsResp.ValueJSON) > 0 { err = json.Unmarshal(settingsResp.ValueJSON, config) @@ -59,9 +61,11 @@ func (this *SettingsAction) RunGet(params struct{}) { } func (this *SettingsAction) RunPost(params struct { - Percent int - CountPerSecond int - MaxLength int + Percent int + CountPerSecond int + MaxLength int + EnableAutoPartial bool + RowsPerTable int64 Must *actions.Must CSRF *actionutils.CSRF @@ -72,9 +76,11 @@ func (this *SettingsAction) RunPost(params struct { Lte(100, "请输入小于100的整数") var config = &serverconfigs.AccessLogQueueConfig{ - MaxLength: params.MaxLength, - CountPerSecond: params.CountPerSecond, - Percent: params.Percent, + MaxLength: params.MaxLength, + CountPerSecond: params.CountPerSecond, + Percent: params.Percent, + EnableAutoPartial: params.EnableAutoPartial, + RowsPerTable: params.RowsPerTable, } configJSON, err := json.Marshal(config) if err != nil { diff --git a/web/views/@default/servers/logs/settings.html b/web/views/@default/servers/logs/settings.html index b08841a8..cdae6024 100644 --- a/web/views/@default/servers/logs/settings.html +++ b/web/views/@default/servers/logs/settings.html @@ -41,5 +41,24 @@ + +

自动分表设置

+ + + + + + + + + +
启用自动分表 + +

启用后,可以将单天访问日志自动存储到多个数据表中,以提升查询速度。

+
单表最多行数 + +

单个数据表最多能存储的最多行数。

+
+ \ No newline at end of file