Commit Graph

233 Commits

Author SHA1 Message Date
tehcneko
296c90d688 WebUI: Fix row selection by Shift key with virtual list enabled
Fixes #23336.
PR #23543.
2025-11-30 19:14:30 +08:00
tehcneko
564afc975f WebUI: Fix row collapsing with virtual list enabled
Fixes https://github.com/qbittorrent/qBittorrent/issues/23241#issuecomment-3295352816.
PR #23542.
2025-11-30 19:13:10 +08:00
Hanabishi
4a3922d152 Make the active torrents filter reflect actual transfers
PR #23431.
Closes #23121.
2025-11-24 09:03:20 +03:00
dyseg
e5026e4b19 WebUI: fix opening "Add torrent" window with double click on RSS feed item
Restores the ability to open the "Add torrent" dialogue, when double clicking on an RSS feed item.
Broke in: 02892d1250 as part of #21645.

PR #23413.
2025-10-26 22:12:36 +08:00
Tom Piccirello
4fb54d3da0 WebUI: fix adding torrent when using virtual tables
When using virtual tables we can't rely on fetching the values from the DOM. We should always fetch values directly from the file tree.

PR #23263.
Closes #23241.
2025-09-29 02:19:07 +08:00
Tom Piccirello
3b744c3dba WebUI: fix lint errors
PR #23277.
2025-09-22 10:35:21 +08:00
Chocobo1
b0148ef36c WebUI: enforce coding style
* WebUI: prefer `classList.toggle()` over other pattern
  Addresses: https://github.com/qbittorrent/qBittorrent/pull/23231#discussion_r2328647152
* WebUI: prefer using built-in objects Constructor
* WebUI: combine function calls

PR #23261.
2025-09-14 22:11:23 +08:00
Thomas (Tom) Piccirello
f651a311a4 WebUI: Fix add torrent spinner in Firefox
Firefox seems to have an issue where svgs loaded via background-url are not animated. Loading the svg directly as an img fixes this.

Related: #23074.
PR #23195.
2025-09-07 16:02:32 +08:00
anikey
56277d5e2b WebUI: add I2P peers to peer list
The WebUI part of the changes for #23061. Now qBittorrent will display I2P peers in WebUI peers tab.
Fixes the second part of #19794 ("i2p peer list does not show in GUI").

PR #23185.
2025-09-05 20:40:25 +08:00
Chocobo1
dffd27a879 WebUI: prefer range based for loop
Using `entries()` can also save the work of manually handling the index variable.

PR #23182.
2025-08-31 21:54:48 +08:00
Chocobo1
b851caa6b9 WebUI: use local preference class locally 2025-08-31 21:45:48 +08:00
Chocobo1
07f2afc4ac WebUI: move variable into proper scope 2025-08-31 21:45:48 +08:00
Chocobo1
6ac0c5a8b8 WebUI: prefer for loop over Array.forEach method
The `for` loop can do everything `forEach` can and doesn't need a closure.
2025-08-27 22:19:16 +08:00
Chocobo1
2bd0965906 WebUI: remove redundant braces in switch statements
Braces are only required when there are variable/function declarations.
2025-08-27 22:19:16 +08:00
Chocobo1
acab056fe4 WebUI: disallow number literals with zero fractions or dangling dots
Javascript treats them all the same as `Number`.
2025-08-27 22:19:16 +08:00
Chocobo1
86acc01b1a WebUI: prefer Number static properties over global ones
`Number` purpose is modularization of globals in ECMAScript 2015.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number/parseInt#number.parseint_vs._parseint
2025-08-27 22:19:16 +08:00
Thomas (Tom) Piccirello
c953730a42 WebUI: Various improvements to dynamic tables
This PR contains various small improvements to dynamic tables, mostly around reducing duplication.

Closes #22921.
PR #23081.
2025-08-26 17:01:30 +08:00
Chocobo1
d6672abb94 WebUI: use static method for getting time
Unify API usage across the code base.

PR #23077.
2025-08-11 16:47:37 +08:00
tehcneko
03fb036ae3 WebUI: Replace GIFs with SVG
Unused GIFs have been removed along with their CSS; some GIFs have been replaced with CSS, and all SVGs were drawn myself.

PR #23074.
2025-08-11 16:38:11 +08:00
tehcneko
a265ba7fd2 WebUI: Implement missing tracker list features
Implemented: Tracker endpoints in the list, missing "Tracker Error" and "Unreachable" status, "Next Announce" and "Min Announce" column and double click to edit tracker url.

PR #23045.
2025-08-11 16:20:58 +08:00
Thomas Piccirello
02892d1250 WebUI: Add new Add Torrent experience
This PR uses the new APIs from #21015 to provide a WebUI Add Torrent experience more closely matching the GUI's.

New functionality:
- View torrent size, date, infohash, files, etc.
- Reprioritize and ignore files before adding
- Specify tags when adding torrent
- Specify save path for incomplete torrent

Closes #20557, closes #10997, closes #12499, closes #14201, closes #15071, closes #15718, closes #16207.
PR #21645.
2025-08-09 18:34:38 +08:00
tehcneko
96c55c4998 WebUI: Make "column resize" strings translatable
PR #23053.
2025-08-04 18:14:55 +08:00
Chocobo1
2c6c61cc79 WebUI: migrate away from outdated config in ESLint
The following message appears when using the outdated value:
>[@stylistic/eslint-plugin]: You are using deprecated value(boolean) for "allowTemplateLiterals"
>in "quotes", please use "always"/"never" instead.

Also prefer using double quotes over backticks for strings.

PR #23038.
2025-07-28 04:33:50 +08:00
Thomas Piccirello
163f683186 WebUI: Support reannouncing individual trackers
PR #22954.
2025-07-19 15:29:14 +08:00
Thomas Piccirello
7aebd07f9f WebUI: Support managing category download path
PR #22938.
2025-07-15 01:29:03 +08:00
Thomas Piccirello
67ef356064 WebUI: Delete correct rows after re-sort
The previous logic assumed that trs was properly sorted, which is no longer the case.
Follow up to #22827.

PR #22884.
2025-06-22 15:35:07 +08:00
Thomas Piccirello
254f39f89d WebUI: Restore node default collapse state
By default, nodes should be expanded until explicitly collapsed. This restores the default behavior which changed in b4a16f6464.

Relevant: https://github.com/qbittorrent/qBittorrent/pull/21645#discussion_r2150695297

PR #22879.
2025-06-22 14:55:37 +08:00
tehcneko
d702a02c1f WebUI: Avoid forced reflow on virtual list rerender
Avoid forced synchronous layout caused by offsetHeight/scrollTop access.

PR #22858.
2025-06-22 14:27:16 +08:00
Thomas Piccirello
380d9af34c WebUI: Increase number of buffered virtual rows
Negligible performance hit for increased UX. Currently when scrolling I frequently see blank rows.

PR #22853.
2025-06-17 02:53:09 +08:00
Thomas Piccirello
406a389d7c WebUI: Improve performance of re-sorting table rows
This change drastically improves the performance of changing a table's sorted column. This performance is achieved through improved data structures, namely removing operations that repeatedly spliced an array. We also no longer iterate over a potentially large array.

On a torrent with ~50,000 files, re-rendering after a sort improves from ~20 seconds to 2 seconds.

PR #22827.
2025-06-14 21:06:33 +08:00
Chocobo1
4132173b30 WebUI: avoid redundant operations when sorting
Avoid recomputing the same result on every sort operation.
Also clean up the caller site.

PR #22821.
2025-06-08 17:08:47 +08:00
Chocobo1
4b07597d54 WebUI: migrate away from recursion
PR #22791.
2025-05-31 17:38:05 +08:00
ivan
44bb1ac7eb WebUI: Add support for tracker status filter 2025-05-27 17:12:43 +03:00
tehcneko
48f7f6fb8c WebUI: Convert 'Progress Bar' class to a custom element
Got rid of Mootools and manual calculation of width.

PR #22768.
2025-05-27 14:16:18 +08:00
bolshoytoster
a3d1ff0eb2 WebUI: Fix memory leak
See #22734, there is a memory leak in the MooTools .destroy(), this replaces all uses of that with the browser native .remove().

This also overrides the MooTools Document.id function, which is used by $(id). The original function always allocates an ID to elements it selects, the override doesn't, and is also a little more efficient.

Closes #22734.
PR  #22754.

---------

Co-authored-by: Chocobo1 <Chocobo1@users.noreply.github.com>
2025-05-25 15:41:52 +08:00
justusaac
86e4b662ce WebUI: Select multiple files to rename with Shift
Convenience feature in the "Rename Files" menu in the WebUI.
If you click one file's checkbox, and then click another with Shift held, all the checkboxes between those two will be selected/unselected based on the state of the first checkbox.
It's based on what the Windows file explorer does when holding Ctrl and Shift

Closes #22455.
PR #22610.
2025-05-10 16:08:19 +08:00
skomerko
bb68a39b53 WebUI: Prefix private properties with # in dynamic table classes 2025-04-29 21:08:26 +02:00
skomerko
4c91cd9372 WebUI: Use modern class syntax to create dynamic table classes 2025-04-29 21:08:17 +02:00
tehcneko
0791828b84 WebUI: fix virtual list defects
Fixes https://github.com/qbittorrent/qBittorrent/pull/22502#issuecomment-2822201721 and https://github.com/qbittorrent/qBittorrent/pull/22502#issuecomment-2822253388.

PR #22597.
2025-04-29 20:16:00 +08:00
Chocobo1
ad4bdc0653 Merge pull request #22615 from Chocobo1/webui_eslint
* WebUI: disallow unnecessary semicolons
* WebUI: ensure consistent shorthand syntax
* WebUI: disallow async functions which have no await expression
* WebUI: remove unused variable
2025-04-28 20:20:57 +08:00
Chocobo1
fdd17159eb WebUI: remove unused variable 2025-04-27 16:19:51 +08:00
Chocobo1
70dbe9468a WebUI: disallow unnecessary semicolons 2025-04-27 16:19:50 +08:00
skomerko
411ca0f668 WebUI: Use native function for selecting elements by ID 2025-04-23 19:55:04 +02:00
tehcneko
b4a16f6464 WebUI: Optimize table performance with virtual list
Adding virtual list support to dynamic tables to improve performance on large lists, I observed a 100x performance improvement on rendering on a torrent table with 5000 torrents.
This optimization is disabled by default and can be enabled in options.

PR #22502.
2025-04-20 17:18:26 +08:00
tehcneko
f540381caf WebUI: Support creating new torrents
Implemented the torrent creator using WebAPI from #20366 in WebUI, the interface is mostly inspired by GUI and VueTorrent.

Closes #5614.
PR #22459.
2025-04-03 17:16:12 +08:00
skomerko
8f53fb8178 WebUI: Maintain row highlight after rearranging table columns
This PR fixes a bug where row highlight effect would be lost after reordering columns.

PR #22339.
2025-03-02 17:15:21 +08:00
skomerko
ba3d89b674 WebUI: Update sort icon after changing column order
This PR fixes a bug where the sort icon did not update correctly after reordering columns.

Steps to reproduce:
1. Sort a column
2. Move it to a different position
3. The sort icon remains in its original location

PR #22299.
2025-02-23 15:13:17 +08:00
skomerko
1ca33d45ba WebUI: Access element attribute/property natively in log tables
#21007 changed pretty much everything already but I spotted some leftovers and replaced them too.

PR #22294.
2025-02-21 20:54:26 +08:00
Chocobo1
a9b54d94a0 Merge pull request #22282 from skomerko/webui-v51-fixes
WebUI v5.1 fixes
2025-02-21 20:44:42 +08:00
Chocobo1
955688c125 WebUI: replace rounding function from MooTools
The `round()` returning floating point number is not a good idea. This is due to floating point
representation is imprecise and sometimes it cannot faithfully represent a number, for example
`0.09 + 0.01 !== 0.1 `. Therefore, it should be avoided and/or utilize other function
to achieve the goal.

Also, improve `window.qBittorrent.Misc.toFixedPointString()` and add test cases.

PR #22281.
2025-02-17 15:11:55 +08:00