2 <html lang=
"${LANG}" class=
"dark">
6 <title>QBT_TR(Torrent Upload Speed Limiting)QBT_TR[CONTEXT=TransferListWidget]
</title>
7 <link rel=
"stylesheet" href=
"css/style.css?v=${CACHEID}" type=
"text/css">
8 <script src=
"scripts/lib/MooTools-Core-1.6.0-compat-compressed.js"></script>
9 <script src=
"scripts/lib/MooTools-More-1.6.0-compat-compressed.js"></script>
10 <script src=
"scripts/lib/mocha.min.js"></script>
11 <script src=
"scripts/localpreferences.js?v=${CACHEID}"></script>
12 <script src=
"scripts/color-scheme.js?v=${CACHEID}"></script>
13 <script src=
"scripts/speedslider.js?v=${CACHEID}"></script>
17 <div style=
"padding-top: 10px; width: 100%; text-align: center; margin: 0 auto; overflow: hidden">
18 <div id=
"uplimitSlider" class=
"slider">
19 <div id=
"uplimitUpdate" class=
"update">
20 <label for=
"uplimitUpdatevalue">QBT_TR(Upload limit:)QBT_TR[CONTEXT=PropertiesWidget]
</label>
21 <input type=
"text" id=
"uplimitUpdatevalue" size=
"6" placeholder=
"∞" style=
"text-align: center;">
22 <span id=
"upLimitUnit">QBT_TR(KiB/s)QBT_TR[CONTEXT=SpeedLimitDialog]
</span>
24 <div class=
"sliderWrapper">
25 <div id=
"uplimitSliderknob" class=
"sliderknob"></div>
26 <div id=
"uplimitSliderarea" class=
"sliderarea"></div>
28 <div class=
"clear"></div>
30 <input type=
"button" id=
"applyButton" value=
"QBT_TR(Apply)QBT_TR[CONTEXT=HttpServer]" onclick=
"setUpLimit()">
36 window
.addEventListener("keydown", (event
) => {
39 event
.preventDefault();
40 $("applyButton").click();
43 event
.preventDefault();
44 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
49 const hashes
= new URI().getData("hashes").split("|");
50 const setUpLimit
= () => {
51 const limit
= Number($("uplimitUpdatevalue").value
) * 1024;
52 if (hashes
[0] === "global") {
53 fetch("api/v2/transfer/setUploadLimit", {
55 body
: new URLSearchParams({
63 window
.parent
.updateMainData();
64 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
68 fetch("api/v2/torrents/setUploadLimit", {
70 body
: new URLSearchParams({
71 "hashes": hashes
.join("|"),
79 window
.parent
.qBittorrent
.Client
.closeFrameWindow(window
);
84 $("uplimitUpdatevalue").focus();
86 MochaUI
.addUpLimitSlider(hashes
);