mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2024-11-29 05:48:47 +03: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", "Password"),
|
||||
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__[] = {
|
||||
|
|
|
@ -263,11 +263,12 @@ void RequestHandler::action_command_upload()
|
|||
QBtSession::instance()->addTorrent(filePath);
|
||||
// Clean up
|
||||
fsutils::forceRemove(filePath);
|
||||
print(QLatin1String("<script type=\"text/javascript\">window.parent.hideAll();</script>"));
|
||||
}
|
||||
else
|
||||
{
|
||||
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() {
|
||||
if (this.readyState == this.DONE) {
|
||||
if (this.status == 200)
|
||||
if (this.status == 200) {
|
||||
window.parent.closeWindows();
|
||||
else
|
||||
alert("Upload Failed!");
|
||||
} else {
|
||||
if (this.responseText != "") {
|
||||
alert(this.responseText);
|
||||
} else {
|
||||
alert("_(Upload Failed!)");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue