Skip to content

Commit

Permalink
Work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
RaphaelGauthier committed Aug 21, 2023
1 parent e54fdac commit a24a7c4
Show file tree
Hide file tree
Showing 6 changed files with 363 additions and 45 deletions.
Expand Up @@ -13,6 +13,18 @@ type alias Flags =
, hasWriteRights : Bool
}

type ViewMode = ListView | GridView

type SortBy = FileName | FileSize | FileDate | FileRights

type SortOrder = Asc | Desc

type alias Filters =
{ filter : String
, sortBy : SortBy
, sortOrder : SortOrder
}

type alias Model =
{ api: String
, thumbnailsUrl: String
Expand Down Expand Up @@ -41,6 +53,8 @@ type alias Model =
, clipboardFiles: List FileMeta
, uploadQueue: List File
, hasWriteRights: Bool
, viewMode : ViewMode
, filters : Filters
}

type alias FileMeta =
Expand All @@ -51,6 +65,10 @@ type alias FileMeta =
, rights: String
}

type alias TreeItem =
{ name : String
, childs : List String
}
type Msg
= EnvMsg EnvMsg
| ChooseFiles
Expand All @@ -70,6 +88,8 @@ type Msg
| Delete
| UpdateApiPath String
| None
| ChangeViewMode ViewMode
| UpdateFilters Filters

type EnvMsg
= Open ()
Expand Down
Expand Up @@ -43,6 +43,8 @@ initModel { api, thumbnailsUrl, downloadsUrl, dir, hasWriteRights } =
, clipboardFiles = []
, uploadQueue = []
, hasWriteRights = hasWriteRights
, viewMode = GridView
, filters = Filters "" FileName Asc
}

update : Msg -> Model -> (Model, Cmd Msg)
Expand Down Expand Up @@ -125,4 +127,8 @@ update msg model = case msg of
Delete -> ({ model | showContextMenu = False, load = True }, delete model.api model.dir model.selected)
UpdateApiPath apiPath -> ({model | api = apiPath, downloadsUrl = apiPath } , listDirectory apiPath "")

ChangeViewMode viewMode -> ({model | viewMode = viewMode}, Cmd.none)

UpdateFilters filters -> ({model | filters = filters}, Cmd.none)

None -> (model, Cmd.none)

0 comments on commit a24a7c4

Please sign in to comment.