Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

离线下载优化 #119

Merged
merged 4 commits into from
Jul 7, 2022
Merged

离线下载优化 #119

merged 4 commits into from
Jul 7, 2022

Conversation

xb2016
Copy link
Contributor

@xb2016 xb2016 commented Jun 22, 2022

  1. 修复离线下载页面已完成任务 "打开存放目录" 跳转到根目录 (离线下载页面, 点击 "打开存放目录" 没有打开实际的存放目录而是跳转到了根目录 Cloudreve#798)
  2. 任务详情使用虚拟列表改善性能 ([3.5.2] 针对当前版本的一些体验性问题与建议 Cloudreve#1246)
  3. 关闭用户组离线下载权限时隐藏侧边栏离线下载按钮

</Table>
</div>
<TableVirtuoso
style={{ height: 85 * activeFiles().length }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥是85?这一高度不是固定的吧。我这边高度就57,这样计算会有空白:
image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

确实高度不固定,所以我在想要不要直接全部固定高度,不计算了

</TableBody>
</Table>
</div>
<TableVirtuoso
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

需要覆盖一下 Table 元素,不然元素长度小的时候撑不起来。
image

Suggested change
<TableVirtuoso
<TableVirtuoso
components={{
Table: (props) => (
<Table
{...props}
/>
),
}}

className={classes.scroll}
components={{
// eslint-disable-next-line react/display-name
TableRow: (props) => {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
TableRow: (props) => {
Table: (props) => (
<Table
size={"small"} // size 是small
{...props}
/>
),
TableRow: (props) => {

<>
<TableCell
component="th"
scope="row"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

当虚拟列表滚动到时候,因为文件名长度不同,表格整体的列宽度会来回跳。一个可能的解决办法是:把文件名这一栏强制占满整个宽度,并允许文字换行:
image

可以尝试给这个cell加上

word-break: break-all;
width: 100%

@xb2016 xb2016 force-pushed the aria2 branch 2 times, most recently from 67a3121 to 9c72cbc Compare June 24, 2022 14:10
@HFO4 HFO4 merged commit 22744e2 into cloudreve:master Jul 7, 2022
@HFO4
Copy link
Member

HFO4 commented Jul 7, 2022

Merged, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants