From f989558dc2a30ca0cc5fbfc311b03857177d5530 Mon Sep 17 00:00:00 2001 From: Bobby Date: Sat, 24 Sep 2022 08:39:08 +0700 Subject: [PATCH] chore: improve uploads filter help message --- src/js/dashboard.js | 36 +++++++++++++++++++----------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/src/js/dashboard.js b/src/js/dashboard.js index dbf5697..69cc1da 100644 --- a/src/js/dashboard.js +++ b/src/js/dashboard.js @@ -1146,21 +1146,21 @@ page.uploadFiltersHelp = element => { content.style = 'text-align: left' content.innerHTML = `${all ? `There are 2 filter keys, namely user (username) and ip. - These keys can be specified more than once. + user and ip keys can be specified more than once. For usernames with whitespaces, wrap them with double quotes ("). - Special cases such as uploads by non-registered users or have no IPs respectively, use user:- or ip:-. + To match uploads by non-registered users, or have no IPs respectively, use user:- or ip:-. - To exclude certain users/ips while still listing every other uploads, add negation sign (-) before the keys. - Negation sign can also be used to exclude the special cases mentioned above (i.e. -user:- or -ip:-). + To exclude certain users/IPs while still listing every other uploads, add negation sign (-) before the keys. + Negation signs can also be used to exclude uploads by non-registered users, or have no IPs (i.e. -user:- or -ip:-). If you know the ID of a user's album, you can list its uploads with albumid key. Negation sign works for this key as well.` : `There is only 1 filter key, namely albumid. - This key can be specified more than once. - Special case such as uploads with no albums, use albumid:-. + albumid key can be specified more than once. + To match uploads with no albums, use albumid:-. To exclude certain albums while still listing every other uploads, add negation sign (-) before the keys. - Negation sign can also be used to exclude the special case mentioned above (i.e. -albumid:-).`} + Negation sign can also be used to exclude uploads with no albums (i.e. -albumid:-).`} There are 2 range keys: date (upload date) and expiry (expiry date). Their format is: "YYYY/MM/DD HH:MM:SS-YYYY/MM/DD HH:MM:SS" ("from" date and "to" date respectively), @@ -1171,37 +1171,39 @@ page.uploadFiltersHelp = element => { If only time is specified, today's date will be used. If you do not need to specify both date and time, you may omit the double quotes. In conclusion, the following examples are all valid: date:"2020/01/01 01:23-2018/01/01 06", expiry:-2020/05, date:12:34:56. - These keys can only be specified once each. + date and expiry keys can only be specified once each. - Timezone? Feel free to query the dates with your own timezone. + What about timezones? + Feel free to query the dates in your own timezone. API requests to the filter endpoint will attach your browser's timezone offset, so the server will automatically calculate timezone differences. Matches can also be sorted with sort keys. - Their formats are: sort:columnName[:d[escending]], where :d[escending] is an optional tag to set the direction to descending. + Their format is: sort:columnName[:d[escending]], where :d[escending] is an optional tag to set the direction to descending. This key must be used with internal column names used in the database (id, ${all ? 'userid' : 'albumid'}, and so on), but there are 2 shortcuts available: date for timestamp column and expiry for expirydate column. - This key can also be specified more than once, where their order will decide the sorting steps. + Set your uploads view to "List view", then hover any of the table's column headers to see tooltips displaying their internal column names. + sort key can be specified more than once, where their order will decide the sorting steps. Finally, there are type-is keys to refine by types. You can use is:image, is:video, and is:audio to list images, videos, audios respectively. This will only use image, video and audio extensions that are whitelisted internally in the safe. For images and videos specifically, they will be the ones whose thumbnails can be generated by the safe. Negation sign works for this key as well. - Mixing inclusion and exclusion is not allowed (i.e. is:image -is:video, since the second key is redundant). + Mixing inclusion and exclusion is not allowed (i.e. is:image -is:video), since the second key will be redundant. - Any leftover keywords which do not use keys (non-keyed keywords) will be matched against the matches' file names. + Any leftover keywords which do not use keys (non-keyed keywords) will be matched against the matches' randomly generated and original names. Excluding certain keywords is also supported by adding negation sign before the keywords. Internal steps: ${all ? `- Query uploads passing ALL exclusion filter keys OR matching ANY filter keys, if any. - Refine matches` - : '- Filter uploads'} using date key, if any. - - Refine matches using expiry key, if any. - - Refine matches using type-is keys, if any. + : '- Filter uploads'} using date key, if any. + - Refine matches using expiry key, if any. + - Refine matches using type-is keys, if any. - Refine matches using ANY non-keyed keywords, if any. - Filter matches using ALL exclusion non-keyed keywords, if any. - - Sort matches using sorting keys, if any. + - Sort matches using sort keys, if any. Examples: ${all