Desktop: fix bugs when changing numbers in configuration
This commit is contained in:
parent
7b5c9cad60
commit
808bef11db
8 changed files with 21 additions and 19 deletions
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
|
|
@ -29,7 +29,7 @@ jobs:
|
||||||
with:
|
with:
|
||||||
generate_release_notes: true
|
generate_release_notes: true
|
||||||
files: |
|
files: |
|
||||||
desktop/src-tauri/target/release/bundle/msi/rqbit-desktop_5.0.1_x64_en-US.msi
|
desktop/src-tauri/target/release/bundle/msi/rqbit-desktop_5.0.2_x64_en-US.msi
|
||||||
|
|
||||||
- name: Build release
|
- name: Build release
|
||||||
run: cargo build --profile release-github
|
run: cargo build --profile release-github
|
||||||
|
|
|
||||||
2
crates/librqbit/webui/dist/assets/index.js
vendored
2
crates/librqbit/webui/dist/assets/index.js
vendored
File diff suppressed because one or more lines are too long
2
crates/librqbit/webui/dist/manifest.json
vendored
2
crates/librqbit/webui/dist/manifest.json
vendored
|
|
@ -4,7 +4,7 @@
|
||||||
"src": "assets/logo.svg"
|
"src": "assets/logo.svg"
|
||||||
},
|
},
|
||||||
"index.html": {
|
"index.html": {
|
||||||
"file": "assets/index-8d982016.js",
|
"file": "assets/index-b673c0d1.js",
|
||||||
"isEntry": true,
|
"isEntry": true,
|
||||||
"src": "index.html"
|
"src": "index.html"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -67,12 +67,12 @@ async fn forward_port(
|
||||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
|
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
|
||||||
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||||
<s:Body>
|
<s:Body>
|
||||||
<u:AddPortMapping xmlns:u="{}">
|
<u:AddPortMapping xmlns:u="{SERVICE_TYPE_WAN_IP_CONNECTION}">
|
||||||
<NewRemoteHost></NewRemoteHost>
|
<NewRemoteHost></NewRemoteHost>
|
||||||
<NewExternalPort>{}</NewExternalPort>
|
<NewExternalPort>{port}</NewExternalPort>
|
||||||
<NewProtocol>TCP</NewProtocol>
|
<NewProtocol>TCP</NewProtocol>
|
||||||
<NewInternalPort>{}</NewInternalPort>
|
<NewInternalPort>{port}</NewInternalPort>
|
||||||
<NewInternalClient>{}</NewInternalClient>
|
<NewInternalClient>{local_ip}</NewInternalClient>
|
||||||
<NewEnabled>1</NewEnabled>
|
<NewEnabled>1</NewEnabled>
|
||||||
<NewPortMappingDescription>rust UPnP</NewPortMappingDescription>
|
<NewPortMappingDescription>rust UPnP</NewPortMappingDescription>
|
||||||
<NewLeaseDuration>{}</NewLeaseDuration>
|
<NewLeaseDuration>{}</NewLeaseDuration>
|
||||||
|
|
@ -80,10 +80,6 @@ async fn forward_port(
|
||||||
</s:Body>
|
</s:Body>
|
||||||
</s:Envelope>
|
</s:Envelope>
|
||||||
"#,
|
"#,
|
||||||
SERVICE_TYPE_WAN_IP_CONNECTION,
|
|
||||||
port,
|
|
||||||
port,
|
|
||||||
local_ip,
|
|
||||||
lease_duration.as_secs()
|
lease_duration.as_secs()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
||||||
2
desktop/src-tauri/Cargo.lock
generated
2
desktop/src-tauri/Cargo.lock
generated
|
|
@ -3011,7 +3011,7 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "rqbit-desktop"
|
name = "rqbit-desktop"
|
||||||
version = "5.0.1"
|
version = "5.0.2"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"base64 0.21.5",
|
"base64 0.21.5",
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "rqbit-desktop"
|
name = "rqbit-desktop"
|
||||||
version = "5.0.1"
|
version = "5.0.2"
|
||||||
description = "rqbit torrent client"
|
description = "rqbit torrent client"
|
||||||
authors = ["you"]
|
authors = ["you"]
|
||||||
license = ""
|
license = ""
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function errorToUIError(
|
||||||
let reason: ErrorDetails = {
|
let reason: ErrorDetails = {
|
||||||
method: "INVOKE",
|
method: "INVOKE",
|
||||||
path: path,
|
path: path,
|
||||||
text: e.human_readable,
|
text: e.human_readable ?? e.toString(),
|
||||||
status: e.status,
|
status: e.status,
|
||||||
statusText: e.status_text,
|
statusText: e.status_text,
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ const FormCheck: React.FC<{
|
||||||
label: string;
|
label: string;
|
||||||
name: string;
|
name: string;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
onChange: (e: any) => void;
|
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
help?: string;
|
help?: string;
|
||||||
}> = ({ label, name, checked, onChange, disabled, help }) => {
|
}> = ({ label, name, checked, onChange, disabled, help }) => {
|
||||||
|
|
@ -35,7 +35,7 @@ const FormInput: React.FC<{
|
||||||
name: string;
|
name: string;
|
||||||
value: string | number;
|
value: string | number;
|
||||||
inputType: string;
|
inputType: string;
|
||||||
onChange: (e: any) => void;
|
onChange: React.ChangeEventHandler<HTMLInputElement>;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
help?: string;
|
help?: string;
|
||||||
}> = ({ label, name, value, inputType, onChange, disabled, help }) => {
|
}> = ({ label, name, value, inputType, onChange, disabled, help }) => {
|
||||||
|
|
@ -76,9 +76,13 @@ export const ConfigModal: React.FC<{
|
||||||
|
|
||||||
const [error, setError] = useState<any | null>(null);
|
const [error, setError] = useState<any | null>(null);
|
||||||
|
|
||||||
const handleInputChange = (e: any) => {
|
const handleInputChange: React.ChangeEventHandler<HTMLInputElement> = (e) => {
|
||||||
const name: string = e.target.name;
|
const name: string = e.target.name;
|
||||||
const value: any = e.target.value;
|
let value: string | number = e.target.value;
|
||||||
|
if (e.target.type == "number") {
|
||||||
|
value = e.target.valueAsNumber;
|
||||||
|
}
|
||||||
|
console.log(value, typeof value);
|
||||||
const [mainField, subField] = name.split(".", 2);
|
const [mainField, subField] = name.split(".", 2);
|
||||||
|
|
||||||
if (subField) {
|
if (subField) {
|
||||||
|
|
@ -97,7 +101,9 @@ export const ConfigModal: React.FC<{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleToggleChange = (e: any) => {
|
const handleToggleChange: React.ChangeEventHandler<HTMLInputElement> = (
|
||||||
|
e
|
||||||
|
) => {
|
||||||
const name: string = e.target.name;
|
const name: string = e.target.name;
|
||||||
const [mainField, subField] = name.split(".", 2);
|
const [mainField, subField] = name.split(".", 2);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue