Skip to content

Commit

Permalink
Add settings in desktop version
Browse files Browse the repository at this point in the history
  • Loading branch information
Morishiri committed Apr 15, 2022
1 parent 5797d0f commit 0d4cbef
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 0 deletions.
1 change: 1 addition & 0 deletions ui/desktop/src/interfaces/RemoteEndpointSpecs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export default interface RemoteEndpointSpecs {
basicAuthUsername?: string;
basicAuthPassword?: string;
disableProxyErrorPage: boolean;
disableOldCiphers: boolean;
}
17 changes: 17 additions & 0 deletions ui/desktop/src/pages/Directory.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const DirectoryPage = () => {
const [usingBasicAuth, setUsingBasicAuth] = useState(false);
const [basicAuthUsername, setBasicAuthUsername] = useState("");
const [basicAuthPassword, setBasicAuthPassword] = useState("");
const [disableOldCiphers, setDisableOldCiphers] = useState(false);

const areInputsValid = (): boolean => {
if (!isLocalPathValid(path)) return false;
Expand All @@ -51,6 +52,7 @@ const DirectoryPage = () => {
},
remote: {
disableProxyErrorPage: false,
disableOldCiphers: false,
tunnelId: uuidv4(),
},
};
Expand All @@ -62,6 +64,8 @@ const DirectoryPage = () => {
options.remote.basicAuthPassword = basicAuthPassword;
}

options.remote.disableOldCiphers = disableOldCiphers;

const message: Message<ExposeDirectoryMessage> = {
type: MessageTypeRequestTunnelStartDirectory,
payload: options,
Expand Down Expand Up @@ -104,6 +108,19 @@ const DirectoryPage = () => {
passwordValue={basicAuthPassword}
passwordChangeCallback={setBasicAuthPassword}
/>
<div className="field">
<div className="control">
<label className="checkbox">
<input
type="checkbox"
onChange={(e) => {
setDisableOldCiphers(!disableOldCiphers);
}}
/>{" "}
I want to disable old TLS ciphers (older than TLS 1.2)
</label>
</div>
</div>
</div>
<div className="column is-12">
<div className="field is-grouped is-pulled-right">
Expand Down
16 changes: 16 additions & 0 deletions ui/desktop/src/pages/HTTP.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ const HTTP = () => {
const [basicAuthUsername, setBasicAuthUsername] = useState("");
const [basicAuthPassword, setBasicAuthPassword] = useState("");
const [disableProxyErrorPage, setDisableProxyErrorPage] = useState(false);
const [disableOldCiphers, setDisableOldCiphers] = useState(false);
const [usingUrlPath, setUsingUrlPath] = useState(false);
const [urlPath, setUrlPath] = useState("")

Expand Down Expand Up @@ -61,6 +62,7 @@ const HTTP = () => {
},
remote: {
disableProxyErrorPage: false,
disableOldCiphers: false,
tunnelId: uuidv4(),
},
};
Expand All @@ -76,6 +78,7 @@ const HTTP = () => {
}

options.remote.disableProxyErrorPage = disableProxyErrorPage;
options.remote.disableOldCiphers = disableOldCiphers;

const message: Message<ExposeHttpPortMessage> = {
type: MessageTypeRequestTunnelStartHTTP,
Expand Down Expand Up @@ -140,6 +143,19 @@ const HTTP = () => {
</label>
</div>
</div>
<div className="field">
<div className="control">
<label className="checkbox">
<input
type="checkbox"
onChange={(e) => {
setDisableOldCiphers(!disableOldCiphers);
}}
/>{" "}
I want to disable old TLS ciphers (older than TLS 1.2)
</label>
</div>
</div>
</div>
<div className="column is-12">
<div className="field is-grouped is-pulled-right">
Expand Down
17 changes: 17 additions & 0 deletions ui/desktop/src/pages/WebDav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const WebDav = () => {
const [usingBasicAuth, setUsingBasicAuth] = useState(false);
const [basicAuthUsername, setBasicAuthUsername] = useState("");
const [basicAuthPassword, setBasicAuthPassword] = useState("");
const [disableOldCiphers, setDisableOldCiphers] = useState(false);

const areInputsValid = (): boolean => {
if (!isLocalPathValid(path)) return false;
Expand All @@ -51,6 +52,7 @@ const WebDav = () => {
},
remote: {
disableProxyErrorPage: false,
disableOldCiphers: false,
tunnelId: uuidv4(),
},
};
Expand All @@ -62,6 +64,8 @@ const WebDav = () => {
options.remote.basicAuthPassword = basicAuthPassword;
}

options.remote.disableOldCiphers = disableOldCiphers;

const message: Message<ExposeDirectoryMessage> = {
type: MessageTypeRequestTunnelStartWebDav,
payload: options,
Expand Down Expand Up @@ -105,6 +109,19 @@ const WebDav = () => {
passwordValue={basicAuthPassword}
passwordChangeCallback={setBasicAuthPassword}
/>
<div className="field">
<div className="control">
<label className="checkbox">
<input
type="checkbox"
onChange={(e) => {
setDisableOldCiphers(!disableOldCiphers);
}}
/>{" "}
I want to disable old TLS ciphers (older than TLS 1.2)
</label>
</div>
</div>
</div>
<div className="column is-12">
<div className="field is-grouped is-pulled-right">
Expand Down

0 comments on commit 0d4cbef

Please sign in to comment.