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:
@@ -298,53 +298,64 @@ export function AddAppShelfItemForm(props: { setOpened: (b: boolean) => void } &
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{form.values.type === 'qBittorrent' && (
|
{form.values.type === 'qBittorrent' && (
|
||||||
<>
|
<>
|
||||||
<TextInput
|
<TextInput
|
||||||
required
|
required
|
||||||
label="Username"
|
label="Username"
|
||||||
placeholder="admin"
|
placeholder="admin"
|
||||||
value={form.values.username}
|
value={form.values.username}
|
||||||
onChange={(event) => {
|
onChange={(event) => {
|
||||||
form.setFieldValue('username', event.currentTarget.value);
|
form.setFieldValue('username', event.currentTarget.value);
|
||||||
}}
|
}}
|
||||||
error={form.errors.username && 'Invalid username'}
|
error={form.errors.username && 'Invalid username'}
|
||||||
/>
|
/>
|
||||||
<TextInput
|
<TextInput
|
||||||
required
|
required
|
||||||
label="Password"
|
label="Password"
|
||||||
placeholder="adminadmin"
|
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);
|
||||||
}}
|
}}
|
||||||
error={form.errors.password && 'Invalid password'}
|
error={form.errors.password && 'Invalid password'}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
{(form.values.type === 'Deluge' ||
|
{form.values.type === 'Deluge' && (
|
||||||
form.values.type === 'Transmission' ||
|
<>
|
||||||
form.values.type === 'qBittorrent') && (
|
<TextInput
|
||||||
<>
|
label="Password"
|
||||||
<TextInput
|
placeholder="password"
|
||||||
label="Username"
|
value={form.values.password}
|
||||||
placeholder="admin"
|
onChange={(event) => {
|
||||||
value={form.values.username}
|
form.setFieldValue('password', event.currentTarget.value);
|
||||||
onChange={(event) => {
|
}}
|
||||||
form.setFieldValue('username', event.currentTarget.value);
|
error={form.errors.password && 'Invalid password'}
|
||||||
}}
|
/>
|
||||||
error={form.errors.username && 'Invalid username'}
|
</>
|
||||||
/>
|
)}
|
||||||
<TextInput
|
{form.values.type === 'Transmission' && (
|
||||||
label="Password"
|
<>
|
||||||
placeholder="password"
|
<TextInput
|
||||||
value={form.values.password}
|
label="Username"
|
||||||
onChange={(event) => {
|
placeholder="admin"
|
||||||
form.setFieldValue('password', event.currentTarget.value);
|
value={form.values.username}
|
||||||
}}
|
onChange={(event) => {
|
||||||
error={form.errors.password && 'Invalid password'}
|
form.setFieldValue('username', event.currentTarget.value);
|
||||||
/>
|
}}
|
||||||
</>
|
error={form.errors.username && 'Invalid username'}
|
||||||
)}
|
/>
|
||||||
|
<TextInput
|
||||||
|
label="Password"
|
||||||
|
placeholder="adminadmin"
|
||||||
|
value={form.values.password}
|
||||||
|
onChange={(event) => {
|
||||||
|
form.setFieldValue('password', event.currentTarget.value);
|
||||||
|
}}
|
||||||
|
error={form.errors.password && 'Invalid password'}
|
||||||
|
/>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
</Group>
|
</Group>
|
||||||
</ScrollArea>
|
</ScrollArea>
|
||||||
</Tabs.Tab>
|
</Tabs.Tab>
|
||||||
|
|||||||
@@ -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