2022-06-08 15:36:54 +00:00
|
|
|
import { MantineTheme } from '@mantine/core';
|
2022-07-23 22:22:55 +02:00
|
|
|
import { OptionValues } from '../modules/ModuleTypes';
|
2022-05-22 20:42:10 +02:00
|
|
|
|
2022-05-01 14:46:06 +02:00
|
|
|
export interface Settings {
|
|
|
|
|
searchUrl: string;
|
2022-06-07 07:20:44 +02:00
|
|
|
title?: string;
|
|
|
|
|
logo?: string;
|
|
|
|
|
favicon?: string;
|
2022-06-08 15:36:54 +00:00
|
|
|
primaryColor?: MantineTheme['primaryColor'];
|
|
|
|
|
secondaryColor?: MantineTheme['primaryColor'];
|
|
|
|
|
primaryShade?: MantineTheme['primaryShade'];
|
2022-06-07 17:36:05 +00:00
|
|
|
background?: string;
|
2022-06-08 16:03:06 +00:00
|
|
|
appOpacity?: number;
|
2022-06-12 08:04:20 +02:00
|
|
|
widgetPosition?: string;
|
2022-06-14 17:45:22 +00:00
|
|
|
appCardWidth?: number;
|
2022-05-01 14:46:06 +02:00
|
|
|
}
|
2022-04-30 21:34:41 +02:00
|
|
|
|
|
|
|
|
export interface Config {
|
2022-05-12 19:28:10 +02:00
|
|
|
name: string;
|
2022-04-30 21:34:41 +02:00
|
|
|
services: serviceItem[];
|
2022-05-01 14:46:06 +02:00
|
|
|
settings: Settings;
|
2022-05-22 20:42:10 +02:00
|
|
|
modules: {
|
|
|
|
|
[key: string]: ConfigModule;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface ConfigModule {
|
|
|
|
|
title: string;
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
options: {
|
|
|
|
|
[key: string]: OptionValues;
|
|
|
|
|
};
|
2022-04-30 21:39:59 +02:00
|
|
|
}
|
2022-05-01 14:46:06 +02:00
|
|
|
|
2022-06-16 17:07:29 -04:00
|
|
|
export const StatusCodes = [
|
2022-06-21 16:21:40 +02:00
|
|
|
{ value: '200', label: '200 - OK', group: 'Sucessful responses' },
|
|
|
|
|
{ value: '204', label: '204 - No Content', group: 'Sucessful responses' },
|
|
|
|
|
{ value: '301', label: '301 - Moved Permanently', group: 'Redirection responses' },
|
|
|
|
|
{ value: '302', label: '302 - Found / Moved Temporarily', group: 'Redirection responses' },
|
|
|
|
|
{ value: '304', label: '304 - Not Modified', group: 'Redirection responses' },
|
|
|
|
|
{ value: '307', label: '307 - Temporary Redirect', group: 'Redirection responses' },
|
|
|
|
|
{ value: '308', label: '308 - Permanent Redirect', group: 'Redirection responses' },
|
|
|
|
|
{ value: '400', label: '400 - Bad Request', group: 'Client error responses' },
|
|
|
|
|
{ value: '401', label: '401 - Unauthorized', group: 'Client error responses' },
|
|
|
|
|
{ value: '403', label: '403 - Forbidden', group: 'Client error responses' },
|
|
|
|
|
{ value: '404', label: '404 - Not Found', group: 'Client error responses' },
|
|
|
|
|
{ value: '408', label: '408 - Request Timeout', group: 'Client error responses' },
|
|
|
|
|
{ value: '410', label: '410 - Gone', group: 'Client error responses' },
|
|
|
|
|
{ value: '429', label: '429 - Too Many Requests', group: 'Client error responses' },
|
|
|
|
|
{ value: '500', label: '500 - Internal Server Error', group: 'Server error responses' },
|
|
|
|
|
{ value: '502', label: '502 - Bad Gateway', group: 'Server error responses' },
|
|
|
|
|
{ value: '503', label: '503 - Service Unavailable', group: 'Server error responses' },
|
|
|
|
|
{ value: '054', label: '504 - Gateway Timeout Error', group: 'Server error responses' },
|
|
|
|
|
];
|
2022-06-16 15:38:50 -04:00
|
|
|
|
2022-06-16 17:07:29 -04:00
|
|
|
export const Targets = [
|
2022-06-21 16:21:40 +02:00
|
|
|
{ value: '_blank', label: 'New Tab' },
|
|
|
|
|
{ value: '_top', label: 'Same Window' },
|
|
|
|
|
];
|
2022-06-16 15:38:50 -04:00
|
|
|
|
2022-05-02 15:11:28 +02:00
|
|
|
export const ServiceTypeList = [
|
|
|
|
|
'Other',
|
2022-06-27 17:27:59 +02:00
|
|
|
'Dash.',
|
2022-05-26 21:06:17 +02:00
|
|
|
'Deluge',
|
2022-07-21 18:29:35 +01:00
|
|
|
'Emby',
|
2022-05-02 15:11:28 +02:00
|
|
|
'Lidarr',
|
|
|
|
|
'Plex',
|
2022-07-21 18:29:35 +01:00
|
|
|
'qBittorrent',
|
2022-05-22 20:42:10 +02:00
|
|
|
'Radarr',
|
2022-05-25 10:50:57 +02:00
|
|
|
'Readarr',
|
2022-05-22 20:42:10 +02:00
|
|
|
'Sonarr',
|
2022-06-06 21:38:50 +02:00
|
|
|
'Transmission',
|
2022-05-02 15:11:28 +02:00
|
|
|
];
|
|
|
|
|
export type ServiceType =
|
|
|
|
|
| 'Other'
|
2022-06-27 21:29:44 +02:00
|
|
|
| 'Dash.'
|
2022-05-26 21:06:17 +02:00
|
|
|
| 'Deluge'
|
2022-07-21 18:29:35 +01:00
|
|
|
| 'Emby'
|
2022-05-02 15:11:28 +02:00
|
|
|
| 'Lidarr'
|
|
|
|
|
| 'Plex'
|
2022-07-21 18:47:13 +01:00
|
|
|
| 'qBittorrent'
|
2022-05-22 20:42:10 +02:00
|
|
|
| 'Radarr'
|
2022-05-25 10:50:57 +02:00
|
|
|
| 'Readarr'
|
2022-07-21 18:29:35 +01:00
|
|
|
| 'Sonarr'
|
2022-06-06 21:38:50 +02:00
|
|
|
| 'Transmission';
|
2022-05-01 14:46:06 +02:00
|
|
|
|
2022-07-22 16:18:36 +02:00
|
|
|
export function tryMatchPort(name: string, form?: any) {
|
|
|
|
|
// Match name with portmap key
|
|
|
|
|
const port = portmap.find((p) => p.name === name.toLowerCase());
|
|
|
|
|
if (form && port) {
|
|
|
|
|
form.setFieldValue('url', `http://localhost:${port.value}`);
|
|
|
|
|
}
|
|
|
|
|
return port;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const portmap = [
|
|
|
|
|
{ name: 'qbittorrent', value: '8080' },
|
|
|
|
|
{ name: 'sonarr', value: '8989' },
|
|
|
|
|
{ name: 'radarr', value: '7878' },
|
|
|
|
|
{ name: 'lidarr', value: '8686' },
|
|
|
|
|
{ name: 'readarr', value: '8787' },
|
|
|
|
|
{ name: 'deluge', value: '8112' },
|
|
|
|
|
{ name: 'transmission', value: '9091' },
|
|
|
|
|
{ name: 'dash.', value: '3001' },
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
export const MatchingImages: {
|
|
|
|
|
image: string;
|
|
|
|
|
type: ServiceType;
|
|
|
|
|
}[] = [
|
2022-07-21 18:43:42 +01:00
|
|
|
//Official images
|
2022-07-21 18:29:35 +01:00
|
|
|
{ image: 'mauricenino/dashdot', type: 'Dash.' },
|
2022-07-21 18:43:42 +01:00
|
|
|
{ image: 'emby/embyserver', type: 'Emby' },
|
|
|
|
|
{ image: 'plexinc/pms-docker', type: 'Plex' },
|
2022-07-22 16:18:36 +02:00
|
|
|
//Lidarr images
|
2022-07-21 18:43:42 +01:00
|
|
|
{ image: 'hotio/lidarr', type: 'Lidarr' },
|
|
|
|
|
{ image: 'ghcr.io/hotio/lidarr', type: 'Lidarr' },
|
|
|
|
|
{ image: 'cr.hotio.dev/hotio/lidarr', type: 'Lidarr' },
|
2022-07-22 16:18:36 +02:00
|
|
|
// Plex
|
2022-07-21 18:50:27 +01:00
|
|
|
{ image: 'hotio/plex', type: 'Plex' },
|
|
|
|
|
{ image: 'ghcr.io/hotio/plex', type: 'Plex' },
|
|
|
|
|
{ image: 'cr.hotio.dev/hotio/plex', type: 'Plex' },
|
2022-07-22 16:18:36 +02:00
|
|
|
// qbittorrent
|
2022-07-21 18:50:27 +01:00
|
|
|
{ image: 'hotio/qbittorrent', type: 'qBittorrent' },
|
|
|
|
|
{ image: 'ghcr.io/hotio/qbittorrent', type: 'qBittorrent' },
|
|
|
|
|
{ image: 'cr.hotio.dev/hotio/qbittorrent', type: 'qBittorrent' },
|
2022-07-22 16:18:36 +02:00
|
|
|
// Radarr
|
2022-07-21 18:50:27 +01:00
|
|
|
{ image: 'hotio/radarr', type: 'Radarr' },
|
|
|
|
|
{ image: 'ghcr.io/hotio/radarr', type: 'Radarr' },
|
2022-07-21 18:43:42 +01:00
|
|
|
{ image: 'cr.hotio.dev/hotio/radarr', type: 'Radarr' },
|
2022-07-22 16:18:36 +02:00
|
|
|
// Readarr
|
2022-07-21 18:50:27 +01:00
|
|
|
{ image: 'hotio/readarr', type: 'Readarr' },
|
|
|
|
|
{ image: 'ghcr.io/hotio/readarr', type: 'Readarr' },
|
2022-07-21 18:43:42 +01:00
|
|
|
{ image: 'cr.hotio.dev/hotio/readarr', type: 'Readarr' },
|
2022-07-22 16:18:36 +02:00
|
|
|
// Sonarr
|
2022-07-21 18:50:27 +01:00
|
|
|
{ image: 'hotio/sonarr', type: 'Sonarr' },
|
2022-07-22 16:18:36 +02:00
|
|
|
{ image: 'ghcr.io/hotio/sonarr', type: 'Sonarr' },
|
|
|
|
|
{ image: 'cr.hotio.dev/hotio/sonarr', type: 'Sonarr' },
|
2022-07-21 18:43:42 +01:00
|
|
|
//LinuxServer images
|
2022-07-21 18:29:35 +01:00
|
|
|
{ image: 'lscr.io/linuxserver/deluge', type: 'Deluge' },
|
|
|
|
|
{ image: 'lscr.io/linuxserver/emby', type: 'Emby' },
|
|
|
|
|
{ image: 'lscr.io/linuxserver/lidarr', type: 'Lidarr' },
|
|
|
|
|
{ image: 'lscr.io/linuxserver/plex', type: 'Plex' },
|
|
|
|
|
{ image: 'lscr.io/linuxserver/qbittorrent', type: 'qBittorrent' },
|
2022-07-20 14:08:56 +02:00
|
|
|
{ image: 'lscr.io/linuxserver/radarr', type: 'Radarr' },
|
2022-07-21 18:29:35 +01:00
|
|
|
{ image: 'lscr.io/linuxserver/readarr', type: 'Readarr' },
|
2022-07-20 14:08:56 +02:00
|
|
|
{ image: 'lscr.io/linuxserver/sonarr', type: 'Sonarr' },
|
2022-07-22 16:18:36 +02:00
|
|
|
{ image: 'lscr.io/linuxserver/transmission', type: 'Transmission' },
|
|
|
|
|
// LinuxServer but on Docker Hub
|
|
|
|
|
{ image: 'linuxserver/deluge', type: 'Deluge' },
|
|
|
|
|
{ image: 'linuxserver/emby', type: 'Emby' },
|
|
|
|
|
{ image: 'linuxserver/lidarr', type: 'Lidarr' },
|
|
|
|
|
{ image: 'linuxserver/plex', type: 'Plex' },
|
|
|
|
|
{ image: 'linuxserver/qbittorrent', type: 'qBittorrent' },
|
|
|
|
|
{ image: 'linuxserver/radarr', type: 'Radarr' },
|
|
|
|
|
{ image: 'linuxserver/readarr', type: 'Readarr' },
|
|
|
|
|
{ image: 'linuxserver/sonarr', type: 'Sonarr' },
|
|
|
|
|
{ image: 'linuxserver/transmission', type: 'Transmission' },
|
2022-07-21 18:43:42 +01:00
|
|
|
//High usage
|
|
|
|
|
{ image: 'markusmcnugen/qbittorrentvpn', type: 'qBittorrent' },
|
2022-07-22 16:18:36 +02:00
|
|
|
{ image: 'haugene/transmission-openvpn', type: 'Transmission' },
|
2022-07-20 14:08:56 +02:00
|
|
|
];
|
|
|
|
|
|
2022-05-01 14:46:06 +02:00
|
|
|
export interface serviceItem {
|
2022-05-21 01:26:24 +02:00
|
|
|
id: string;
|
2022-05-01 14:46:06 +02:00
|
|
|
name: string;
|
|
|
|
|
type: string;
|
|
|
|
|
url: string;
|
|
|
|
|
icon: string;
|
2022-05-29 10:45:49 +02:00
|
|
|
category?: string;
|
2022-05-21 01:02:45 +02:00
|
|
|
apiKey?: string;
|
2022-05-26 18:16:00 +02:00
|
|
|
password?: string;
|
|
|
|
|
username?: string;
|
2022-06-06 18:26:29 +02:00
|
|
|
openedUrl?: string;
|
2022-06-20 09:52:05 +02:00
|
|
|
newTab?: boolean;
|
|
|
|
|
status?: string[];
|
2022-05-01 14:46:06 +02:00
|
|
|
}
|