mirror of
https://github.com/Carve/qbittorrent-webui-cjratliff.com.git
synced 2024-11-15 03:07:38 +01:00
88 lines
3.1 KiB
HTML
88 lines
3.1 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="${LANG}">
|
|
|
|
<head>
|
|
<meta charset="UTF-8" />
|
|
<title>Torrent Upload Speed Limiting</title>
|
|
<link rel="stylesheet" href="css/style.css?v=${CACHEID}" type="text/css" />
|
|
<script src="scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
|
|
<script src="scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
|
|
<script src="scripts/lib/mocha.min.js"></script>
|
|
<script src="scripts/speedslider.js?v=${CACHEID}"></script>
|
|
</head>
|
|
|
|
<body>
|
|
<div style="width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
|
|
<div id="uplimitSlider" class="slider">
|
|
<div id="uplimitUpdate" class="update">Upload limit: <input id="uplimitUpdatevalue" size="6" placeholder="∞" style="text-align: center;"> <span id="upLimitUnit">QBT_TR(KiB/s</span></div>
|
|
<div class="sliderWrapper">
|
|
<div id="uplimitSliderknob" class="sliderknob"></div>
|
|
<div id="uplimitSliderarea" class="sliderarea"></div>
|
|
</div>
|
|
<div class="clear"></div>
|
|
</div>
|
|
<script>
|
|
'use strict';
|
|
|
|
const hashes = new URI().getData('hashes').split('|');
|
|
const setUpLimit = function() {
|
|
const limit = $("uplimitUpdatevalue").value.toInt() * 1024;
|
|
if (hashes[0] == "global") {
|
|
new Request({
|
|
url: 'api/v2/transfer/setUploadLimit',
|
|
method: 'post',
|
|
data: {
|
|
'limit': limit
|
|
},
|
|
onComplete: function() {
|
|
window.parent.updateMainData();
|
|
window.parent.closeWindows();
|
|
}
|
|
}).send();
|
|
}
|
|
else {
|
|
new Request({
|
|
url: 'api/v2/torrents/setUploadLimit',
|
|
method: 'post',
|
|
data: {
|
|
'hashes': hashes.join('|'),
|
|
'limit': limit
|
|
},
|
|
onComplete: function() {
|
|
window.parent.closeWindows();
|
|
}
|
|
}).send();
|
|
}
|
|
};
|
|
</script>
|
|
<input type="button" id="applyButton" value="Apply" onclick="setUpLimit()" />
|
|
</div>
|
|
|
|
<script>
|
|
new Keyboard({
|
|
defaultEventType: 'keydown',
|
|
events: {
|
|
'Enter': function(event) {
|
|
$('applyButton').click();
|
|
event.preventDefault();
|
|
},
|
|
'Escape': function(event) {
|
|
window.parent.closeWindows();
|
|
event.preventDefault();
|
|
},
|
|
'Esc': function(event) {
|
|
window.parent.closeWindows();
|
|
event.preventDefault();
|
|
}
|
|
}
|
|
}).activate();
|
|
|
|
$('uplimitUpdatevalue').focus();
|
|
|
|
MochaUI.addUpLimitSlider(hashes);
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|