feat(wopi): adapt libreoffice online

This commit is contained in:
HFO4
2023-01-09 19:38:12 +08:00
parent 1c922ac981
commit 5a8c86c72e
4 changed files with 24 additions and 9 deletions

View File

@@ -12,8 +12,9 @@ import (
type ActonType string
var (
ActionPreview = ActonType("embedview")
ActionEdit = ActonType("edit")
ActionPreview = ActonType("embedview")
ActionPreviewFallback = ActonType("view")
ActionEdit = ActonType("edit")
)
const (
@@ -33,8 +34,9 @@ func (c *client) AvailableExts() []string {
for ext, actions := range c.actions {
_, previewable := actions[string(ActionPreview)]
_, editable := actions[string(ActionEdit)]
_, previewableFallback := actions[string(ActionPreviewFallback)]
if previewable || editable {
if previewable || editable || previewableFallback {
exts = append(exts, strings.TrimPrefix(ext, "."))
}
}