Redesign Web API

Normalize Web API method names.
Allow to use alternative Web UI.
Switch Web API version to standard form (i.e. "2.0").
Improve Web UI translation code.
Retranslate changed files.
Add Web API for RSS subsystem.
This commit is contained in:
Vladimir Golovnev (Glassez)
2017-10-14 16:27:21 +03:00
parent 0fc1ad664f
commit 27d8dbf13b
90 changed files with 4817 additions and 3038 deletions

View File

@@ -0,0 +1,87 @@
<!DOCTYPE html>
<html lang="${LANG}">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</title>
<link rel="icon" type="image/png" href="images/skin/qbittorrent16.png" />
<link rel="stylesheet" type="text/css" href="css/style.css" />
<script type="text/javascript" src="scripts/mootools-1.2-core-yc.js" charset="utf-8"></script>
<script type="text/javascript">
window.onload = function() {
$('username').focus();
$('username').select();
}
window.addEvent('domready', function() {
$('loginform').addEvent('submit', function(e) {
new Event(e).stop();
submitLoginForm();
});
});
function submitLoginForm() {
new Request({
url: 'api/v2/auth/login',
method: 'post',
data: $('loginform').toQueryString(),
onComplete: function() {
$('password').set('value', '');
},
onFailure: function(xhr) {
if (xhr.responseText != "") {
$('error_msg').set('html', xhr.responseText);
} else {
$('error_msg').set('html', 'QBT_TR(Unable to log in, qBittorrent is probably unreachable.)QBT_TR[CONTEXT=HttpServer]');
}
},
onSuccess: function(text) {
if (text == "Ok.") {
// Session started. Simply reload page.
window.location.reload();
} else {
$('error_msg').set('html', 'QBT_TR(Invalid Username or Password.)QBT_TR[CONTEXT=HttpServer]');
}
}
}).send();
}
</script>
<style type="text/css">
.col {
display: inline-block;
vertical-align: middle;
}
.row {
margin-bottom: 5px;
}
#main {
margin-left: auto;
margin-right: auto;
text-align: center;
padding-top: 5em;
}
#formplace {
text-align: left;
padding: 10px;
}
#error_msg {
color: #f00;
}
</style>
</head>
<body>
<div id="main">
<h1>qBittorrent QBT_TR(Web UI)QBT_TR[CONTEXT=OptionsDialog]</h1>
<div id="logo" class="col">
<img src="images/skin/qbittorrent-tray.svg" alt="qBittorrent logo" style="height: 11em;"/>
</div>
<div id="formplace" class="col">
<form id="loginform">
<div class="row"><label for="username">QBT_TR(Username)QBT_TR[CONTEXT=HttpServer]</label><br /><input type="text" id="username" name="username" /></div>
<div class="row"><label for="password">QBT_TR(Password)QBT_TR[CONTEXT=HttpServer]</label><br /><input type="password" id="password" name="password" /></div>
<div class="row"><input type="submit" id="login" value="QBT_TR(Login)QBT_TR[CONTEXT=HttpServer]" /></div>
</form>
</div>
<div id="error_msg"></div>
</div>
</body>
</html>