Merge pull request #13569 from brvphoenix/webui

Fix the issue that IPv6 address can't be banned
This commit is contained in:
Mike Tzou 2020-10-26 12:15:54 +08:00 committed by GitHub
commit 6d514c97f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 9 deletions

View File

@ -550,7 +550,7 @@ void SyncController::torrentPeersAction()
peer[KEY_PEER_COUNTRY] = Net::GeoIPManager::CountryName(pi.country());
}
peers[pi.address().ip.toString() + ':' + QString::number(pi.address().port)] = peer;
peers[pi.address().toString()] = peer;
}
data["peers"] = peers;

View File

@ -356,11 +356,11 @@
<fieldset class="settings">
<legend>
<input type="checkbox" id="ipfilter_enabled_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" />
<label for="ipfilter_enabled_checkbox">QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
<label>QBT_TR(IP Filtering)QBT_TR[CONTEXT=OptionsDialog]</label>
</legend>
<div class="formRow">
<label for="ipfilter_text">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="checkbox" id="ipfilter_text_checkbox" onclick="qBittorrent.Preferences.updateFilterSettings();" />
<label for="ipfilter_text_checkbox">QBT_TR(Filter path (.dat, .p2p, .p2b):)QBT_TR[CONTEXT=OptionsDialog]</label>
<input type="text" id="ipfilter_text" />
</div>
<div class="formRow">
@ -1423,10 +1423,8 @@
};
const updateFilterSettings = function() {
const isIPFilterEnabled = $('ipfilter_enabled_checkbox').getProperty('checked');
const isIPFilterEnabled = $('ipfilter_text_checkbox').getProperty('checked');
$('ipfilter_text').setProperty('disabled', !isIPFilterEnabled);
$('ipfilter_trackers_checkbox').setProperty('disabled', !isIPFilterEnabled);
$('banned_IPs_textarea').setProperty('disabled', !isIPFilterEnabled);
};
// Speed tab
@ -1736,7 +1734,7 @@
$('peer_proxy_password_text').setProperty('value', pref.proxy_password);
// IP Filtering
$('ipfilter_enabled_checkbox').setProperty('checked', pref.ip_filter_enabled);
$('ipfilter_text_checkbox').setProperty('checked', pref.ip_filter_enabled);
$('ipfilter_text').setProperty('value', pref.ip_filter_path);
$('ipfilter_trackers_checkbox').setProperty('checked', pref.ip_filter_trackers);
$('banned_IPs_textarea').setProperty('value', pref.banned_IPs);
@ -2050,7 +2048,7 @@
settings.set('proxy_password', $('peer_proxy_password_text').getProperty('value'));
// IP Filtering
settings.set('ip_filter_enabled', $('ipfilter_enabled_checkbox').getProperty('checked'));
settings.set('ip_filter_enabled', $('ipfilter_text_checkbox').getProperty('checked'));
settings.set('ip_filter_path', $('ipfilter_text').getProperty('value'));
settings.set('ip_filter_trackers', $('ipfilter_trackers_checkbox').getProperty('checked'));
settings.set('banned_IPs', $('banned_IPs_textarea').getProperty('value'));