|
3691 | 3691 | const fetchURLInput = document.getElementById('fetchURLInput'); |
3692 | 3692 | const latencyTestPort = document.getElementById('latencyTestPort'); |
3693 | 3693 | const randomIPCount = document.getElementById('randomIPCount'); |
| 3694 | + const cfRandomDiv = document.getElementById('cfRandomDiv'); |
| 3695 | + const randomCountDiv = document.getElementById('randomCountDiv'); |
| 3696 | + const generateCFIPBtn = document.getElementById('generateCFIPBtn'); |
| 3697 | + const fetchIPBtn = document.getElementById('fetchIPBtn'); |
3694 | 3698 |
|
3695 | 3699 | if (latencyTestInput) { |
3696 | 3700 | const savedTestInput = localStorage.getItem('latencyTestInput'); |
|
3730 | 3734 | randomCountDiv.style.display = savedSource === 'cfRandom' ? 'block' : 'none'; |
3731 | 3735 | } |
3732 | 3736 | } |
3733 | | - const cfRandomDiv = document.getElementById('cfRandomDiv'); |
3734 | | - const randomCountDiv = document.getElementById('randomCountDiv'); |
3735 | | - const generateCFIPBtn = document.getElementById('generateCFIPBtn'); |
3736 | | - const fetchIPBtn = document.getElementById('fetchIPBtn'); |
3737 | 3737 |
|
3738 | 3738 | const CF_CIDR_LIST = [ |
3739 | 3739 | '173.245.48.0/20', '103.21.244.0/22', '103.22.200.0/22', '103.31.4.0/22', |
|
3967 | 3967 |
|
3968 | 3968 | if (selectedItems.length > 0) { |
3969 | 3969 | const preferredIPsInput = document.getElementById('preferredIPs'); |
3970 | | - const currentValue = preferredIPsInput.value.trim(); |
3971 | | - const newValue = currentValue ? currentValue + ',' + selectedItems.join(',') : selectedItems.join(','); |
| 3970 | + const newValue = selectedItems.join(','); |
3972 | 3971 | preferredIPsInput.value = newValue; |
3973 | 3972 |
|
3974 | 3973 | addSelectedBtn.disabled = true; |
|
3982 | 3981 | socksConfig: document.getElementById('socksConfig').value |
3983 | 3982 | }; |
3984 | 3983 | await saveConfig(configData); |
3985 | | - showStatus('${isFarsi ? 'موفقیتآمیز بود' : '已添加'} ' + selectedItems.length + ' ${isFarsi ? 'مورد و ذخیره شد' : '项并已保存'}', 'success'); |
| 3984 | + showStatus('${isFarsi ? 'موفقیتآمیز بود' : '已替换'} ' + selectedItems.length + ' ${isFarsi ? 'مورد و ذخیره شد' : '项并已保存'}', 'success'); |
3986 | 3985 | } catch (err) { |
3987 | 3986 | showStatus('${isFarsi ? 'خطا در ذخیره' : '保存失败'}: ' + err.message, 'error'); |
3988 | 3987 | } finally { |
|
0 commit comments