mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 16:59:12 +00:00
parent
e0aaa0bcab
commit
286f2f53f7
20 changed files with 61 additions and 63 deletions
|
@ -14,8 +14,8 @@
|
||||||
<title>autobrr</title>
|
<title>autobrr</title>
|
||||||
<base href="{{.BaseUrl}}">
|
<base href="{{.BaseUrl}}">
|
||||||
<script>
|
<script>
|
||||||
window.APP = {}
|
window.APP = {};
|
||||||
window.APP.baseUrl = "{{.BaseUrl}}"
|
window.APP.baseUrl = "{{.BaseUrl}}";
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body class="bg-color">
|
<body class="bg-color">
|
||||||
|
|
|
@ -8,7 +8,7 @@ import { AuthContext, SettingsContext } from "./utils/Context";
|
||||||
import { ErrorPage } from "./components/alerts";
|
import { ErrorPage } from "./components/alerts";
|
||||||
import Toast from "./components/notifications/Toast";
|
import Toast from "./components/notifications/Toast";
|
||||||
|
|
||||||
export const queryClient = new QueryClient({
|
const queryClient = new QueryClient({
|
||||||
defaultOptions: {
|
defaultOptions: {
|
||||||
queries: {
|
queries: {
|
||||||
// The retries will have exponential delay.
|
// The retries will have exponential delay.
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import type { FieldProps } from "formik";
|
import type { FieldProps } from "formik";
|
||||||
import { Field, Form, Formik, FormikErrors, FormikValues } from "formik";
|
import { Field, Form, Formik, FormikErrors, FormikValues } from "formik";
|
||||||
|
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import DEBUG from "../../components/debug";
|
import DEBUG from "../../components/debug";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
|
@ -18,6 +17,7 @@ interface filterAddFormProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
function FilterAddForm({ isOpen, toggle }: filterAddFormProps) {
|
function FilterAddForm({ isOpen, toggle }: filterAddFormProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(filter: Filter) => APIClient.filters.create(filter),
|
(filter: Filter) => APIClient.filters.create(filter),
|
||||||
|
|
|
@ -1,12 +1,11 @@
|
||||||
import { Fragment } from "react";
|
import { Fragment } from "react";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import type { FieldProps } from "formik";
|
import type { FieldProps } from "formik";
|
||||||
import { Field, Form, Formik, FormikErrors, FormikValues } from "formik";
|
import { Field, Form, Formik, FormikErrors, FormikValues } from "formik";
|
||||||
|
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import DEBUG from "../../components/debug";
|
import DEBUG from "../../components/debug";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
|
@ -17,6 +16,8 @@ interface apiKeyAddFormProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
function APIKeyAddForm({ isOpen, toggle }: apiKeyAddFormProps) {
|
function APIKeyAddForm({ isOpen, toggle }: apiKeyAddFormProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(apikey: APIKey) => APIClient.apikeys.create(apikey),
|
(apikey: APIKey) => APIClient.apikeys.create(apikey),
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import React, { Fragment, useRef, useState } from "react";
|
import React, { Fragment, useRef, useState } from "react";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||||
import { classNames, sleep } from "../../utils";
|
import { classNames, sleep } from "../../utils";
|
||||||
import { Form, Formik, useFormikContext } from "formik";
|
import { Form, Formik, useFormikContext } from "formik";
|
||||||
import DEBUG from "../../components/debug";
|
import DEBUG from "../../components/debug";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { DownloadClientTypeOptions, DownloadRuleConditionOptions } from "../../domain/constants";
|
import { DownloadClientTypeOptions, DownloadRuleConditionOptions } from "../../domain/constants";
|
||||||
|
|
||||||
|
@ -516,6 +515,8 @@ export function DownloadClientAddForm({ isOpen, toggle }: formProps) {
|
||||||
const [isSuccessfulTest, setIsSuccessfulTest] = useState(false);
|
const [isSuccessfulTest, setIsSuccessfulTest] = useState(false);
|
||||||
const [isErrorTest, setIsErrorTest] = useState(false);
|
const [isErrorTest, setIsErrorTest] = useState(false);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(client: DownloadClient) => APIClient.download_clients.create(client),
|
(client: DownloadClient) => APIClient.download_clients.create(client),
|
||||||
{
|
{
|
||||||
|
@ -691,6 +692,8 @@ export function DownloadClientUpdateForm({ client, isOpen, toggle }: updateFormP
|
||||||
const [isErrorTest, setIsErrorTest] = useState(false);
|
const [isErrorTest, setIsErrorTest] = useState(false);
|
||||||
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(client: DownloadClient) => APIClient.download_clients.update(client),
|
(client: DownloadClient) => APIClient.download_clients.update(client),
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { SlideOver } from "../../components/panels";
|
import { SlideOver } from "../../components/panels";
|
||||||
|
@ -39,6 +38,8 @@ export function FeedUpdateForm({ isOpen, toggle, feed }: UpdateProps) {
|
||||||
const [isTestSuccessful, setIsSuccessfulTest] = useState(false);
|
const [isTestSuccessful, setIsSuccessfulTest] = useState(false);
|
||||||
const [isTestError, setIsErrorTest] = useState(false);
|
const [isTestError, setIsErrorTest] = useState(false);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(feed: Feed) => APIClient.feeds.update(feed),
|
(feed: Feed) => APIClient.feeds.update(feed),
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,22 +1,18 @@
|
||||||
import React, { Fragment, useState } from "react";
|
import React, { Fragment, useState } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
|
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
|
||||||
import type { FieldProps } from "formik";
|
import type { FieldProps } from "formik";
|
||||||
import { Field, Form, Formik, FormikValues } from "formik";
|
import { Field, Form, Formik, FormikValues } from "formik";
|
||||||
|
|
||||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||||
import { Dialog, Transition } from "@headlessui/react";
|
import { Dialog, Transition } from "@headlessui/react";
|
||||||
|
|
||||||
import { classNames, sleep } from "../../utils";
|
import { classNames, sleep } from "../../utils";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import DEBUG from "../../components/debug";
|
import DEBUG from "../../components/debug";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs";
|
import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs";
|
||||||
import { SlideOver } from "../../components/panels";
|
import { SlideOver } from "../../components/panels";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { SelectFieldBasic, SelectFieldCreatable } from "../../components/inputs/select_wide";
|
import { SelectFieldBasic, SelectFieldCreatable } from "../../components/inputs/select_wide";
|
||||||
|
|
||||||
import { CustomTooltip } from "../../components/tooltips/CustomTooltip";
|
import { CustomTooltip } from "../../components/tooltips/CustomTooltip";
|
||||||
import { FeedDownloadTypeOptions } from "../../domain/constants";
|
import { FeedDownloadTypeOptions } from "../../domain/constants";
|
||||||
|
|
||||||
|
@ -247,6 +243,7 @@ interface AddProps {
|
||||||
export function IndexerAddForm({ isOpen, toggle }: AddProps) {
|
export function IndexerAddForm({ isOpen, toggle }: AddProps) {
|
||||||
const [indexer, setIndexer] = useState<IndexerDefinition>({} as IndexerDefinition);
|
const [indexer, setIndexer] = useState<IndexerDefinition>({} as IndexerDefinition);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
const { data } = useQuery(
|
const { data } = useQuery(
|
||||||
"indexerDefinition",
|
"indexerDefinition",
|
||||||
() => APIClient.indexers.getSchema(),
|
() => APIClient.indexers.getSchema(),
|
||||||
|
@ -578,14 +575,15 @@ export function IndexerAddForm({ isOpen, toggle }: AddProps) {
|
||||||
|
|
||||||
interface TestApiButtonProps {
|
interface TestApiButtonProps {
|
||||||
values: FormikValues;
|
values: FormikValues;
|
||||||
|
show: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function TestApiButton({ values }: TestApiButtonProps) {
|
function TestApiButton({ values, show }: TestApiButtonProps) {
|
||||||
const [isTesting, setIsTesting] = useState(false);
|
const [isTesting, setIsTesting] = useState(false);
|
||||||
const [isSuccessfulTest, setIsSuccessfulTest] = useState(false);
|
const [isSuccessfulTest, setIsSuccessfulTest] = useState(false);
|
||||||
const [isErrorTest, setIsErrorTest] = useState(false);
|
const [isErrorTest, setIsErrorTest] = useState(false);
|
||||||
|
|
||||||
if (!values.settings.api_key) {
|
if (!show) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -706,6 +704,8 @@ interface UpdateProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function IndexerUpdateForm({ isOpen, toggle, indexer }: UpdateProps) {
|
export function IndexerUpdateForm({ isOpen, toggle, indexer }: UpdateProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation((indexer: Indexer) => APIClient.indexers.update(indexer), {
|
const mutation = useMutation((indexer: Indexer) => APIClient.indexers.update(indexer), {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries(["indexer"]);
|
queryClient.invalidateQueries(["indexer"]);
|
||||||
|
@ -783,7 +783,7 @@ export function IndexerUpdateForm({ isOpen, toggle, indexer }: UpdateProps) {
|
||||||
deleteAction={deleteAction}
|
deleteAction={deleteAction}
|
||||||
onSubmit={onSubmit}
|
onSubmit={onSubmit}
|
||||||
initialValues={initialValues}
|
initialValues={initialValues}
|
||||||
extraButtons={(values) => <TestApiButton values={values as FormikValues} />}
|
extraButtons={(values) => <TestApiButton values={values as FormikValues} show={indexer.implementation === "irc" && indexer.supports.includes("api")} />}
|
||||||
>
|
>
|
||||||
{() => (
|
{() => (
|
||||||
<div className="py-2 space-y-6 sm:py-0 sm:space-y-0 divide-y divide-gray-200 dark:divide-gray-700">
|
<div className="py-2 space-y-6 sm:py-0 sm:space-y-0 divide-y divide-gray-200 dark:divide-gray-700">
|
||||||
|
|
|
@ -1,12 +1,9 @@
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { XMarkIcon } from "@heroicons/react/24/solid";
|
import { XMarkIcon } from "@heroicons/react/24/solid";
|
||||||
import type { FieldProps } from "formik";
|
import type { FieldProps } from "formik";
|
||||||
import { Field, FieldArray, FormikErrors, FormikValues } from "formik";
|
import { Field, FieldArray, FormikErrors, FormikValues } from "formik";
|
||||||
|
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
|
|
||||||
import { NumberFieldWide, PasswordFieldWide, SwitchGroupWide, SwitchGroupWideRed, TextFieldWide } from "../../components/inputs";
|
import { NumberFieldWide, PasswordFieldWide, SwitchGroupWide, SwitchGroupWideRed, TextFieldWide } from "../../components/inputs";
|
||||||
import { SlideOver } from "../../components/panels";
|
import { SlideOver } from "../../components/panels";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
|
@ -98,6 +95,7 @@ interface AddFormProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function IrcNetworkAddForm({ isOpen, toggle }: AddFormProps) {
|
export function IrcNetworkAddForm({ isOpen, toggle }: AddFormProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(network: IrcNetwork) => APIClient.irc.createNetwork(network),
|
(network: IrcNetwork) => APIClient.irc.createNetwork(network),
|
||||||
{
|
{
|
||||||
|
@ -241,6 +239,8 @@ export function IrcNetworkUpdateForm({
|
||||||
toggle,
|
toggle,
|
||||||
network
|
network
|
||||||
}: IrcNetworkUpdateFormProps) {
|
}: IrcNetworkUpdateFormProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation((network: IrcNetwork) => APIClient.irc.updateNetwork(network), {
|
const mutation = useMutation((network: IrcNetwork) => APIClient.irc.updateNetwork(network), {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
queryClient.invalidateQueries(["networks"]);
|
queryClient.invalidateQueries(["networks"]);
|
||||||
|
|
|
@ -7,9 +7,8 @@ import Select, { components, ControlProps, InputProps, MenuProps, OptionProps }
|
||||||
import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs";
|
import { PasswordFieldWide, SwitchGroupWide, TextFieldWide } from "../../components/inputs";
|
||||||
import DEBUG from "../../components/debug";
|
import DEBUG from "../../components/debug";
|
||||||
import { EventOptions, NotificationTypeOptions, SelectOption } from "../../domain/constants";
|
import { EventOptions, NotificationTypeOptions, SelectOption } from "../../domain/constants";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { SlideOver } from "../../components/panels";
|
import { SlideOver } from "../../components/panels";
|
||||||
|
@ -136,6 +135,8 @@ interface AddProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NotificationAddForm({ isOpen, toggle }: AddProps) {
|
export function NotificationAddForm({ isOpen, toggle }: AddProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(notification: Notification) => APIClient.notifications.create(notification),
|
(notification: Notification) => APIClient.notifications.create(notification),
|
||||||
{
|
{
|
||||||
|
@ -407,6 +408,8 @@ interface InitialValues {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateProps) {
|
export function NotificationUpdateForm({ isOpen, toggle, notification }: UpdateProps) {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(notification: Notification) => APIClient.notifications.update(notification),
|
(notification: Notification) => APIClient.notifications.update(notification),
|
||||||
{
|
{
|
||||||
|
|
|
@ -21,16 +21,16 @@ function classNames(...classes: string[]) {
|
||||||
return classes.filter(Boolean).join(" ");
|
return classes.filter(Boolean).join(" ");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const nav: Array<NavItem> = [
|
||||||
|
{ name: "Dashboard", path: "/" },
|
||||||
|
{ name: "Filters", path: "/filters" },
|
||||||
|
{ name: "Releases", path: "/releases" },
|
||||||
|
{ name: "Settings", path: "/settings" },
|
||||||
|
{ name: "Logs", path: "/logs" }
|
||||||
|
];
|
||||||
|
|
||||||
export default function Base() {
|
export default function Base() {
|
||||||
const authContext = AuthContext.useValue();
|
const authContext = AuthContext.useValue();
|
||||||
const nav: Array<NavItem> = [
|
|
||||||
{ name: "Dashboard", path: "/" },
|
|
||||||
{ name: "Filters", path: "/filters" },
|
|
||||||
{ name: "Releases", path: "/releases" },
|
|
||||||
{ name: "Settings", path: "/settings" },
|
|
||||||
{ name: "Logs", path: "/logs" }
|
|
||||||
];
|
|
||||||
|
|
||||||
|
|
||||||
const { data } = useQuery(
|
const { data } = useQuery(
|
||||||
["updates"],
|
["updates"],
|
||||||
|
|
|
@ -2,7 +2,6 @@ import { useEffect } from "react";
|
||||||
import { useForm } from "react-hook-form";
|
import { useForm } from "react-hook-form";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation } from "react-query";
|
||||||
|
|
||||||
import logo from "../../logo.png";
|
import logo from "../../logo.png";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { AuthContext } from "../../utils/Context";
|
import { AuthContext } from "../../utils/Context";
|
||||||
|
@ -86,10 +85,10 @@ export const Login = () => {
|
||||||
Sign in
|
Sign in
|
||||||
</button>
|
</button>
|
||||||
<div>
|
<div>
|
||||||
<p className="flex float-right items-center mt-3 text-xs font-bold text-gray-700 dark:text-gray-200 uppercase tracking-wide cursor-pointer" id="forgot">
|
<span className="flex float-right items-center mt-3 text-xs font-bold text-gray-700 dark:text-gray-200 uppercase tracking-wide cursor-pointer" id="forgot">
|
||||||
Forgot?<svg className="ml-1 w-3 h-3 text-gray-500 dark:text-gray-400 fill-current" viewBox="0 0 72 72"><path d="M32 2C15.432 2 2 15.432 2 32s13.432 30 30 30s30-13.432 30-30S48.568 2 32 2m5 49.75H27v-24h10v24m-5-29.5a5 5 0 1 1 0-10a5 5 0 0 1 0 10"/></svg>
|
Forgot?<svg className="ml-1 w-3 h-3 text-gray-500 dark:text-gray-400 fill-current" viewBox="0 0 72 72"><path d="M32 2C15.432 2 2 15.432 2 32s13.432 30 30 30s30-13.432 30-30S48.568 2 32 2m5 49.75H27v-24h10v24m-5-29.5a5 5 0 1 1 0-10a5 5 0 0 1 0 10"/></svg>
|
||||||
<Tooltip style={{ maxWidth: "350px", fontSize: "12px", textTransform: "none", fontWeight: "normal", borderRadius: "0.375rem", backgroundColor: "#34343A", color: "#fff", opacity: "1" }} place="bottom" delayShow={100} delayHide={150} anchorId="forgot" html="<p style='padding-top: 2px'>If you forget your password you can reset it via the terminal: <code>autobrrctl --config /home/username/.config/autobrr change-password <USERNAME></code></p>" clickable={true}/>
|
<Tooltip style={{ maxWidth: "350px", fontSize: "12px", textTransform: "none", fontWeight: "normal", borderRadius: "0.375rem", backgroundColor: "#34343A", color: "#fff", opacity: "1" }} place="bottom" delayShow={100} delayHide={150} anchorId="forgot" html="<p style='padding-top: 2px'>If you forget your password you can reset it via the terminal: <code>autobrrctl --config /home/username/.config/autobrr change-password <USERNAME></code></p>" clickable={true}/>
|
||||||
</p>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import React, { useRef } from "react";
|
import React, { useRef } from "react";
|
||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import { NavLink, Route, Routes, useLocation, useNavigate, useParams } from "react-router-dom";
|
import { NavLink, Route, Routes, useLocation, useNavigate, useParams } from "react-router-dom";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import { Form, Formik, FormikValues, useFormikContext } from "formik";
|
import { Form, Formik, FormikValues, useFormikContext } from "formik";
|
||||||
|
@ -21,7 +21,6 @@ import {
|
||||||
SOURCES_OPTIONS,
|
SOURCES_OPTIONS,
|
||||||
tagsMatchLogicOptions
|
tagsMatchLogicOptions
|
||||||
} from "../../domain/constants";
|
} from "../../domain/constants";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { useToggle } from "../../hooks/hooks";
|
import { useToggle } from "../../hooks/hooks";
|
||||||
import { classNames } from "../../utils";
|
import { classNames } from "../../utils";
|
||||||
|
@ -141,6 +140,7 @@ const FormButtonsGroup = ({ values, deleteAction, reset }: FormButtonsGroupProps
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function FilterDetails() {
|
export default function FilterDetails() {
|
||||||
|
const queryClient = useQueryClient();
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
const { filterId } = useParams<{ filterId: string }>();
|
const { filterId } = useParams<{ filterId: string }>();
|
||||||
|
|
||||||
|
|
|
@ -5,12 +5,8 @@ import { Listbox, Menu, Switch, Transition } from "@headlessui/react";
|
||||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import { FormikValues } from "formik";
|
import { FormikValues } from "formik";
|
||||||
import { useCallback } from "react";
|
import { useCallback } from "react";
|
||||||
|
|
||||||
import { Tooltip } from "react-tooltip";
|
import { Tooltip } from "react-tooltip";
|
||||||
|
|
||||||
|
|
||||||
import { FilterListContext, FilterListState } from "../../utils/Context";
|
import { FilterListContext, FilterListState } from "../../utils/Context";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ArrowsRightLeftIcon,
|
ArrowsRightLeftIcon,
|
||||||
CheckIcon,
|
CheckIcon,
|
||||||
|
@ -22,8 +18,6 @@ import {
|
||||||
ChatBubbleBottomCenterTextIcon,
|
ChatBubbleBottomCenterTextIcon,
|
||||||
TrashIcon
|
TrashIcon
|
||||||
} from "@heroicons/react/24/outline";
|
} from "@heroicons/react/24/outline";
|
||||||
|
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { classNames } from "../../utils";
|
import { classNames } from "../../utils";
|
||||||
import { FilterAddForm } from "../../forms";
|
import { FilterAddForm } from "../../forms";
|
||||||
import { useToggle } from "../../hooks/hooks";
|
import { useToggle } from "../../hooks/hooks";
|
||||||
|
@ -74,7 +68,6 @@ interface FilterProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function Filters({}: FilterProps){
|
export default function Filters({}: FilterProps){
|
||||||
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const [createFilterIsOpen, setCreateFilterIsOpen] = useState(false);
|
const [createFilterIsOpen, setCreateFilterIsOpen] = useState(false);
|
||||||
|
@ -642,6 +635,7 @@ interface FilterListItemProps {
|
||||||
|
|
||||||
function FilterListItem({ filter, values, idx }: FilterListItemProps) {
|
function FilterListItem({ filter, values, idx }: FilterListItemProps) {
|
||||||
const [enabled, setEnabled] = useState(filter.enabled);
|
const [enabled, setEnabled] = useState(filter.enabled);
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const updateMutation = useMutation(
|
const updateMutation = useMutation(
|
||||||
(status: boolean) => APIClient.filters.toggleEnable(filter.id, status),
|
(status: boolean) => APIClient.filters.toggleEnable(filter.id, status),
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import { KeyField } from "../../components/fields/text";
|
import { KeyField } from "../../components/fields/text";
|
||||||
import { DeleteModal } from "../../components/modals";
|
import { DeleteModal } from "../../components/modals";
|
||||||
import APIKeyAddForm from "../../forms/settings/APIKeyAddForm";
|
import APIKeyAddForm from "../../forms/settings/APIKeyAddForm";
|
||||||
|
@ -82,6 +81,8 @@ function APIListItem({ apikey }: ApiKeyItemProps) {
|
||||||
const cancelModalButtonRef = useRef(null);
|
const cancelModalButtonRef = useRef(null);
|
||||||
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const deleteMutation = useMutation(
|
const deleteMutation = useMutation(
|
||||||
(key: string) => APIClient.apikeys.delete(key),
|
(key: string) => APIClient.apikeys.delete(key),
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,11 +1,10 @@
|
||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { Checkbox } from "../../components/Checkbox";
|
import { Checkbox } from "../../components/Checkbox";
|
||||||
import { SettingsContext } from "../../utils/Context";
|
import { SettingsContext } from "../../utils/Context";
|
||||||
import { GithubRelease } from "../../types/Update";
|
import { GithubRelease } from "../../types/Update";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
|
|
||||||
interface RowItemProps {
|
interface RowItemProps {
|
||||||
label: string;
|
label: string;
|
||||||
|
@ -89,6 +88,8 @@ function ApplicationSettings() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const checkUpdateMutation = useMutation(
|
const checkUpdateMutation = useMutation(
|
||||||
() => APIClient.updates.check(),
|
() => APIClient.updates.check(),
|
||||||
{
|
{
|
||||||
|
|
|
@ -27,8 +27,6 @@ interface SortConfig {
|
||||||
function useSort(items: ListItemProps["clients"][], config?: SortConfig) {
|
function useSort(items: ListItemProps["clients"][], config?: SortConfig) {
|
||||||
const [sortConfig, setSortConfig] = useState(config);
|
const [sortConfig, setSortConfig] = useState(config);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const sortedItems = useMemo(() => {
|
const sortedItems = useMemo(() => {
|
||||||
if (!sortConfig) {
|
if (!sortConfig) {
|
||||||
return items;
|
return items;
|
||||||
|
@ -80,6 +78,7 @@ function DownloadClientSettingsListItem({ client }: DLSettingsItemProps) {
|
||||||
const [updateClientIsOpen, toggleUpdateClient] = useToggle(false);
|
const [updateClientIsOpen, toggleUpdateClient] = useToggle(false);
|
||||||
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(client: DownloadClient) => APIClient.download_clients.update(client),
|
(client: DownloadClient) => APIClient.download_clients.update(client),
|
||||||
{
|
{
|
||||||
|
|
|
@ -7,7 +7,6 @@ import { baseUrl, classNames, IsEmptyDate, simplifyDate } from "../../utils";
|
||||||
import { Fragment, useRef, useState, useMemo } from "react";
|
import { Fragment, useRef, useState, useMemo } from "react";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { DeleteModal } from "../../components/modals";
|
import { DeleteModal } from "../../components/modals";
|
||||||
import {
|
import {
|
||||||
ArrowsRightLeftIcon,
|
ArrowsRightLeftIcon,
|
||||||
|
@ -141,6 +140,7 @@ function ListItem({ feed }: ListItemProps) {
|
||||||
const [updateFormIsOpen, toggleUpdateForm] = useToggle(false);
|
const [updateFormIsOpen, toggleUpdateForm] = useToggle(false);
|
||||||
|
|
||||||
const [enabled, setEnabled] = useState(feed.enabled);
|
const [enabled, setEnabled] = useState(feed.enabled);
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const updateMutation = useMutation(
|
const updateMutation = useMutation(
|
||||||
(status: boolean) => APIClient.feeds.toggleEnable(feed.id, status),
|
(status: boolean) => APIClient.feeds.toggleEnable(feed.id, status),
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { useMutation, useQuery, useQueryClient } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
|
|
||||||
import { classNames, IsEmptyDate, simplifyDate } from "../../utils";
|
import { classNames, IsEmptyDate, simplifyDate } from "../../utils";
|
||||||
import { IrcNetworkAddForm, IrcNetworkUpdateForm } from "../../forms";
|
import { IrcNetworkAddForm, IrcNetworkUpdateForm } from "../../forms";
|
||||||
import { useToggle } from "../../hooks/hooks";
|
import { useToggle } from "../../hooks/hooks";
|
||||||
|
@ -10,7 +9,6 @@ import { Menu, Switch, Transition } from "@headlessui/react";
|
||||||
import { Fragment, useRef } from "react";
|
import { Fragment, useRef } from "react";
|
||||||
import { DeleteModal } from "../../components/modals";
|
import { DeleteModal } from "../../components/modals";
|
||||||
import { useState, useMemo } from "react";
|
import { useState, useMemo } from "react";
|
||||||
|
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import {
|
import {
|
||||||
|
@ -30,8 +28,6 @@ interface SortConfig {
|
||||||
function useSort(items: ListItemProps["network"][], config?: SortConfig) {
|
function useSort(items: ListItemProps["network"][], config?: SortConfig) {
|
||||||
const [sortConfig, setSortConfig] = useState(config);
|
const [sortConfig, setSortConfig] = useState(config);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const sortedItems = useMemo(() => {
|
const sortedItems = useMemo(() => {
|
||||||
if (!sortConfig) {
|
if (!sortConfig) {
|
||||||
return items;
|
return items;
|
||||||
|
@ -79,7 +75,6 @@ function useSort(items: ListItemProps["network"][], config?: SortConfig) {
|
||||||
return { items: sortedItems, requestSort, sortConfig, getSortIndicator };
|
return { items: sortedItems, requestSort, sortConfig, getSortIndicator };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const IrcSettings = () => {
|
const IrcSettings = () => {
|
||||||
const [expandNetworks, toggleExpand] = useToggle(false);
|
const [expandNetworks, toggleExpand] = useToggle(false);
|
||||||
const [addNetworkIsOpen, toggleAddNetwork] = useToggle(false);
|
const [addNetworkIsOpen, toggleAddNetwork] = useToggle(false);
|
||||||
|
@ -92,7 +87,6 @@ const IrcSettings = () => {
|
||||||
|
|
||||||
const sortedNetworks = useSort(data || []);
|
const sortedNetworks = useSort(data || []);
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="lg:col-span-9">
|
<div className="lg:col-span-9">
|
||||||
<IrcNetworkAddForm isOpen={addNetworkIsOpen} toggle={toggleAddNetwork} />
|
<IrcNetworkAddForm isOpen={addNetworkIsOpen} toggle={toggleAddNetwork} />
|
||||||
|
@ -209,6 +203,7 @@ const ListItem = ({ idx, network, expanded }: ListItemProps) => {
|
||||||
const [edit, toggleEdit] = useToggle(false);
|
const [edit, toggleEdit] = useToggle(false);
|
||||||
|
|
||||||
const queryClient = useQueryClient();
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const mutation = useMutation(
|
const mutation = useMutation(
|
||||||
(network: IrcNetwork) => APIClient.irc.updateNetwork(network),
|
(network: IrcNetwork) => APIClient.irc.updateNetwork(network),
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
import { useMutation, useQuery } from "react-query";
|
import { useMutation, useQuery, useQueryClient } from "react-query";
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import { GithubRelease } from "../../types/Update";
|
import { GithubRelease } from "../../types/Update";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
|
import Select, { components, ControlProps, InputProps, MenuProps, OptionProps } from "react-select";
|
||||||
import { LogLevelOptions, SelectOption } from "../../domain/constants";
|
import { LogLevelOptions, SelectOption } from "../../domain/constants";
|
||||||
import { LogFiles } from "../Logs";
|
import { LogFiles } from "../Logs";
|
||||||
|
@ -132,6 +131,8 @@ function LogSettings() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const setLogLevelUpdateMutation = useMutation(
|
const setLogLevelUpdateMutation = useMutation(
|
||||||
(value: string) => APIClient.config.update({ log_level: value }),
|
(value: string) => APIClient.config.update({ log_level: value }),
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
import { useRef } from "react";
|
import { useRef } from "react";
|
||||||
import { useMutation } from "react-query";
|
import { useMutation, useQueryClient } from "react-query";
|
||||||
import { toast } from "react-hot-toast";
|
import { toast } from "react-hot-toast";
|
||||||
|
|
||||||
import { APIClient } from "../../api/APIClient";
|
import { APIClient } from "../../api/APIClient";
|
||||||
import Toast from "../../components/notifications/Toast";
|
import Toast from "../../components/notifications/Toast";
|
||||||
import { queryClient } from "../../App";
|
|
||||||
import { useToggle } from "../../hooks/hooks";
|
import { useToggle } from "../../hooks/hooks";
|
||||||
import { DeleteModal } from "../../components/modals";
|
import { DeleteModal } from "../../components/modals";
|
||||||
|
|
||||||
function ReleaseSettings() {
|
function ReleaseSettings() {
|
||||||
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
const [deleteModalIsOpen, toggleDeleteModal] = useToggle(false);
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
const deleteMutation = useMutation(() => APIClient.release.delete(), {
|
const deleteMutation = useMutation(() => APIClient.release.delete(), {
|
||||||
onSuccess: () => {
|
onSuccess: () => {
|
||||||
toast.custom((t) => (
|
toast.custom((t) => (
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue