mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-08-20 21:33:27 -07:00
WebUI: Fix WebAPI returned data.
This commit is contained in:
parent
a63d4e3400
commit
7b7f88ae4f
3 changed files with 12 additions and 5 deletions
|
@ -65,7 +65,8 @@ static const char *__TRANSLATIONS__[] = {
|
||||||
QT_TRANSLATE_NOOP("HttpServer", "Invalid Username or Password."),
|
QT_TRANSLATE_NOOP("HttpServer", "Invalid Username or Password."),
|
||||||
QT_TRANSLATE_NOOP("HttpServer", "Password"),
|
QT_TRANSLATE_NOOP("HttpServer", "Password"),
|
||||||
QT_TRANSLATE_NOOP("HttpServer", "Login"),
|
QT_TRANSLATE_NOOP("HttpServer", "Login"),
|
||||||
QT_TRANSLATE_NOOP("HttpServer", "qBittorrent web User Interface")
|
QT_TRANSLATE_NOOP("HttpServer", "qBittorrent web User Interface"),
|
||||||
|
QT_TRANSLATE_NOOP("HttpServer", "Upload Failed!")
|
||||||
};
|
};
|
||||||
|
|
||||||
static const struct { const char *source; const char *comment; } __COMMENTED_TRANSLATIONS__[] = {
|
static const struct { const char *source; const char *comment; } __COMMENTED_TRANSLATIONS__[] = {
|
||||||
|
|
|
@ -263,11 +263,12 @@ void RequestHandler::action_command_upload()
|
||||||
QBtSession::instance()->addTorrent(filePath);
|
QBtSession::instance()->addTorrent(filePath);
|
||||||
// Clean up
|
// Clean up
|
||||||
fsutils::forceRemove(filePath);
|
fsutils::forceRemove(filePath);
|
||||||
print(QLatin1String("<script type=\"text/javascript\">window.parent.hideAll();</script>"));
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
qWarning() << "I/O Error: Could not create temporary file";
|
qWarning() << "I/O Error: Could not create temporary file";
|
||||||
|
status(500, "Internal Server Error");
|
||||||
|
print(QByteArray("I/O Error: Could not create temporary file."), CONTENT_TYPE_TXT);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,10 +9,15 @@
|
||||||
|
|
||||||
function stateChangeHandler() {
|
function stateChangeHandler() {
|
||||||
if (this.readyState == this.DONE) {
|
if (this.readyState == this.DONE) {
|
||||||
if (this.status == 200)
|
if (this.status == 200) {
|
||||||
window.parent.closeWindows();
|
window.parent.closeWindows();
|
||||||
else
|
} else {
|
||||||
alert("Upload Failed!");
|
if (this.responseText != "") {
|
||||||
|
alert(this.responseText);
|
||||||
|
} else {
|
||||||
|
alert("_(Upload Failed!)");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue