@@ -184,6 +199,7 @@ const typeOptions = [
{ value: 'HD', label: 'H&R' },
{ value: 'RATIO', label: '分享率' },
{ value: 'TASK', label: '新人考核' },
+ { value: 'DRATIO', label: '动态分享率' },
]
const condOptions = [
{ value: 'GT', label: '大于' },
@@ -237,6 +253,10 @@ const onTypeChange = (rule) => {
}
rule.threshold = rule.threshold || 30
rule.unit = '天'
+ } else if (rule.type === 'DRATIO') {
+ rule.threshold = rule.threshold || 100
+ rule.minRatio = rule.minRatio || 1.0
+ rule.unit = 'GB'
} else {
const d = typeDefaults[rule.type]
if (d) { rule.metric = d.metric; rule.condition = d.condition; rule.unit = d.unit }
@@ -259,6 +279,8 @@ const presets = [
{ name:'H&R 封号', type:'HD', metric:'hnr_count', threshold:5, unit:'次', condition:'GTE', description:'H&R违规次数达到5次即封号' },
// 新人考核
{ name:'新人考核', type:'TASK', threshold:30, unit:'天', description:'新注册用户需在考核周期内完成各项要求' },
+ // 动态分享率
+ { name:'动态分享率', type:'DRATIO', threshold:100, minRatio:1.0, unit:'GB', description:'下载量达到阈值时分享率不低于要求值' },
]
const presetCategories = [
@@ -267,10 +289,12 @@ const presetCategories = [
{ title:'流量监控', items: presets.filter(p => p.type === 'TRAFFIC') },
{ title:'H&R 惩罚', items: presets.filter(p => p.type === 'HD') },
{ title:'新人考核', items: presets.filter(p => p.type === 'TASK') },
+ { title:'分享率', items: presets.filter(p => p.type === 'DRATIO') },
]
const presetDesc = (p) => {
if (p.type === 'TASK') return `考核周期 ${p.threshold||30} 天,需满足上传/下载/魔力值/做种积分/做种时间要求`
+ if (p.type === 'DRATIO') return `下载量 ≥ ${p.threshold||100}GB 时分享率 ≥ ${p.minRatio||1.0}`
const condLabel = condOptions.find(c => c.value === p.condition)?.label || p.condition
const appLabel = applicableOptions.find(a => a.value === p.applicable)?.label || ''
return `${metricOptions.find(m=>m.value===p.metric)?.label||p.metric} ${condLabel} ${p.threshold}${p.unit||''}${appLabel?' ('+appLabel+')':''}`