mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-02 23:06:36 +08:00
fix(waf): IP 组预设规则写入默认 ttl
点击自动抓取预设规则时补齐 ttl=-1,并规范化自动配置默认 JSON。
This commit is contained in:
@@ -88,7 +88,11 @@ const defaultValues: IPGroupFormValues = {
|
||||
type: 'manual',
|
||||
enabled: true,
|
||||
ip_list_text: '',
|
||||
auto_config_text: '{}',
|
||||
auto_config_text: JSON.stringify(
|
||||
{ lookback_minutes: 60, ttl: -1, rules: [] },
|
||||
null,
|
||||
2,
|
||||
),
|
||||
subscription_url: '',
|
||||
subscription_format: 'text',
|
||||
subscription_mapping_rule: '',
|
||||
@@ -148,6 +152,7 @@ function appendAutomaticPresetRule(
|
||||
typeof config.lookback_minutes === 'number'
|
||||
? config.lookback_minutes
|
||||
: 60,
|
||||
ttl: typeof config.ttl === 'number' ? config.ttl : -1,
|
||||
...config,
|
||||
rules: nextRules,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user