Add version info back to frontend

This commit is contained in:
Eike Kettner 2021-02-17 21:54:34 +01:00
parent 044a1e032c
commit a79fa6f74a
4 changed files with 32 additions and 5 deletions

View File

@ -6,7 +6,6 @@ module App.Data exposing
) )
import Api.Model.AuthResult exposing (AuthResult) import Api.Model.AuthResult exposing (AuthResult)
import Api.Model.BasicResult exposing (BasicResult)
import Api.Model.VersionInfo exposing (VersionInfo) import Api.Model.VersionInfo exposing (VersionInfo)
import Browser exposing (UrlRequest) import Browser exposing (UrlRequest)
import Browser.Navigation exposing (Key) import Browser.Navigation exposing (Key)

View File

@ -152,7 +152,7 @@ styleMain =
dataMenu : AuthResult -> Model -> Html Msg dataMenu : AuthResult -> Model -> Html Msg
dataMenu acc model = dataMenu _ model =
div [ class "relative" ] div [ class "relative" ]
[ a [ a
[ class dropdownLink [ class dropdownLink
@ -374,7 +374,7 @@ viewLogin model =
[ Html.map LoginMsg [ Html.map LoginMsg
(Login.viewSidebar model.sidebarVisible model.flags model.uiSettings model.loginModel) (Login.viewSidebar model.sidebarVisible model.flags model.uiSettings model.loginModel)
, Html.map LoginMsg , Html.map LoginMsg
(Login.viewContent model.flags model.uiSettings model.loginModel) (Login.viewContent model.flags model.version model.uiSettings model.loginModel)
] ]

View File

@ -11,6 +11,7 @@ module Comp.Basic exposing
, secondaryBasicButton , secondaryBasicButton
, secondaryButton , secondaryButton
, stats , stats
, tooltipRight
) )
import Html exposing (..) import Html exposing (..)
@ -264,6 +265,17 @@ inputRequired =
] ]
tooltipRight : Bool -> String -> Html msg
tooltipRight show msg =
div
[ class "absolute bottom-0 right-5 px-2 py-2 rounded-lg z-50 w-40"
, class "bg-white border"
, class "text-sm font-thin"
]
[ text msg
]
--- Helpers --- Helpers

View File

@ -1,5 +1,6 @@
module Page.Login.View2 exposing (viewContent, viewSidebar) module Page.Login.View2 exposing (viewContent, viewSidebar)
import Api.Model.VersionInfo exposing (VersionInfo)
import Data.Flags exposing (Flags) import Data.Flags exposing (Flags)
import Data.UiSettings exposing (UiSettings) import Data.UiSettings exposing (UiSettings)
import Html exposing (..) import Html exposing (..)
@ -19,8 +20,8 @@ viewSidebar _ _ _ _ =
[] []
viewContent : Flags -> UiSettings -> Model -> Html Msg viewContent : Flags -> VersionInfo -> UiSettings -> Model -> Html Msg
viewContent flags _ model = viewContent flags versionInfo _ model =
div div
[ id "content" [ id "content"
, class "h-full flex flex-col items-center justify-center w-full" , class "h-full flex flex-col items-center justify-center w-full"
@ -136,6 +137,21 @@ viewContent flags _ model =
] ]
] ]
] ]
, a
[ class "inline-flex items-center mt-4 text-xs opacity-50 hover:opacity-90"
, href "https://docspell.org"
, target "_new"
]
[ img
[ src (flags.config.docspellAssetPath ++ "/img/logo-mc-96.png")
, class "w-3 h-3 mr-1"
]
[]
, span []
[ text "Docspell "
, text versionInfo.version
]
]
] ]