chore: add custom office viewer

This commit is contained in:
Noah Hsu 2022-08-08 13:03:34 +08:00
parent 2b04cf4ac3
commit 6f48a0a82a
2 changed files with 9 additions and 2 deletions

View File

@ -83,7 +83,13 @@ func initialSettings() {
{Key: conf.ImageTypes, Value: "jpg,tiff,jpeg,png,gif,bmp,svg,ico,swf,webp", Type: conf.TypeText, Group: model.PREVIEW, Flag: model.PRIVATE},
{Key: conf.OfficeTypes, Value: "doc,docx,xls,xlsx,ppt,pptx,pdf", Type: conf.TypeText, Group: model.PREVIEW, Flag: model.PRIVATE},
{Key: conf.ProxyTypes, Value: "m3u8", Type: conf.TypeText, Group: model.PREVIEW, Flag: model.PRIVATE},
{Key: conf.PdfViewerUrl, Value: "https://alist-org.github.io/pdf.js/web/viewer.html?file=$url", Type: conf.TypeString, Group: model.PREVIEW},
{Key: conf.OfficeViewers, Value: `{
"Microsoft":"https://view.officeapps.live.com/op/view.aspx?src=$url",
"Google":"https://docs.google.com/gview?url=$url&embedded=true",
}`, Type: conf.TypeText, Group: model.PREVIEW},
{Key: conf.PdfViewers, Value: `{
"pdf.js":"https://alist-org.github.io/pdf.js/web/viewer.html?file=$url"
}`, Type: conf.TypeText, Group: model.PREVIEW},
{Key: conf.AudioAutoplay, Value: "true", Type: conf.TypeBool, Group: model.PREVIEW},
{Key: conf.VideoAutoplay, Value: "true", Type: conf.TypeBool, Group: model.PREVIEW},
// global settings

View File

@ -26,7 +26,8 @@ const (
ImageTypes = "image_types"
OfficeTypes = "office_types"
ProxyTypes = "proxy_types"
PdfViewerUrl = "pdf_viewer_url"
OfficeViewers = "office_viewers"
PdfViewers = "pdf_viewers"
AudioAutoplay = "audio_autoplay"
VideoAutoplay = "video_autoplay"