|
1983 | 1983 | KR: '🇰🇷 韩国', DE: '🇩🇪 德国', SE: '🇸🇪 瑞典', NL: '🇳🇱 荷兰', |
1984 | 1984 | FI: '🇫🇮 芬兰', GB: '🇬🇧 英国' |
1985 | 1985 | }, |
1986 | | - terminal: '终端 v2.9', |
| 1986 | + terminal: '终端 v2.8', |
1987 | 1987 | githubProject: 'GitHub 项目', |
1988 | 1988 | autoDetectClient: '自动识别', |
1989 | 1989 | selectionLogicText: '同地区 → 邻近地区 → 其他地区', |
|
2114 | 2114 | KR: '🇰🇷 کره جنوبی', DE: '🇩🇪 آلمان', SE: '🇸🇪 سوئد', NL: '🇳🇱 هلند', |
2115 | 2115 | FI: '🇫🇮 فنلاند', GB: '🇬🇧 بریتانیا' |
2116 | 2116 | }, |
2117 | | - terminal: 'ترمینال v2.9', |
| 2117 | + terminal: 'ترمینال v2.8', |
2118 | 2118 | githubProject: 'پروژه GitHub', |
2119 | 2119 | autoDetectClient: 'تشخیص خودکار', |
2120 | 2120 | selectionLogicText: 'هممنطقه → منطقه مجاور → سایر مناطق', |
|
3713 | 3713 | randomIPCount.addEventListener('input', function() { |
3714 | 3714 | localStorage.setItem('randomIPCount', this.value); |
3715 | 3715 | }); |
| 3716 | + // 初始化时,如果默认是隐藏的,则禁用输入框 |
| 3717 | + if (randomCountDiv && randomCountDiv.style.display === 'none') { |
| 3718 | + randomIPCount.disabled = true; |
| 3719 | + } |
3716 | 3720 | } |
3717 | 3721 | const testThreadsInput = document.getElementById('testThreads'); |
3718 | 3722 | if (testThreadsInput) { |
|
3724 | 3728 | } |
3725 | 3729 | if (ipSourceSelect) { |
3726 | 3730 | const savedSource = localStorage.getItem('ipSourceSelect'); |
| 3731 | + const currentSource = savedSource || ipSourceSelect.value || 'manual'; |
3727 | 3732 | if (savedSource) { |
3728 | 3733 | 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'; |
3733 | 3742 | } |
3734 | 3743 | } |
3735 | 3744 |
|
|
3770 | 3779 | urlFetchDiv.style.display = value === 'urlFetch' ? 'block' : 'none'; |
3771 | 3780 | cfRandomDiv.style.display = value === 'cfRandom' ? 'block' : 'none'; |
3772 | 3781 | randomCountDiv.style.display = value === 'cfRandom' ? 'block' : 'none'; |
| 3782 | + // 当隐藏时禁用输入框,避免表单验证错误 |
| 3783 | + if (randomIPCount) { |
| 3784 | + randomIPCount.disabled = value !== 'cfRandom'; |
| 3785 | + } |
3773 | 3786 | }); |
3774 | 3787 | } |
3775 | 3788 |
|
|
0 commit comments