Add support for qBittorrent in AddAppShelfItem

This commit is contained in:
ajnart
2022-05-26 18:17:59 +02:00
parent 8e2d347ab5
commit 2aad3d3eb0
2 changed files with 28 additions and 0 deletions

View File

@@ -74,6 +74,8 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
icon: props.icon ?? '/favicon.svg', icon: props.icon ?? '/favicon.svg',
url: props.url ?? '', url: props.url ?? '',
apiKey: props.apiKey ?? (undefined as unknown as string), apiKey: props.apiKey ?? (undefined as unknown as string),
username: props.username ?? (undefined as unknown as string),
password: props.password ?? (undefined as unknown as string),
}, },
validate: { validate: {
apiKey: () => null, apiKey: () => null,
@@ -188,6 +190,30 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
error={form.errors.apiKey && 'Invalid API key'} error={form.errors.apiKey && 'Invalid API key'}
/> />
)} )}
{form.values.type === 'qBittorrent' && (
<>
<TextInput
required
label="Username"
placeholder="admin"
value={form.values.username}
onChange={(event) => {
form.setFieldValue('username', event.currentTarget.value);
}}
error={form.errors.username && 'Invalid username'}
/>
<TextInput
required
label="Password"
placeholder="adminadmin"
value={form.values.password}
onChange={(event) => {
form.setFieldValue('password', event.currentTarget.value);
}}
error={form.errors.password && 'Invalid password'}
/>
</>
)}
</Group> </Group>
<Group grow position="center" mt="xl"> <Group grow position="center" mt="xl">

View File

@@ -27,6 +27,8 @@ export default function AppShelfMenu(props: any) {
url={service.url} url={service.url}
icon={service.icon} icon={service.icon}
apiKey={service.apiKey} apiKey={service.apiKey}
login={service.login}
password={service.password}
message="Save service" message="Save service"
/> />
</Modal> </Modal>