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

希望能自由固定一种视图预览模式,默认是列表,每次预览图片,视频都要切换一下不方便 #4861

Closed
1 of 4 tasks
softwareygr opened this issue Jul 28, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@softwareygr
Copy link

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 / 实现思路

能否用js 打开的时候自动去点击修改

Additional context / 附件

No response

@softwareygr softwareygr added the enhancement New feature or request label Jul 28, 2023
@KNaiFen
Copy link

KNaiFen commented Jul 29, 2023

你这个需求我正好自己改过,我自己改的源码然后编译的,在alist-web的layout.tsx中添加这个:

  onMount(() => {
    const currentUrl = window.location.href;
    const targetUrl_1 = "your_url_1";
    const targetUrl_2 = "your_url_2";
    if (currentUrl === targetUrl_1) {
      setLayout('image');
    }
    if (currentUrl === targetUrl_2) {
      setLayout('list');
    }
  });

这样当url等于your_url_1的时候就会触发然后自动改变视图了,我自己的笨办法🤣
我也希望新版本能内置这个功能,具体表现大概就是元数据中能添加这个路径的视图,每次到这个路径就自动变成这个视图

xhofe referenced this issue in alist-org/alist-web Jul 29, 2023
@xhofe xhofe closed this as completed Jul 29, 2023
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

3 participants