alist-org / alist

🗂️A file list/WebDAV program that supports multiple storages, powered by Gin and Solidjs. / 一个支持多存储的文件列表/WebDAV程序,使用 Gin 和 Solidjs。
https://alist.nn.ci
GNU Affero General Public License v3.0
42.52k stars 5.5k forks source link

希望添加对无后缀文件的预览选项 #6417

Closed Cnily03 closed 4 months ago

Cnily03 commented 5 months ago

Please make sure of the following things

Description of the feature / 需求描述

诸如 Dockerfile 等文件固定为文本文件,但是当前的 alist 只能设置后缀名

Suggested solution / 实现思路

希望对“预览”配置增加一个根据文件名(或其正则)的配置(而不仅仅是根据后缀名来设置)

或者在前端能够支持?type=txt的 URL 参数

Additional context / 附件

No response

welcome[bot] commented 5 months ago

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

potoo0 commented 4 months ago

@xhofe 我也有类似需求,你觉得以下方式哪种比较好?

potoo0 commented 4 months ago

使用说明( 后续会补充到文档里 ):

请求参数加 type, 可选值(不区分大小写):

UNKNOWN
FOLDER
VIDEO
AUDIO
TEXT
IMAGE

示例: http://alist.code.com/local/test.ahk?type=text