Skip to content

Commit 239c599

Browse files
authored
字段验证
1 parent 92dd9a3 commit 239c599

File tree

1 file changed

+19
-6
lines changed

1 file changed

+19
-6
lines changed

明文源吗

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1983,7 +1983,7 @@
19831983
KR: '🇰🇷 韩国', DE: '🇩🇪 德国', SE: '🇸🇪 瑞典', NL: '🇳🇱 荷兰',
19841984
FI: '🇫🇮 芬兰', GB: '🇬🇧 英国'
19851985
},
1986-
terminal: '终端 v2.9',
1986+
terminal: '终端 v2.8',
19871987
githubProject: 'GitHub 项目',
19881988
autoDetectClient: '自动识别',
19891989
selectionLogicText: '同地区 → 邻近地区 → 其他地区',
@@ -2114,7 +2114,7 @@
21142114
KR: '🇰🇷 کره جنوبی', DE: '🇩🇪 آلمان', SE: '🇸🇪 سوئد', NL: '🇳🇱 هلند',
21152115
FI: '🇫🇮 فنلاند', GB: '🇬🇧 بریتانیا'
21162116
},
2117-
terminal: 'ترمینال v2.9',
2117+
terminal: 'ترمینال v2.8',
21182118
githubProject: 'پروژه GitHub',
21192119
autoDetectClient: 'تشخیص خودکار',
21202120
selectionLogicText: 'هم‌منطقه → منطقه مجاور → سایر مناطق',
@@ -3713,6 +3713,10 @@
37133713
randomIPCount.addEventListener('input', function() {
37143714
localStorage.setItem('randomIPCount', this.value);
37153715
});
3716+
// 初始化时,如果默认是隐藏的,则禁用输入框
3717+
if (randomCountDiv && randomCountDiv.style.display === 'none') {
3718+
randomIPCount.disabled = true;
3719+
}
37163720
}
37173721
const testThreadsInput = document.getElementById('testThreads');
37183722
if (testThreadsInput) {
@@ -3724,12 +3728,17 @@
37243728
}
37253729
if (ipSourceSelect) {
37263730
const savedSource = localStorage.getItem('ipSourceSelect');
3731+
const currentSource = savedSource || ipSourceSelect.value || 'manual';
37273732
if (savedSource) {
37283733
ipSourceSelect.value = savedSource;
3729-
manualInputDiv.style.display = savedSource === 'manual' ? 'block' : 'none';
3730-
urlFetchDiv.style.display = savedSource === 'urlFetch' ? 'block' : 'none';
3731-
cfRandomDiv.style.display = savedSource === 'cfRandom' ? 'block' : 'none';
3732-
randomCountDiv.style.display = savedSource === 'cfRandom' ? 'block' : 'none';
3734+
}
3735+
manualInputDiv.style.display = currentSource === 'manual' ? 'block' : 'none';
3736+
urlFetchDiv.style.display = currentSource === 'urlFetch' ? 'block' : 'none';
3737+
cfRandomDiv.style.display = currentSource === 'cfRandom' ? 'block' : 'none';
3738+
randomCountDiv.style.display = currentSource === 'cfRandom' ? 'block' : 'none';
3739+
// 当隐藏时禁用输入框,避免表单验证错误
3740+
if (randomIPCount) {
3741+
randomIPCount.disabled = currentSource !== 'cfRandom';
37333742
}
37343743
}
37353744

@@ -3770,6 +3779,10 @@
37703779
urlFetchDiv.style.display = value === 'urlFetch' ? 'block' : 'none';
37713780
cfRandomDiv.style.display = value === 'cfRandom' ? 'block' : 'none';
37723781
randomCountDiv.style.display = value === 'cfRandom' ? 'block' : 'none';
3782+
// 当隐藏时禁用输入框,避免表单验证错误
3783+
if (randomIPCount) {
3784+
randomIPCount.disabled = value !== 'cfRandom';
3785+
}
37733786
});
37743787
}
37753788

0 commit comments

Comments
 (0)