Commit graph

1139 commits

Author SHA1 Message Date
Luís Pereira
ac42ccb5e4
Don't create temporary containers just to iterate over them
Stops temporary containers being created needlessly due to API misuse.
For example, it’s common for developers to assume QHash::values() and
QHash::keys() are free and abuse them, failing to realize their
implementation internally actually iterates the whole container, allocates
memory, and fills a new QList.

Added a removeIf generic algorithm, similar to std ones. We can't use std
algorithms with Qt dictionaries because Qt iterators have different
behavior from the std ones.

Found using clazy.
2018-03-18 16:22:12 +03:00
Mike Tzou
68ca95faf0
Merge pull request #8603 from Chocobo1/typo
Fix typo
2018-03-17 00:49:41 +08:00
Mike Tzou
1f28122428
Merge pull request #8595 from Chocobo1/runExt
Add Tags parameter to "Run External Program"
2018-03-16 19:37:34 +08:00
Chocobo1
423511765a
Fix typo 2018-03-14 23:37:08 +08:00
Thomas Piccirello
4863078744 Use correct API method URL in WebUI
Fix up 27d8dbf.
Closes #8596.
2018-03-14 03:08:46 -04:00
Chocobo1
88881de8c6
Add Tags parameter to "Run External Program"
Closes #8586.
Also sort headers.
2018-03-14 10:12:32 +08:00
Chocobo1
141a2d2856
Prevent detach from containers 2018-03-11 22:25:07 +08:00
Mike Tzou
7233274110
Merge pull request #8562 from Chocobo1/lint
Fix warnings from clazy
2018-03-11 12:41:58 +08:00
Mike Tzou
0cacd71503
Merge pull request #8403 from Piccirello/webui-download-height
Make WebUI iframe windows scrollable on iOS. Closes #8401, #7932.
2018-03-09 19:46:29 +08:00
Chocobo1
fdf3ebbb6c
Remove usage of deprecated functions
Also use proper type for storing date/time data
2018-03-09 19:20:58 +08:00
Mike Tzou
5261d4375f
Merge pull request #8551 from Chocobo1/override
Fix warnings from linters
2018-03-09 00:36:52 +08:00
Thomas Piccirello
0b56cd5fa0 Make WebUI iframe windows scrollable on iOS
Closes #8401, #7932.
2018-03-08 01:30:13 -05:00
Vladimir Golovnev
e22946ef61
Merge pull request #8525 from glassez/url-query
Parse URL query string at application level
2018-03-07 17:16:21 +03:00
Chocobo1
0457fd260e
Avoid temporary QString allocations
This fixes clazy warning: Use multi-arg instead [-Wclazy-qstring-arg]
2018-03-07 20:06:00 +08:00
Chocobo1
c60b7b213e
Add missing 'override' specifier
This fixes clang warning:
'notify' overrides a member function but is not marked 'override'
[-Winconsistent-missing-override]
2018-03-07 20:05:52 +08:00
Chocobo1
307736e263
Fix broken WebUI
Fix up c47e4efade.
Closes #8545.
2018-03-06 14:03:01 +08:00
Mike Tzou
7aa5bc4bc1
Merge pull request #8484 from Piccirello/improve-webui-stats
Improve WebUI stats dialog (addendum to #8349)
2018-03-06 00:49:49 +08:00
Thomas Piccirello
c47e4efade Save WebUI Statistics window size 2018-03-05 01:40:21 -05:00
Vladimir Golovnev (Glassez)
1aca3b0adc
Parse URL query string at application level 2018-03-04 17:08:48 +03:00
Tom Piccirello
1a9b009951 Enable Statistics window to be scrolled and resized
Text may go offscreen due to translations.
2018-03-02 02:18:42 -05:00
Vladimir Golovnev (Glassez)
34456a7459
Fix Legacy Web API to be fully available 2018-02-28 18:25:48 +03:00
Mike Tzou
6f7f7d87c6
Merge pull request #8218 from Piccirello/webui-selection-bug
Reselect webui torrents after full_update. Temporary fix for #8209.
2018-02-27 13:33:39 +08:00
Thomas Piccirello
2227c3afc1 Reselect torrents in WebUI after full update
Temp fix for #8209.
2018-02-25 01:09:06 -05:00
Mike Tzou
050af8a793
Merge pull request #7894 from Piccirello/auto-management
Disable options when Force Proxy is enabled
2018-02-25 01:44:58 +08:00
Thomas Piccirello
4110bb874f Right align stat values 2018-02-23 14:54:31 -05:00
Thomas Piccirello
5c74f374af Re-order and rename stats 2018-02-23 14:54:24 -05:00
Thomas Piccirello
a8420a43f9 Format Read cache hits as percentage 2018-02-23 14:46:47 -05:00
Vladimir Golovnev
5c2f698cb4
Merge pull request #8325 from luis-pereira/prevent-c++11-range-loop-detach
Prevent possible c++11 range-loop container detach
2018-02-22 16:28:04 +03:00
Luís Pereira
1a913c502b Prevent possible c++11 range-loop container detach
Explicit or implicit calls to begin() and end() cause a non-const
container to detach from shared data, ie. to perform a deep-copy to gain
a unique copy of the data.
That can be a expensive although unneeded operation.

In order to assist the developer a copyAsConst function is added.
copyAsConst returns a const copy of the object.

For lvalues just use qAsConst. It's only available on Qt 5.7.0. But we
added also for earlier versions. The developer can always use qAsConst.

Intended uses:

    QString s = ...;
    for (const auto &ch : qAsConst(s))
          process(ch);

    for (const auto &ch : copyAsConst(funcReturningQString()))
        process(ch);
2018-02-20 19:28:51 +00:00
Vladimir Golovnev
3035184d25
Merge pull request #8445 from glassez/fix-webapi
Fix POST params handling. Closes #8443
2018-02-20 11:11:33 +03:00
Thomas Piccirello
e0c74c2d39 Remove conditionals 2018-02-20 02:22:40 -05:00
Thomas Piccirello
288f372914 Rename onClick property to onclick 2018-02-20 02:16:16 -05:00
Thomas Piccirello
ba331436fa Add More Information link 2018-02-20 02:16:16 -05:00
Thomas Piccirello
afd4069eb4 Disable options when force proxy is enabled 2018-02-20 02:16:15 -05:00
Vladimir Golovnev
387f9b1230
Merge pull request #8438 from Piccirello/webui-proxy-only
Add "Use proxy only for torrents" option to webui
2018-02-20 09:06:30 +03:00
Mike Tzou
b87ca60c5a
Merge pull request #8134 from Piccirello/webui-show-status-bar
Add option to show/hide webui status bar
2018-02-20 00:09:09 +08:00
Mike Tzou
6d44075662
Merge pull request #8228 from Piccirello/webui-save-window-size
WebUI Save user's resized windows
2018-02-20 00:02:32 +08:00
Thomas Piccirello
69af205094 Use .each(). Refactor conditionals. 2018-02-18 23:54:48 -05:00
Thomas Piccirello
8a2e3f5d93 Add option to show/hide webui status bar 2018-02-18 23:46:27 -05:00
Thomas Piccirello
3f79726ab9 Make download + upload windows resizable 2018-02-18 22:50:21 -05:00
Thomas Piccirello
d1c4b1599a WebUI Save user's resized window sizes 2018-02-18 22:50:21 -05:00
Vladimir Golovnev (Glassez)
29042e4841
Fix wrong WebAPI param name 2018-02-18 19:54:08 +03:00
Thomas Piccirello
0d55599e02 Add "Use proxy only for torrents" option to webui 2018-02-17 21:25:42 -05:00
Luís Pereira
ea1b0b26b1 Don't implicitly cast iterator to const_iterator
It prevents detachments:
To illustrate:

QMap<QString, QString> map;
/* code compiles and works fine but find() returns the non-const
   QMap::iterator that detaches!
*/
QMap<QString, QString>::const_iterator it = map.find("girish");

but also some subtle bugs:

QHash<int, int> wrong;
if (wrong.find(1) == wrong.cend()) {
    qDebug() << "Not found";
} else {
    /* find() detached the container before cend() was called, so it
       prints "Found"
    */
    qDebug() << "Found";
}

QHash<int, int> right;
if (right.constFind(1) == right.cend()) {
    qDebug() << "Not found"; // This is correct now !
} else {
    qDebug() << "Found";
}

Enforced by QT_STRICT_ITERATORS definition.
2018-02-17 17:02:52 +00:00
Vladimir Golovnev (Glassez)
27d8dbf13b
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.
2018-01-28 19:16:24 +03:00
Vladimir Golovnev (Glassez)
bb683bd393
Switch built-in Web UI html to HTML5 2018-01-23 11:08:37 +03:00
Vladimir Golovnev
56ccf28000
Merge pull request #8133 from Piccirello/webui-statistics-format
WebUI Statistics parity with GUI
2018-01-23 10:15:39 +03:00
Vladimir Golovnev
0a45fc9ffe
Merge pull request #7990 from Piccirello/subnet-whitelist-refactor
Refactor ip subnet whitelist
2018-01-23 10:03:00 +03:00
Tom Piccirello
ebea0d91af Remove default case, fix #8302 2018-01-22 02:05:41 -05:00
Thomas Piccirello
65e0aa6b82 Add default case 2018-01-18 23:30:19 -05:00
Thomas Piccirello
6d0cceca83 Use switch statement 2018-01-18 00:15:13 -05:00
Thomas Piccirello
8e9b928b61 Match webui statuses to gui, closes #7516 2018-01-18 00:15:12 -05:00
sledgehammer999
95c32221a2
Update copyright year. 2018-01-06 02:23:09 +02:00
Thomas Piccirello
9b919b6c34 Add missing units 2018-01-05 02:48:41 -05:00
Thomas Piccirello
49d3b7bf30 Right-align stat values 2018-01-05 02:48:41 -05:00
Chocobo1
ec337a8a84
Sort filename lists in .pri files 2017-12-31 11:53:45 +08:00
Thomas Piccirello
ddd6c82dd7 Use https for www.qbittorrent.org 2017-12-26 18:22:03 -05:00
Vladimir Golovnev
155dc49c5a
Merge pull request #7914 from Piccirello/webui-columns
Webui add torrent columns to match gui
2017-12-26 22:03:07 +03:00
sledgehammer999
94b64884f8
Merge pull request #7997 from Piccirello/webui-content-columns
Add "Remaining" and "Availability" columns to webui Content tab
2017-12-23 20:32:46 +02:00
Chocobo1
fb6bdbefd5
WebUI: Only prepend scheme when it is not present. Closes #8057. 2017-12-18 14:12:31 +08:00
Thomas Piccirello
0f6dff6315 Make value formatting consistent with GUI 2017-12-12 01:25:06 -05:00
Thomas Piccirello
97b4e4a3d3 Add "Remaining" and "Availability" columns to webui Content tab 2017-12-12 01:25:06 -05:00
Vladimir Golovnev (Glassez)
fcde1ba09c
Fix WebUI is not reachable via IPv6 2017-12-09 09:57:19 +03:00
Thomas Piccirello
d184bd8c82 Perform ip string validation inside setWebUiAuthSubnetWhitelist 2017-12-06 02:05:33 -05:00
Thomas Piccirello
a05562cdc5 Add Time Active column 2017-12-03 15:01:35 -05:00
Thomas Piccirello
ee37f1db3d Add Tags columns 2017-12-03 15:01:35 -05:00
sledgehammer999
2124ef261a
Merge pull request #7964 from Chocobo1/typeError
[WebUI] Fix logout behavior
2017-12-02 14:23:38 +02:00
Chocobo1
b234fcec9c
[WebUI] Use POST for logout command
This is to avoid browser being smart to prefetch the link then logging
out the user.
2017-12-02 14:32:40 +08:00
Chocobo1
1a45145c1e
[WebUI] Add check to avoid type error after logout 2017-12-02 14:32:40 +08:00
Chocobo1
c1a282aa7b
Fix missing qbt logo on login page in webUI. Closes #7953. 2017-12-02 14:31:48 +08:00
Thomas Piccirello
e1f8e6aa6f Reposition Total Size column to match gui 2017-11-26 19:37:20 -05:00
sledgehammer999
4e96a1065e
Bump API_VERSION to 16. 2017-11-22 01:14:33 +02:00
Chocobo1
27090f0cfb
Remove superfluous QString::fromUtf8() 2017-11-21 22:48:00 +08:00
Chocobo1
77f66be493
[WebUI] Fix logo missing in login page 2017-11-21 03:41:07 +08:00
Vladimir Golovnev
f41cb8089d
Merge pull request #6779 from Piccirello/disable-web-auth
Add ip subnet whitelist for bypassing webui auth
2017-11-20 21:52:33 +03:00
sledgehammer999
af5a02d971
Merge pull request #7673 from sledgehammer999/webui_clean_exit
WebUI: Correctly exit depending if mainloop is running.
2017-11-19 19:12:30 +02:00
Vladimir Golovnev (Glassez)
71bb6538db
Fix WebUI error handling 2017-11-19 19:10:04 +02:00
Mike Tzou
d821bdc9f3
Merge pull request #7669 from Chocobo1/portCheck
[WebAPI] Improve error messages
2017-11-10 23:41:19 +08:00
Thomas Piccirello
95bf63330e Add ip subnet whitelist for bypassing webui auth 2017-11-08 22:39:49 -05:00
sledgehammer999
ffa6f7ea34
Bump API_VERSION to 16. 2017-11-03 01:57:32 +02:00
Chocobo1
aa4107478e
[WebAPI] Improve error messages
Also refactor to use class methods
2017-11-02 23:01:14 +08:00
Chocobo1
fc0628d35b
Allow SMTP sender to be set. Closes #7575. 2017-10-26 17:57:32 +08:00
Mike Tzou
acdb7a27dc Merge pull request #7638 from Chocobo1/msg
[WebUI] Improve log messages
2017-10-24 20:19:12 +08:00
Mike Tzou
b6be5afb89 Merge pull request #7584 from Chocobo1/refactor
[WebAPI] Refactor
2017-10-23 19:36:28 +08:00
Chocobo1
157b809e21
[WebUI] Improve log messages 2017-10-23 16:45:41 +08:00
Mike Tzou
f74e2b0130 Merge pull request #7631 from Chocobo1/webUIaddr
Reinitialize webUI server when "IP address" setting changed
2017-10-23 14:11:50 +08:00
sledgehammer999
c887a162ba
Fix row height/width in webui for country flags.
Patch by Chocobo1.
2017-10-23 01:23:54 +03:00
sledgehammer999
52df71ad3a
Use svg icons for the country flags.
Closes #6223.
2017-10-23 01:23:45 +03:00
Chocobo1
d6ddc90199
Reinitialize webUI server when "IP address" setting changed
An app restart won't be necessary from now on.
2017-10-22 14:42:51 +08:00
Mike Tzou
9600e7f5ad Merge pull request #7573 from fmatthew5876/config_webui_ip
Add WebUi\Address config option
2017-10-22 14:18:08 +08:00
Matthew Fioravante
8cd243b06b Add WebUi\Address config option 2017-10-21 09:32:30 -04:00
Chocobo1
ce362f0e5e
WebAPI refactor: utilize parseBool() function
Coding style cleanup
Rename variable
Return const reference
Add const
2017-10-18 22:27:59 +08:00
Chocobo1
4940a77d12
[WebUI]: Print error messages upon receiving invalid header fields 2017-10-18 20:11:53 +08:00
Mike Tzou
bd07cb91bb Merge pull request #7571 from Chocobo1/webui_download
[WebAPI] Add parameters for /command/download & /command/upload
2017-10-15 20:32:14 +08:00
Mike Tzou
dc600d47ec Merge pull request #7570 from Chocobo1/webui_fileIdx
[WebAPI] Add file-to-piece-index mappings in /query/propertiesFiles command
2017-10-14 01:05:00 +08:00
Chocobo1
e78d8b9fcc
Convert tab into whitespaces 2017-10-11 20:27:19 +08:00
Chocobo1
f350977cb4
WebUI: add optional parameters for /command/download & /command/upload
Specifically:
torrent name: string
download limit, upload limit: number in bytes, default: -1 (unlimited)
sequential download, first last piece prio: boolean true/false, default: false
2017-10-11 20:25:11 +08:00
Eugene Shalygin
7a652c0a8c Merge pull request #7566 from evsh/themes-cbc
Themes part 1
2017-10-11 10:34:56 +02:00
Chocobo1
a652baadb5
Add file-to-piece-index mappings in /query/propertiesFiles command
Also do the following cleanups:
  Use string constant QB_EXT
  Remove redundant variable
  Add const
2017-10-11 16:24:29 +08:00
Mike Tzou
e07501252c Merge pull request #7549 from fmatthew5876/master
Report TCPServer errorString() if webui fails to listen to port
2017-10-11 16:22:52 +08:00
Eugene Shalygin
db35bb54e1 Make BitTorrent::TorrentState strongly-typed enum
This is needed to forward declare this type and pass it by value.

Conversion from/to QVariant are hanled via Q_DECLARE_METATYPE, while
TorrentState::toString() function was used in webui only and as such is
moved there.
2017-10-10 21:28:57 +02:00
Chocobo1
5185eeb7ef
Die gracefully when failed to initialize web server with qbt-nox 2017-10-09 13:50:01 +08:00
Vladimir Golovnev
083bc71315 Merge pull request #7396 from thalieht/updownratio
Properly pre-select the selected torrent's current ratio limiting options in UpDownRatioDlg
2017-10-08 21:06:55 +03:00
thalieht
525fdd6c2b Coding style, use nullptr and other minor things 2017-10-08 10:20:54 +03:00
Matthew Fioravante
05c92e652c Report TCPServer errorString() if webui fails to listen to port 2017-10-06 05:54:52 +00:00
Vladimir Golovnev
66a6674cbc Merge pull request #7490 from glassez/category-path
Allow to set explicit save path for Category from GUI
2017-09-29 14:25:40 +03:00
Vladimir Golovnev (Glassez)
3ec992474d
Implement TorrentCategoryDialog class 2017-09-27 21:25:22 +03:00
Mike Tzou
2eb3ec1a6e Merge pull request #7463 from Piccirello/fix-priority-context-menu-placement
Reposition "Priority" menu option in WebUI to match gui (closes #7072)
2017-09-24 10:28:05 +08:00
Chocobo1
c5ddbcfb5b
WebAPI: fix addPaused wrong default behavior
Add helper function
Sort include header
2017-09-19 17:26:01 +08:00
Chocobo1
72b0ba36ae
Refactor
Merge statements
Use case-insensitive contains()
Add const
Use value(), this avoids inserting empty values.
Use range based for loop
2017-09-19 14:16:39 +08:00
Chocobo1
b107c0671d
WebAPI: fix root_folder default behavior
Bug was introduced in
6b33db3ae3
2017-09-19 13:07:50 +08:00
sledgehammer999
b9e233601d Merge pull request #7446 from Chocobo1/utpOnly
Add uTP only mode option
2017-09-19 01:45:58 +03:00
Chocobo1
45a0c5558a
Add comboBox for selecting BitTorrent protocol. Closes #6316.
Use unicode string C_UTP in place of "uTP"
2017-09-18 01:52:57 +08:00
Thomas Piccirello
b6596f9957 Reposition "Priority" menu option in WebUI to match gui (closes #7072) 2017-09-17 05:42:46 -04:00
thalieht
6b33db3ae3 Create root folder option when adding a torrent in WebUI 2017-09-11 16:56:33 +03:00
Allan Nordhøy
5c18db240c Spelling: HTTP/HTTPS 2017-09-08 11:22:25 +02:00
Chocobo1
64d5e329c0
Sort the resource lists
Update RCC header
2017-08-29 13:39:02 +08:00
Chocobo1
9ef1e32327
WebAPI: fix validating wrong header field. Closes #7311.
X-Forwarded-Host is a foreign proxy setting, it isn't the same as
qbt's local setting and thus it makes no sense to verify it.
2017-08-20 22:40:19 +08:00
Chocobo1
65ca490b64
Wrap class & functions in anonymous namespace
Rename vars
Cleanup class interfaces
Pass by reference whenever possible
2017-08-19 01:57:11 +08:00
Thomas Piccirello
4846b0ec28
Use single quotes for char.
Use case insensitive compare.
Swap conditionals
2017-08-14 23:15:03 +08:00
Thomas Piccirello
771033a449
Add auto torrent management to webui context menu (addresses #6815) 2017-08-14 23:14:46 +08:00
Mike Tzou
0522db3f19 Merge pull request #7061 from Piccirello/webui-rename-torrent
Rename torrent from webui context menu (addresses #6815)
2017-08-13 23:39:35 +08:00
Vladimir Golovnev (qlassez)
cff6a64e9f
Use qUtf8Printable() for logging strings
qDebug(), qInfo(), qWarning(), qCritical(), qFatal() expect %s arguments
to be UTF-8 encoded, while qPrintable() converts to local 8-bit encoding.
Therefore qUtf8Printable() should be used for logging strings instead of
qPrintable().
2017-08-13 16:14:57 +03:00
Thomas Piccirello
798c230634
Add option to rename torrent from WebUI
Addresses #6815.
2017-08-13 15:45:51 +03:00
Chocobo1
3e9311b096
Correctly handle translation
Fixup of 07a85a1018
2017-08-06 17:20:01 +08:00
Chocobo1
1bfb8d35cd
Move "Copy hash" menu item above "Copy magnet link"
Fix wrong "Copy hash" icon used in webUI
Fixup of 145641ac41
2017-08-06 17:19:55 +08:00
Tom Piccirello
07a85a1018 Set torrent location from webui context menu (addresses #6815) (#7062)
* Add option to set torrent location from webui context menu (addresses #6815)

* Update debug messages

* Use logger

* Remove redundant curly braces

* Remove message

* Use log message from transferlistwidget

* Use QDir

* Remove unused import

* Check if newLocation is an empty string
2017-08-06 17:04:39 +08:00
Tom Piccirello
145641ac41 Add copy options to webui context menu (addresses #6815) (#7036)
* Add copy options to webui context menu
Add Copy Hash to gui (closes #6964)

* Use switch statement

* Use camel case, switch from signal to qaction.

* Rename variable

* Change variable name
2017-08-06 16:35:12 +08:00
sledgehammer999
802cd89ec9
Bump API_VERSION and API_VERSION_MIN to 15. 2017-07-18 22:38:59 +03:00
Tom Piccirello
11b44407af Add Status column to webui (addresses #6815) (#7032)
* Add Status column to webui (addresses #6815)
2017-07-17 14:26:52 +08:00
Chocobo1
07780b48c5 Load the domain list at least once on startup.
Fixup of 0532d546d7
2017-07-13 00:41:30 +08:00
Chocobo1
0532d546d7
Implement HTTP host header filtering
This filtering is required to defend against DNS rebinding attack.
2017-07-12 17:26:13 +03:00
Chocobo1
18651c8d01
Use Qt5 connect syntax 2017-07-12 17:26:11 +03:00
Chocobo1
55e038b165
Avoid modifing request headers 2017-07-12 17:26:05 +03:00
Chocobo1
be61e8f2fd Revert back to intended fallthrough
Partial revert a7f4ea8b18
2017-07-10 00:36:56 +08:00
Chocobo1
448d937c15 Fix value comparison. Closes #7081.
`category` could be 'undefined'.
Fixup of a7f4ea8b18.
2017-07-09 22:31:14 +08:00
Mike Tzou
db2dec3d28 Merge pull request #7031 from Piccirello/fix-js-errors
Fix various javascript errors and follow best practices
2017-07-05 15:03:09 +08:00
Thomas Piccirello
a7f4ea8b18 Fix javascript errors and follow best practices 2017-07-01 03:28:35 -04:00
Thomas Piccirello
cd5a55d711 Skip username/password check for active sessions (closes #6860) 2017-07-01 03:26:15 -04:00
Chocobo1
cdb8f4bc61 [WebUI] relax CSRF defense. Closes #6882.
Allow HTTP request which has neither Origin nor Referer header included
2017-06-02 21:16:06 +08:00
Chocobo1
087856d3d8
[WebUI]: Implement CSRF defense
Bump API version
2017-06-01 19:37:57 +03:00
Eugene Shalygin
74cecb1b6c Replace C-style casts with C++ ones 2017-05-29 17:25:42 +02:00
Mike Tzou
20f6bf817e Merge pull request #6836 from Chocobo1/api
[WebAPI] Get piece information/state
2017-05-27 18:28:22 +08:00
Mike Tzou
b6080c19c2 Merge pull request #6834 from Chocobo1/cookie
[WebUI] Make cookie parsing robust
2017-05-26 23:56:35 +08:00
Chocobo1
3933790bda Add new webUI API. Closes #6457.
Now getting piece information for a specific torrent is possible via:

* Returns an array of states (integers) of pieces in order. Defined as:
  "0=not downloaded", "1=downloading", "2=downloaded".
  GET /query/getPieceStates/<torrent_hash>

* Returns an array of hashes (strings) of pieces in order:
  GET /query/getPieceHashes/<torrent_hash>
2017-05-26 14:37:03 +08:00
Chocobo1
f35a5c8085 [WebUI] Make cookie parsing robust
Previously cookie name such as "<any string>SID" will be mistakenly
accepted as "SID" session ID, this commit fixes it.

Use QString::isEmpty()
2017-05-25 18:45:07 +08:00
Mike Tzou
ced52e3269 Merge pull request #6827 from naikel/webui_filter_fix
Fix slow filtering in WebUI
2017-05-24 00:02:22 +08:00
Naikel Aparicio
03b2decab6 Fix slow filtering in WebUI. Fixup 7aadf644e0. 2017-05-22 09:19:03 -04:00
Naikel Aparicio
9fc6de77ca Cosmetic fixes for WebUI upload and download windows 2017-05-20 16:01:24 -04:00
Chocobo1
5529a7713c Set icon height in html instead of js
Fixup of d302e4fb92
2017-05-19 00:06:10 +08:00
Chocobo1
d302e4fb92 [WebUI] Fix connection status icon too large. Closes #6804. 2017-05-18 23:07:40 +08:00
Naikel Aparicio
9ba00d7035 Implemented share limit by seeding time 2017-05-17 14:33:17 -04:00
Mike Tzou
0838f64311 Merge pull request #6782 from Piccirello/strict-csp
Use less permissive Content Security Policy
2017-05-17 18:47:51 +08:00
Mike Tzou
d80abeb10f Merge pull request #6751 from thalieht/webuiUnitPrecision
WebUI: Increase the number of digits after the decimal point
2017-05-17 12:48:03 +08:00
Mike Tzou
0f7eabfa4b Merge pull request #6781 from Piccirello/torrent-download-api-response
Include response status in upload torrent API
2017-05-17 00:39:55 +08:00
Thomas Piccirello
7cf1d844b0 Return status indicating if at least one torrent was successfully added 2017-05-15 14:30:44 -04:00
Thomas Piccirello
1b5852ad0b Use less permissive Content Security Policy
Adjust content order
2017-05-14 20:26:15 -04:00
Vladimir Golovnev (Glassez)
8a6d8f3953 Use cached SessionStatus and CacheStatus 2017-05-10 13:24:37 +03:00
thalieht
e075274177 webUI: increase the number of digits after the decimal point 2017-05-05 20:09:04 +03:00
sledgehammer999
b1f1823c65
[WebUI]Use the same layout in the Speed tab in preferences as the GUI. 2017-05-05 16:41:41 +03:00
sledgehammer999
0addeafc6b
Add missing unit sizes in misc.js 2017-05-05 16:41:40 +03:00
sledgehammer999
44c5a9beff
[WebUI]Use translatable strings in Statistics dialog. 2017-05-05 16:41:39 +03:00
sledgehammer999
e177799ada
[WebUI]Make the context obligatory for translatable strings. Also delete duplicate strings from extra translations. 2017-05-05 03:46:33 +03:00
Mike Tzou
e91a5f6a5a Merge pull request #6701 from Chocobo1/webui
WebUI: Fix checkbox hidden
2017-04-30 13:35:02 +08:00
Chocobo1
5e50d8ed91 WebUI: Fix checkbox hidden. Closes #6642. 2017-04-29 23:12:04 +08:00
Eugene Shalygin
c4e16aa820 cmake: set warning and error options
The set is far from perfect, but guards against common errors with GCC.
2017-04-29 13:30:28 +02:00
Vladimir Golovnev (Glassez)
989a70fe60 Redesign RSS subsystem 2017-04-23 09:03:46 +03:00
sledgehammer999
018574e546 Merge pull request #6475 from OpenGG/master
[WebUI-API] Add "skip_checking" and "paused" to "/command/download" and "/command/upload"
2017-04-17 17:12:24 +03:00
Chocobo1
7f346b49a7 Refactor: move the validation of certificates & key functions under Server class
Rename method
Add log messages
2017-04-10 21:18:59 +08:00
Chocobo1
05d8c46bb0 Rename class variables 2017-04-10 21:07:08 +08:00
Chocobo1
35ab86d32f Refactor: group port forwarding code together
Unify log message
2017-04-10 20:14:19 +08:00
sledgehammer999
e40444d1ad
Bump API_VERSION and API_VERSION_MIN to 13. 2017-04-06 02:03:44 +03:00
sledgehammer999
1111ca9d90 Merge pull request #6548 from Chocobo1/cookie
Fixes for AbstractWebApplication
2017-04-05 18:37:51 +03:00
FranciscoPombal
829ad2e1e6 fixed "remaining" column in WebUI
the key had the wrong name. In the js code, the expected key is "amount_left" and not "remaining".
2017-04-03 16:20:01 +01:00
opengg
b271fa9f00 [WebUI] Add skip_checking and paused to /command/download and /command/upload 2017-03-31 14:05:19 +08:00
Chocobo1
272d53fdf8 Set cookie SID value to empty on logout
Set cookie SID expiration date to 1 day in the past on logout
2017-03-22 17:22:10 +08:00
Chocobo1
4e48408eaa Fire up the timer to clean inactive sessions 2017-03-22 17:21:10 +08:00
Chocobo1
e26b30a5f4 Refactor: initialize class variable directly 2017-03-22 17:20:28 +08:00
Chocobo1
e4d6fe2d02 Refactor: reorder headers 2017-03-22 17:20:27 +08:00
Chocobo1
e9bd75f4e1 Set HttpOnly attribute to SID cookie 2017-03-21 15:24:41 +08:00
sledgehammer999
147f4d76e2 Merge pull request #6445 from Chocobo1/fix
Follow http user-agent format
2017-03-07 23:38:14 +02:00
sledgehammer999
5084c01c2b Merge pull request #5877 from dzmat/to_pull_request
locally banned IP list managment (Closes #1837 )
2017-03-07 23:14:20 +02:00
sledgehammer999
140187649d Merge pull request #6473 from FranciscoPombal/stats_webui
Implement statistics window in web UI
2017-03-07 22:51:57 +02:00
dzmat
59de1af31b implemented UI for managment of locally banned IP list (Closes #1837 ) 2017-03-06 19:40:34 +07:00
Chocobo1
cb1646be32 Prepend QBT_ for preprocessor variables 2017-03-06 13:41:58 +08:00
FranciscoPombal
1ce71fc63e Implement statistics window in web UI 2017-03-06 03:05:18 +00:00
sledgehammer999
fc49856857 Merge pull request #6391 from Chocobo1/cert
Allow QSsl::Ec as private key format
2017-03-06 01:22:09 +02:00
sledgehammer999
fa1149e1f2
Remove remnant of qt4 version checking. 2017-03-06 00:53:25 +02:00
Eugene Shalygin
008d7dbedc Raise minimal Qt version to 5.5.1 2017-03-05 22:24:59 +01:00
Eugene Shalygin
e64bb1de8c Drop Qt 4 support 2017-03-05 22:24:59 +01:00
sledgehammer999
922fec44d2 Merge pull request #6447 from buinsky/master
WebUI: Improve performance of updating 'progress' column
2017-03-05 14:46:30 +02:00
buinsky
b6c6b70915 Improve performance of updating 'progress' column 2017-03-04 12:19:36 +03:00
sledgehammer999
5c730f984d
Bump API_VERSION to 12. 2017-03-03 22:31:58 +02:00
Chocobo1
0fb3b18a8f
Utilize escapeHtml 2017-03-03 21:28:32 +02:00
Chocobo1
eba45a0b26
Cleanup 2017-03-03 21:28:29 +02:00
Chocobo1
7756dd80f3
[WebUI]: add X-XSS-Protection, X-Content-Type-Options, CSP header 2017-03-03 21:28:28 +02:00
ngosang
f5ad04766f
[WebUI] Avoid clickjacking attacks 2017-03-03 21:28:27 +02:00
sledgehammer999
31b69ae6f6
Update copyright year. 2017-03-03 21:26:38 +02:00
Chocobo1
759bf4d73d Allow to load/use ECDSA certificate in webUI.
Limit max read size
Improve messages in dialogs
Refactor
2017-02-17 12:23:51 +08:00
Chocobo1
511796f74e Replace rand() by a true uniform distribution generator 2017-02-16 12:21:26 +08:00
ngosang
e6e0ecfaea [Web UI] Fix category in torrent upload. Closes #6260 2017-01-22 14:20:48 +01:00
buinsky
484e021ca2 Avoid lags in firefox on resizing progress column 2017-01-21 16:37:34 +03:00
buinsky
741e0a08ea Remove 300px limit of column width 2017-01-21 16:21:46 +03:00
buinsky
7628490def Fix scrollbar covers menu item with long text 2017-01-21 15:57:02 +03:00
buinsky
d50a7778fe Implement resizable progress bar in "Done" column 2017-01-21 15:57:02 +03:00
buinsky
09cf93521f Follow project coding style. Issue #2192. 2017-01-21 15:57:02 +03:00
buinsky
e65a628bf9 Add a vertical separator between columns 2017-01-21 15:57:02 +03:00
buinsky
bdf736b7d7 Prevent text wrapping in menus 2017-01-21 15:57:02 +03:00
buinsky
3dfcd6db6a Make too tall menus scrollable 2017-01-21 15:57:02 +03:00
buinsky
134e4c1eb9 Add some missing columns to dynamic tables 2017-01-21 15:57:02 +03:00
buinsky
a087d146df Fix columns names 2017-01-21 15:57:02 +03:00
buinsky
3ac87f22cb Implement dynamic table columns hiding 2017-01-21 15:57:02 +03:00
buinsky
56b885995c Implement dynamic table columns reordering 2017-01-21 15:57:02 +03:00
buinsky
56c07704d8 Implement dynamic table columns resizing 2017-01-21 15:57:02 +03:00
buinsky
c765d8ebe2 Add tooltips to dynamic table header 2017-01-21 15:57:02 +03:00
buinsky
dd1959abfb Make torrent peers table scrollable horizontally 2017-01-21 15:57:02 +03:00
buinsky
b1c45901f0 Simplify dynamic table CSS styles 2017-01-21 15:57:01 +03:00
buinsky
7aadf644e0 Make torrents table scrollable horizontally 2017-01-21 11:19:43 +03:00
buinsky
afd4f89693 Rename variables in DynamicTable class 2017-01-21 11:19:42 +03:00
sledgehammer999
96f9984823
Fix preferences icon loading in WebUI. 2017-01-20 18:54:36 +02:00
Chocobo1
ca77a315d9 Fix download & upload icon too large on statusbar in webui 2017-01-20 14:04:32 +08:00
Chocobo1
35921c70fe Remove trailing spaces 2017-01-20 14:04:05 +08:00
sledgehammer999
dcab1da8ab Merge pull request #6138 from Chocobo1/stats2
Use the numbers from tracker scrape response
2017-01-19 11:49:47 +02:00
Chocobo1
ecd49148d0 Fix webUI used the wrong value. Closes #6232. 2017-01-19 13:17:39 +08:00
sledgehammer999
ba03fb30f3 Merge pull request #5987 from Chocobo1/temp_dir
Put temp files in .qBittorrent directory
2017-01-19 01:33:57 +02:00
sledgehammer999
a33ff12123 Merge pull request #6203 from okeatime/webui_proxy
Webui proxy_type bug fix
2017-01-18 19:15:50 +02:00
Eugene Shalygin
9bab229108 Adjust icons names to better fit FDO scheme
An icon theme may use variously styled icons for various types of UI
elements. For example, Breeze theme uses monochrome icons for actions
(toolbars) and statuses, but colourful for view contents. qBittorrent
was using icon names without putting attention to categories, creating
mix of styles in UI elements (i.e. the main toolbar).

This commit fixes icon names (and move some of them to theme) to avoid
this style mixes where possible.

Unfortunately, options dialog page icons for network and speed limits
are remained monochrome because there are no Breeze or Adwaita icons to
match.
2017-01-18 18:03:33 +01:00
Chocobo1
df274e6457 Fix statusIcon too large. Closes #6228. 2017-01-13 22:53:24 +08:00
Oke Atime
84fe40c492
Webui proxy_type bug fix 2017-01-05 18:43:54 +09:00
sledgehammer999
283511116e New translations: Icelandic, Latvian, Malay, Occitan, Uzbek
Also re-run lupdate.
2016-12-13 02:09:28 +02:00
sledgehammer999
0caf03130c Bump API_VERSION and API_VERSION_MIN to 11. 2016-12-12 22:11:06 +02:00
Chocobo1
cffa729ac5 Put temp files in .qBittorrent directory. Closes #4462. 2016-12-01 01:39:27 +08:00
Chocobo1
bb4e67684c QJson: update to 5e3b9b84b225f4612e09ef05aa6d8c23379e4e71 2016-11-04 01:33:25 +08:00
sledgehammer999
05f4270d01 WEBUI: Changed meaning of the value of the 'dl_limit', 'up_limit', 'alt_dl_limit' and 'alt_up_limit' tokens.
The value is expressed in bytes and not in KiB.
2016-11-01 18:25:36 +02:00
sledgehammer999
a5ae86512a Rename IP filtering functions and settings names. 2016-11-01 03:06:58 +02:00
sledgehammer999
124eddc68c Merge pull request #5342 from glassez/session
Optimize BitTorrent::Session settings applying
2016-11-01 03:02:29 +02:00
sledgehammer999
3ea81be2cc Merge pull request #5731 from thalieht/webui_port
Fix WEBUI port overflow
2016-09-13 23:54:01 +03:00
thalieht
6ec1c61b06 fix webui port overflow 2016-09-11 23:41:14 +03:00
Vladimir Golovnev (Glassez)
bb17d4a8dd Show type name in btjson.cpp@processMap assert
This may help to solve #5381
2016-06-20 16:08:10 +03:00
Vladimir Golovnev (Glassez)
b5fe749f0b Use new libtorrent-1.1 settings API 2016-06-20 08:30:02 +03:00
Vladimir Golovnev (Glassez)
b2cb473b63 Don't use Preferences in BitTorrent::Session 2016-06-20 08:30:02 +03:00
sledgehammer999
57a4b9f8b6 Fix API_VERSION and API_VERSION_MIN numbers. 2016-06-20 02:15:11 +03:00
sledgehammer999
00b5d52eab Merge pull request #5227 from ngosang/addtrackers
[WebUI] Expose Add trackers feature
2016-05-23 16:53:45 -05:00
Gabriele
01b73bf704 WebUI: Add command to get the logs
Add /query/getLog and /query/getPeerLog to respectively retrieve
the main log and the peer log.

GET /query/getLog
Params:
 - normal (bool): include normal messages (default true)
 - info (bool): include info messages (default true)
 - warning (bool): include warning messages (default true)
 - critical (bool): include critical messages (default true)
 - last_known_id (int): exclude messages with id <= 'last_known_id'

GET /query/getPeerLog
Params:
 - last_known_id (int): exclude messages with id <= 'last_known_id'
2016-05-17 12:13:59 +02:00
Ibrahim Tachijian
2cef805ab6 Add 'Added on' column in Webui. Closes #5145,#1092,#738 2016-05-10 15:23:24 +00:00
ngosang
30b52b9825 [WebUI] Expose Add trackers feature 2016-05-07 15:17:01 +02:00
sledgehammer999
4c79a1d766 Bump API_VERSION to 11. 2016-04-17 19:57:08 +03:00
sledgehammer999
2a20855c17 Merge pull request #4661 from buinsky/WebUI_labels_menu
WebUI: Implement labels filter context menu
2016-04-17 11:36:58 -05:00
Eugene Shalygin
f050f15a0c cmake: fix Qt resources linkage. Closes #5080
Qt resource is innitialized by a static object constructor (see
https://wiki.qt.io/QtResources). When we put resources into a static
library, the linker removes that static objects and thus the resources
themselves. To correct that we append resources to the main executable
sources list. This is done via custom function qbt_target_sources which
knows where to read the executable' name.
2016-04-17 01:06:24 +02:00
sledgehammer999
93d8cadaaf Bump API_VERSION and API_VERSION_MIN. 2016-03-29 23:15:11 +03:00