1
0
mirror of https://github.com/d47081/qBittorrent.git synced 2025-01-22 20:44:15 +00:00

WebUI: alert when HTTPS settings are incomplete

Closes #17696.
PR #17701.
This commit is contained in:
Chocobo1 2022-09-13 13:00:11 +08:00 committed by GitHub
parent 021222b407
commit 4e06a9629a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2382,9 +2382,23 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings.set('web_ui_address', web_ui_address);
settings.set('web_ui_port', web_ui_port);
settings.set('web_ui_upnp', $('webui_upnp_checkbox').getProperty('checked'));
settings.set('use_https', $('use_https_checkbox').getProperty('checked'));
settings.set('web_ui_https_cert_path', $('ssl_cert_text').getProperty('value'));
settings.set('web_ui_https_key_path', $('ssl_key_text').getProperty('value'));
const useHTTPS = $('use_https_checkbox').getProperty('checked');
settings.set('use_https', useHTTPS);
const httpsCertificate = $('ssl_cert_text').getProperty('value');
settings.set('web_ui_https_cert_path', httpsCertificate);
if (useHTTPS && (httpsCertificate.length === 0)) {
alert("QBT_TR(HTTPS certificate should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
return;
}
const httpsKey = $('ssl_key_text').getProperty('value');
settings.set('web_ui_https_key_path', httpsKey);
if (useHTTPS && (httpsKey.length === 0)) {
alert("QBT_TR(HTTPS key should not be empty)QBT_TR[CONTEXT=OptionsDialog]");
return;
}
// Authentication
const web_ui_username = $('webui_username_text').getProperty('value');