From dc81a86ae88b2f64a26bfc34918a22cd0be3429e Mon Sep 17 00:00:00 2001
From: HFO4 <912394456@qq.com>
Date: Sun, 30 Oct 2022 10:37:35 +0800
Subject: [PATCH] feat(remote download): show download node in list page
---
public/locales/en-US/application.json | 1 +
public/locales/zh-CN/application.json | 1 +
src/component/Download/DownloadingCard.js | 11 +++++++++++
src/component/Download/FinishedCard.js | 11 +++++++++++
src/component/Modals/DirectoryDownload.js | 2 +-
5 files changed, 25 insertions(+), 1 deletion(-)
diff --git a/public/locales/en-US/application.json b/public/locales/en-US/application.json
index bc47de0..6c6b31d 100644
--- a/public/locales/en-US/application.json
+++ b/public/locales/en-US/application.json
@@ -378,6 +378,7 @@
"InfoHash": "InfoHash: ",
"seederCount": "Seeders:",
"seeding": "Seeding: ",
+ "downloadNode": "Node: ",
"isSeeding": "Yes",
"notSeeding": "No",
"chunkSize": "Chunk size:",
diff --git a/public/locales/zh-CN/application.json b/public/locales/zh-CN/application.json
index 71f6c43..b69548b 100644
--- a/public/locales/zh-CN/application.json
+++ b/public/locales/zh-CN/application.json
@@ -378,6 +378,7 @@
"InfoHash": "InfoHash:",
"seederCount": "做种者:",
"seeding": "做种中:",
+ "downloadNode": "节点:",
"isSeeding": "是",
"notSeeding": "否",
"chunkSize": "分片大小:",
diff --git a/src/component/Download/DownloadingCard.js b/src/component/Download/DownloadingCard.js
index 750a71c..db04320 100644
--- a/src/component/Download/DownloadingCard.js
+++ b/src/component/Download/DownloadingCard.js
@@ -158,9 +158,12 @@ const useStyles = makeStyles((theme) => ({
},
infoTitle: {
fontWeight: 700,
+ textAlign: "left",
},
infoValue: {
color: theme.palette.text.secondary,
+ textAlign: "left",
+ paddingLeft:theme.spacing(1),
},
bitmap: {
width: "100%",
@@ -741,6 +744,14 @@ export default function DownloadingCard(props) {
{task.info.numPieces}
+ {props.task.node &&
+
+ {t("downloadNode")}
+
+
+ {props.task.node}
+
+ }
diff --git a/src/component/Download/FinishedCard.js b/src/component/Download/FinishedCard.js
index 2f24cdd..ca76353 100644
--- a/src/component/Download/FinishedCard.js
+++ b/src/component/Download/FinishedCard.js
@@ -155,9 +155,12 @@ const useStyles = makeStyles((theme) => ({
},
infoTitle: {
fontWeight: 700,
+ textAlign: "left",
},
infoValue: {
color: theme.palette.text.secondary,
+ textAlign: "left",
+ paddingLeft:theme.spacing(1),
},
}));
@@ -470,6 +473,14 @@ export default function FinishedCard(props) {
{formatLocalTime(props.task.update)}
+ {props.task.node &&
+
+ {t("downloadNode")}
+
+
+ {props.task.node}
+
+ }
diff --git a/src/component/Modals/DirectoryDownload.js b/src/component/Modals/DirectoryDownload.js
index f301f5f..1740990 100644
--- a/src/component/Modals/DirectoryDownload.js
+++ b/src/component/Modals/DirectoryDownload.js
@@ -11,7 +11,7 @@ import {
Checkbox,
} from "@material-ui/core";
import TextField from "@material-ui/core/TextField";
-import { useTranslation } from "react-i18next";
+import { useTranslation } from "react-i18next";
import { useInterval, usePrevious, useGetState } from "ahooks";
import { cancelDirectoryDownload } from "../../redux/explorer/action";
import Auth from "../../middleware/Auth";