✨ Champ port optionnel (Radarr + qBittorrent) et normalisation des adresses locales
This commit is contained in:
1 parent
f0b5f2b21e
commit
76dbd7e425
6 files changed
+127
-35
No files matched your search
+38
-6
@@ -17,12 +17,17 @@ type Movie = {
|
||||
last_seen_at: string;
|
||||
};
|
||||
|
||||
type RadarrSettings = { url: string | null; api_key_configured: boolean };
|
||||
type RadarrSettings = {
|
||||
url: string | null;
|
||||
port: number | null;
|
||||
api_key_configured: boolean;
|
||||
};
|
||||
|
||||
type NotificationKind = "info" | "error" | "warning";
|
||||
type Notification = { id: number; text: string; kind: NotificationKind };
|
||||
type QbittorrentSettings = {
|
||||
url: string | null;
|
||||
port: number | null;
|
||||
username: string | null;
|
||||
password_configured: boolean;
|
||||
};
|
||||
@@ -107,9 +112,11 @@ export default function App() {
|
||||
const [tab, setTab] = useState<Tab>("pending");
|
||||
const [linkedOnly, setLinkedOnly] = useState(false);
|
||||
const [url, setUrl] = useState("");
|
||||
const [radarrPort, setRadarrPort] = useState("");
|
||||
const [apiKey, setApiKey] = useState("");
|
||||
const [keyConfigured, setKeyConfigured] = useState(false);
|
||||
const [qbitUrl, setQbitUrl] = useState("");
|
||||
const [qbitPort, setQbitPort] = useState("");
|
||||
const [qbitUsername, setQbitUsername] = useState("");
|
||||
const [qbitPassword, setQbitPassword] = useState("");
|
||||
const [qbitConfigured, setQbitConfigured] = useState(false);
|
||||
@@ -199,8 +206,10 @@ export default function App() {
|
||||
])
|
||||
.then(([radarr, qbittorrent]) => {
|
||||
setUrl(radarr.url ?? "");
|
||||
setRadarrPort(radarr.port?.toString() ?? "");
|
||||
setKeyConfigured(radarr.api_key_configured);
|
||||
setQbitUrl(qbittorrent.url ?? "");
|
||||
setQbitPort(qbittorrent.port?.toString() ?? "");
|
||||
setQbitUsername(qbittorrent.username ?? "");
|
||||
setQbitConfigured(qbittorrent.password_configured);
|
||||
if (!radarr.api_key_configured || !qbittorrent.password_configured) {
|
||||
@@ -296,7 +305,7 @@ export default function App() {
|
||||
const settings = await api<RadarrSettings>("/api/settings/radarr", {
|
||||
method: "PUT",
|
||||
headers: jsonHeaders,
|
||||
body: JSON.stringify({ url, api_key: apiKey || null }),
|
||||
body: JSON.stringify({ url, port: radarrPort ? Number(radarrPort) : null, api_key: apiKey || null }),
|
||||
});
|
||||
setKeyConfigured(settings.api_key_configured);
|
||||
setApiKey("");
|
||||
@@ -320,6 +329,7 @@ export default function App() {
|
||||
headers: jsonHeaders,
|
||||
body: JSON.stringify({
|
||||
url: qbitUrl,
|
||||
port: qbitPort ? Number(qbitPort) : null,
|
||||
username: qbitUsername,
|
||||
password: qbitPassword || null,
|
||||
}),
|
||||
@@ -912,13 +922,24 @@ export default function App() {
|
||||
<label>
|
||||
URL Radarr
|
||||
<input
|
||||
type="url"
|
||||
type="text"
|
||||
required
|
||||
placeholder="http://radarr:7878"
|
||||
placeholder="http://radarr:7878 ou 192.168.1.50"
|
||||
value={url}
|
||||
onChange={(event) => setUrl(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Port (optionnel)
|
||||
<input
|
||||
type="number"
|
||||
min={1}
|
||||
max={65535}
|
||||
placeholder="7878"
|
||||
value={radarrPort}
|
||||
onChange={(event) => setRadarrPort(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Clé API
|
||||
<input
|
||||
@@ -947,13 +968,24 @@ export default function App() {
|
||||
<label>
|
||||
URL qBittorrent
|
||||
<input
|
||||
type="url"
|
||||
type="text"
|
||||
required
|
||||
placeholder="http://qbittorrent:8080"
|
||||
placeholder="http://qbittorrent:8080 ou 192.168.1.50"
|
||||
value={qbitUrl}
|
||||
onChange={(event) => setQbitUrl(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Port (optionnel)
|
||||
<input
|
||||
type="number"
|
||||
min={1}
|
||||
max={65535}
|
||||
placeholder="8080"
|
||||
value={qbitPort}
|
||||
onChange={(event) => setQbitPort(event.target.value)}
|
||||
/>
|
||||
</label>
|
||||
<label>
|
||||
Utilisateur
|
||||
<input
|
||||
|
||||
Reference in new issue
Block a user