From 66561e64a11b4e3a0ab4ee6f2ebad3fe5ffc70c6 Mon Sep 17 00:00:00 2001 From: Igor Katson Date: Wed, 6 Dec 2023 21:57:11 +0000 Subject: [PATCH] Styling configure - extract components --- desktop/src/configure.tsx | 314 ++++++++++++++++++-------------------- 1 file changed, 145 insertions(+), 169 deletions(-) diff --git a/desktop/src/configure.tsx b/desktop/src/configure.tsx index 812284c..4df6142 100644 --- a/desktop/src/configure.tsx +++ b/desktop/src/configure.tsx @@ -5,6 +5,49 @@ import { ErrorComponent } from "./rqbit-webui-src/rqbit-web"; import { invokeAPI } from "./api"; import { ErrorDetails } from "./rqbit-webui-src/api-types"; +const FormCheck: React.FC<{ + label: string, + name: string, + checked: boolean, + onChange: (e: any) => void, + disabled?: boolean, +}> = ({ label, name, checked, onChange, disabled }) => { + return + {label} +
+ +
+
+} + +const FormInput: React.FC<{ + label: string, + name: string, + value: string | number, + inputType: string, + onChange: (e: any) => void, + disabled?: boolean, +}> = ({ label, name, value, inputType, onChange, disabled }) => { + return + {label} +
+ +
+
+} + export const ConfigModal: React.FC<{ handleOk: (config: RqbitDesktopConfig) => void, initialConfig: RqbitDesktopConfig, @@ -79,210 +122,143 @@ export const ConfigModal: React.FC<{ className="mb-3"> - - Default download folder -
- -
- -
+
DHT config - - - + - - - + - - Persistence Filename -
- -
-
+
TCP Listener config - - - + - - Min port -
- -
+ -
- - - Max Port -
- -
- -
- - - - + +
Session persistence - - - - - - Persistence Filename -
- -
- -
+ +
Peer connection options - - Connect timeout (seconds) -
- -
+ -
- - - Read/write timeout (seconds) -
- -
- -
+
HTTP API config - - - + - - HTTP API Listen Address -
- -
- -
- - - - + +