feat(download-clients): porla implement rules (#711)

* feat(downloadclients): Porla implement rules

* feat(downloadclients): Porla add basic auth support

* feat(porla): use new token for auth

* feat(porla): update check can download rules
This commit is contained in:
ze0s 2023-02-24 19:17:02 +01:00 committed by GitHub
parent 209e23de4f
commit d100703784
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 248 additions and 59 deletions

View file

@ -162,7 +162,7 @@ function FormFieldsQbit() {
function FormFieldsPorla() {
const {
values: {}
values: { tls, settings }
} = useFormikContext<InitialValues>();
return (
@ -173,7 +173,25 @@ function FormFieldsPorla() {
help="Eg. http(s)://client.domain.ltd, http(s)://domain.ltd/porla, http://domain.ltd:port"
/>
<SwitchGroupWide name="tls" label="TLS" />
<PasswordFieldWide name="settings.apikey" label="Auth token" />
{tls && (
<SwitchGroupWide
name="tls_skip_verify"
label="Skip TLS verification (insecure)"
/>
)}
<SwitchGroupWide name="settings.basic.auth" label="Basic auth" />
{settings.basic?.auth === true && (
<>
<TextFieldWide name="settings.basic.username" label="Username" />
<PasswordFieldWide name="settings.basic.password" label="Password" />
</>
)}
</div>
);
}
@ -264,7 +282,7 @@ function FormFieldsRulesBasic() {
);
}
function FormFieldsRules() {
function FormFieldsRulesQbit() {
const {
values: { settings }
} = useFormikContext<InitialValues>();
@ -325,7 +343,8 @@ function FormFieldsRules() {
export const rulesComponentMap: componentMapType = {
DELUGE_V1: <FormFieldsRulesBasic/>,
DELUGE_V2: <FormFieldsRulesBasic/>,
QBITTORRENT: <FormFieldsRules/>
QBITTORRENT: <FormFieldsRulesQbit/>,
PORLA: <FormFieldsRulesBasic/>
};
interface formButtonsProps {