mirror of
https://github.com/idanoo/autobrr
synced 2025-07-26 02:09:13 +00:00
refactor: various frontend improvements (#101)
* Removed recoil and replaced it with react-ridge-state, a 0.4kb alternative. * Added AuthContext and SettingsContext persistent localStorage states. * Fixed tailwind.config.js incorrect key directive. See https://tailwindcss.com/docs/content-configuration#safelisting-classes. * Changed darkMode in Tailwind to "class" and started manually adjusting the theme according to the appropriate media query. * Added possibility of changing the theme manually via the Settings tab. * Changed Releases.tsx behavior to show the UI only when the HTTP request succeeded and there is some data (i.e. table is non-empty). * Changed the table color of screens/filters/list.tsx to a one notch lighter shade of gray for eye-comfort. * Replaced "User" in the header, with the users real username. * Made data version, commit and date fields optional in settings/Application.tsx. * Started working on a RegExp playground, which works fine, but JS won't cooperate and return the right match length. Either way, the RegExp must be implemented on backend and then must be communicated with the frontend. Otherwise a potential for incorrect results exists. * Removed Layout.tsx, since it was redundant. * Created a Checkbox component class for easier and consistent future use. * Rewritten App.tsx, Login.tsx, Logout.tsx to accomodate for new changes. * Fixed previous mistake regarding tailwind.config.js purge key, since we're still using old postcss7 from October last year * Removed package-lock.json from both root and web directories. * Refresh TypeScript configuration to support a types/ directory containing d.ts. The effect of this is that types don't have to be imported anymore and are at all times available globally. This also unifies them into a single source of truth, which will be a lot easier to manage in the future. Note: Only certain interop types have been moved at the time of writing. * Fixed minor Checkbox argument mistake. * fix: remove length from data check * chore: lock files are annoying * fix: select * fix: wip release filtering
This commit is contained in:
parent
53d75ef4d5
commit
20138030e1
40 changed files with 2596 additions and 2453 deletions
65
web/src/types/Action.d.ts
vendored
Normal file
65
web/src/types/Action.d.ts
vendored
Normal file
|
@ -0,0 +1,65 @@
|
|||
interface Action {
|
||||
id: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
type: ActionType;
|
||||
exec_cmd: string;
|
||||
exec_args: string;
|
||||
watch_folder: string;
|
||||
category: string;
|
||||
tags: string;
|
||||
label: string;
|
||||
save_path: string;
|
||||
paused: boolean;
|
||||
ignore_rules: boolean;
|
||||
limit_upload_speed: number;
|
||||
limit_download_speed: number;
|
||||
client_id: number;
|
||||
filter_id: number;
|
||||
}
|
||||
|
||||
interface Filter {
|
||||
id: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
shows: string;
|
||||
min_size: string;
|
||||
max_size: string;
|
||||
match_sites: string[];
|
||||
except_sites: string[];
|
||||
delay: number;
|
||||
years: string;
|
||||
resolutions: string[];
|
||||
sources: string[];
|
||||
codecs: string[];
|
||||
containers: string[];
|
||||
match_release_types: string[];
|
||||
quality: string[];
|
||||
formats: string[];
|
||||
match_hdr: string[];
|
||||
except_hdr: string[];
|
||||
log_score: number;
|
||||
log: boolean;
|
||||
cue: boolean;
|
||||
perfect_flac: boolean;
|
||||
artists: string;
|
||||
albums: string;
|
||||
seasons: string;
|
||||
episodes: string;
|
||||
match_releases: string;
|
||||
except_releases: string;
|
||||
match_release_groups: string;
|
||||
except_release_groups: string;
|
||||
match_categories: string;
|
||||
except_categories: string;
|
||||
tags: string;
|
||||
except_tags: string;
|
||||
match_uploaders: string;
|
||||
except_uploaders: string;
|
||||
freeleech: boolean;
|
||||
freeleech_percent: string;
|
||||
actions: Action[];
|
||||
indexers: Indexer[];
|
||||
}
|
||||
|
||||
type ActionType = 'TEST' | 'EXEC' | 'WATCH_FOLDER' | DownloadClientType;
|
20
web/src/types/Download.d.ts
vendored
Normal file
20
web/src/types/Download.d.ts
vendored
Normal file
|
@ -0,0 +1,20 @@
|
|||
type DownloadClientType =
|
||||
'QBITTORRENT' |
|
||||
'DELUGE_V1' |
|
||||
'DELUGE_V2' |
|
||||
'RADARR' |
|
||||
'SONARR' |
|
||||
'LIDARR';
|
||||
|
||||
interface DownloadClient {
|
||||
id?: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
host: string;
|
||||
port: number;
|
||||
ssl: boolean;
|
||||
username: string;
|
||||
password: string;
|
||||
type: DownloadClientType;
|
||||
settings: object;
|
||||
}
|
3
web/src/types/Global.d.ts
vendored
Normal file
3
web/src/types/Global.d.ts
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
interface APP {
|
||||
baseUrl: string;
|
||||
}
|
42
web/src/types/Indexer.d.ts
vendored
Normal file
42
web/src/types/Indexer.d.ts
vendored
Normal file
|
@ -0,0 +1,42 @@
|
|||
interface Indexer {
|
||||
id: number;
|
||||
name: string;
|
||||
identifier: string;
|
||||
enabled: boolean;
|
||||
settings: object | any;
|
||||
}
|
||||
|
||||
interface IndexerSchema {
|
||||
name: string;
|
||||
identifier: string;
|
||||
description: string;
|
||||
language: string;
|
||||
privacy: string;
|
||||
protocol: string;
|
||||
urls: string[];
|
||||
settings: IndexerSchemaSettings[];
|
||||
irc: IndexerSchemaIRC;
|
||||
}
|
||||
|
||||
interface IndexerSchemaSettings {
|
||||
name: string;
|
||||
type: string;
|
||||
required: boolean;
|
||||
label: string;
|
||||
help: string;
|
||||
description: string;
|
||||
default: string;
|
||||
}
|
||||
|
||||
interface IndexerSchemaIRC {
|
||||
network: string;
|
||||
server: string;
|
||||
port: number;
|
||||
tls: boolean;
|
||||
nickserv: boolean;
|
||||
announcers: string[];
|
||||
channels: string[];
|
||||
invite: string[];
|
||||
invite_command: string;
|
||||
settings: IndexerSchemaSettings[];
|
||||
}
|
75
web/src/types/Irc.d.ts
vendored
Normal file
75
web/src/types/Irc.d.ts
vendored
Normal file
|
@ -0,0 +1,75 @@
|
|||
interface IrcNetwork {
|
||||
id: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
addr: string;
|
||||
server: string;
|
||||
port: string;
|
||||
nick: string;
|
||||
username: string;
|
||||
realname: string;
|
||||
pass: string;
|
||||
connected: boolean;
|
||||
connected_since: string;
|
||||
tls: boolean;
|
||||
nickserv: {
|
||||
account: string;
|
||||
}
|
||||
channels: IrcNetworkChannel[];
|
||||
}
|
||||
|
||||
interface IrcNetworkChannel {
|
||||
id: number;
|
||||
enabled: boolean;
|
||||
name: string;
|
||||
password: string;
|
||||
detached: boolean;
|
||||
monitoring: boolean;
|
||||
monitoring_since: string;
|
||||
last_announce: string;
|
||||
}
|
||||
|
||||
interface NickServ {
|
||||
account: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
interface Network {
|
||||
id?: number;
|
||||
name: string;
|
||||
enabled: boolean;
|
||||
server: string;
|
||||
port: number;
|
||||
tls: boolean;
|
||||
invite_command: string;
|
||||
nickserv: {
|
||||
account: string;
|
||||
password: string;
|
||||
}
|
||||
channels: Channel[];
|
||||
settings: object;
|
||||
}
|
||||
|
||||
interface Channel {
|
||||
name: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
interface SASL {
|
||||
mechanism: string;
|
||||
plain: {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
}
|
||||
|
||||
interface Config {
|
||||
host: string;
|
||||
port: number;
|
||||
log_level: string;
|
||||
log_path: string;
|
||||
base_url: string;
|
||||
version: string;
|
||||
commit: string;
|
||||
date: string;
|
||||
}
|
36
web/src/types/Release.d.ts
vendored
Normal file
36
web/src/types/Release.d.ts
vendored
Normal file
|
@ -0,0 +1,36 @@
|
|||
interface Release {
|
||||
id: number;
|
||||
filter_status: string;
|
||||
rejections: string[];
|
||||
indexer: string;
|
||||
filter: string;
|
||||
protocol: string;
|
||||
title: string;
|
||||
size: number;
|
||||
raw: string;
|
||||
timestamp: Date
|
||||
action_status: ReleaseActionStatus[]
|
||||
}
|
||||
|
||||
interface ReleaseActionStatus {
|
||||
id: number;
|
||||
status: string;
|
||||
action: string;
|
||||
type: string;
|
||||
rejections: string[];
|
||||
timestamp: Date
|
||||
}
|
||||
|
||||
interface ReleaseFindResponse {
|
||||
data: Release[];
|
||||
next_cursor: number;
|
||||
count: number;
|
||||
}
|
||||
|
||||
interface ReleaseStats {
|
||||
total_count: number;
|
||||
filtered_count: number;
|
||||
filter_rejected_count: number;
|
||||
push_approved_count: number;
|
||||
push_rejected_count: number;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue