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

希望增加能够记住排序设定的功能 #7332

Open
4 tasks done
LAOZTK opened this issue Oct 14, 2024 · 2 comments
Open
4 tasks done

希望增加能够记住排序设定的功能 #7332

LAOZTK opened this issue Oct 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@LAOZTK
Copy link

LAOZTK commented Oct 14, 2024

Please make sure of the following things

  • I have read the documentation.
  • I'm sure there are no duplicate issues or discussions.
  • I'm sure this feature is not implemented.
  • I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

上一级目录按了按时间排序,然后进入子目录后,返回上一级目录,还是按照时间排序
现在每次返回都是按照默认方式排序,没办法记住排序的方式

Suggested solution / 实现思路

No response

Additional context / 附件

No response

@LAOZTK LAOZTK added the enhancement New feature or request label Oct 14, 2024
Copy link

welcome bot commented Oct 14, 2024

Thanks for opening your first issue here! Be sure to follow the issue template!

@Rirmach
Copy link

Rirmach commented Oct 19, 2024

+1,附实现思路:

  1. 在数据库中,添加 table,table 名可以为 [prefix]_order_rule,field 包含路径 path,order_by,order_direction,add_time
  2. UI 中,点击文件列表表头,触发排序规则的更新 API(不知前端是否支持?),API 可以为 POST /api/fs/order,参数包含 path,order_by,order_direction,取值与 storage 表兼容
  3. 后端直接写入数据库,同时设置该规则的添加时间 add_time 为当前时间戳
  4. 当前端请求 /api/fs/list 返回目录列表时,同时在返回值中设置 order_by,order_direction 的值,由后端从数据库中查询,并在前端应用该排序规则;如无法查到,返回 storage 表中对应的配置作为缺省值
  5. 避免在后端进行排序,以降低服务器压力
  6. 每次查询到 order_rule 表中的排序规则时,更新 add_time 为当前时间戳
  7. alist 定期清理该表中所有超时的记录(通过预设超时时间实现)。超时代表用户长期不访问该目录,清理不会影响用户体验
  8. 建议在数据库中添加字段以记录程序上次启动和上次停止的时间戳,这样计算超时用户体验更好
  9. 也可考虑在 redis 中实现该功能,如 alist 打算引入 redis,建议将基础索引功能也迁移到 redis 中
  10. 有空提 PR,现在蹲个好心人

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

No branches or pull requests

2 participants