mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 18:38:26 +00:00
Download multiple files as zip
This commit is contained in:
49
modules/webapp/src/main/elm/Data/DownloadAllState.elm
Normal file
49
modules/webapp/src/main/elm/Data/DownloadAllState.elm
Normal file
@ -0,0 +1,49 @@
|
||||
{-
|
||||
Copyright 2020 Eike K. & Contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-}
|
||||
|
||||
|
||||
module Data.DownloadAllState exposing (DownloadAllState(..), all, asString, fromString)
|
||||
|
||||
|
||||
type DownloadAllState
|
||||
= NotPresent
|
||||
| Forbidden
|
||||
| Empty
|
||||
| Preparing
|
||||
| Present
|
||||
|
||||
|
||||
all : List DownloadAllState
|
||||
all =
|
||||
[ NotPresent, Forbidden, Empty, Preparing, Present ]
|
||||
|
||||
|
||||
asString : DownloadAllState -> String
|
||||
asString st =
|
||||
case st of
|
||||
NotPresent ->
|
||||
"notpresent"
|
||||
|
||||
Forbidden ->
|
||||
"forbidden"
|
||||
|
||||
Empty ->
|
||||
"empty"
|
||||
|
||||
Preparing ->
|
||||
"preparing"
|
||||
|
||||
Present ->
|
||||
"present"
|
||||
|
||||
|
||||
fromString : String -> Maybe DownloadAllState
|
||||
fromString str =
|
||||
let
|
||||
name =
|
||||
String.toLower str
|
||||
in
|
||||
List.filter (\e -> asString e == name) all |> List.head
|
41
modules/webapp/src/main/elm/Data/DownloadFileType.elm
Normal file
41
modules/webapp/src/main/elm/Data/DownloadFileType.elm
Normal file
@ -0,0 +1,41 @@
|
||||
{-
|
||||
Copyright 2020 Eike K. & Contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-}
|
||||
|
||||
|
||||
module Data.DownloadFileType exposing (DownloadFileType(..), all, asString, fromString)
|
||||
|
||||
|
||||
type DownloadFileType
|
||||
= Converted
|
||||
| Originals
|
||||
|
||||
|
||||
all : List DownloadFileType
|
||||
all =
|
||||
[ Converted, Originals ]
|
||||
|
||||
|
||||
asString : DownloadFileType -> String
|
||||
asString ft =
|
||||
case ft of
|
||||
Converted ->
|
||||
"converted"
|
||||
|
||||
Originals ->
|
||||
"original"
|
||||
|
||||
|
||||
fromString : String -> Maybe DownloadFileType
|
||||
fromString str =
|
||||
case String.toLower str of
|
||||
"converted" ->
|
||||
Just Converted
|
||||
|
||||
"originals" ->
|
||||
Just Originals
|
||||
|
||||
_ ->
|
||||
Nothing
|
@ -35,6 +35,8 @@ type alias Config =
|
||||
, maxPageSize : Int
|
||||
, maxNoteLength : Int
|
||||
, showClassificationSettings : Bool
|
||||
, downloadAllMaxFiles : Int
|
||||
, downloadAllMaxSize : Int
|
||||
, openIdAuth : List OpenIdAuth
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user