mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-10 23:45:48 +01:00
Also fixed Torrent form fields
This commit is contained in:
@@ -321,9 +321,20 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
|
|||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{(form.values.type === 'Deluge' ||
|
{form.values.type === 'Deluge' && (
|
||||||
form.values.type === 'Transmission' ||
|
<>
|
||||||
form.values.type === 'qBittorrent') && (
|
<TextInput
|
||||||
|
label="Password"
|
||||||
|
placeholder="password"
|
||||||
|
value={form.values.password}
|
||||||
|
onChange={(event) => {
|
||||||
|
form.setFieldValue('password', event.currentTarget.value);
|
||||||
|
}}
|
||||||
|
error={form.errors.password && 'Invalid password'}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
{form.values.type === 'Transmission' && (
|
||||||
<>
|
<>
|
||||||
<TextInput
|
<TextInput
|
||||||
label="Username"
|
label="Username"
|
||||||
@@ -336,7 +347,7 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
|
|||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
label="Password"
|
label="Password"
|
||||||
placeholder="password"
|
placeholder="adminadmin"
|
||||||
value={form.values.password}
|
value={form.values.password}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
form.setFieldValue('password', event.currentTarget.value);
|
form.setFieldValue('password', event.currentTarget.value);
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ async function Post(req: NextApiRequest, res: NextApiResponse) {
|
|||||||
...(
|
...(
|
||||||
await new Transmission({
|
await new Transmission({
|
||||||
baseUrl: service.url,
|
baseUrl: service.url,
|
||||||
username: service.username,
|
username: 'username' in service ? service.username : '',
|
||||||
password: 'password' in service ? service.password : '',
|
password: 'password' in service ? service.password : '',
|
||||||
}).getAllData()
|
}).getAllData()
|
||||||
).torrents
|
).torrents
|
||||||
|
|||||||
Reference in New Issue
Block a user