mirror of
https://github.com/fluencelabs/dashboard
synced 2025-03-16 13:30:48 +00:00
interface to string
This commit is contained in:
parent
370cd20a31
commit
58c8a9a3f7
1
elm.json
1
elm.json
@ -22,6 +22,7 @@
|
||||
"elm-community/graph": "6.0.0",
|
||||
"elm-community/intdict": "3.0.0",
|
||||
"ivadzy/bbase64": "1.1.1",
|
||||
"lukewestby/elm-string-interpolate": "1.0.4",
|
||||
"mpizenberg/elm-pointer-events": "4.0.2",
|
||||
"rtfeldman/elm-iso8601-date-strings": "1.1.3"
|
||||
},
|
||||
|
@ -1,8 +1,11 @@
|
||||
module ModulePage.View exposing (..)
|
||||
|
||||
import Html exposing (Html)
|
||||
import Json.Encode as Encode
|
||||
import ModulePage.Model exposing (ModuleInfo)
|
||||
import Palette exposing (classes)
|
||||
import Services.Model exposing (Record)
|
||||
import String.Interpolate exposing(interpolate)
|
||||
|
||||
view : ModuleInfo -> Html msg
|
||||
view moduleInfo =
|
||||
@ -15,8 +18,27 @@ view moduleInfo =
|
||||
viewInfo : ModuleInfo -> Html msg
|
||||
viewInfo moduleInfo =
|
||||
Html.article [classes "cf"]
|
||||
[ Html.div [classes "fl w-30 gray"] [Html.text "AUTHOR"]
|
||||
, Html.div [classes "fl w-70"] [ Html.span [classes "fl w-100 black b"] [Html.text moduleInfo.author], Html.span [classes "fl w-100 black"] [Html.text moduleInfo.authorPeerId]]
|
||||
, Html.div [classes "fl w-30 gray"] [Html.text "DESCRIPTION"]
|
||||
, Html.div [classes "fl w-70"] [ Html.span [classes "fl w-100 black b"] [Html.text moduleInfo.author]]
|
||||
[ Html.div [classes "fl w-30 gray mv1"] [Html.text "AUTHOR"]
|
||||
, Html.div [classes "fl w-70 mv1"] [ Html.span [classes "fl w-100 black b"] [Html.text moduleInfo.author], Html.span [classes "fl w-100 black"] [Html.text moduleInfo.authorPeerId]]
|
||||
, Html.div [classes "fl w-30 gray mv1"] [Html.text "DESCRIPTION"]
|
||||
, Html.div [classes "fl w-70 mv1"] [ Html.span [classes "fl w-100 black"] [Html.text moduleInfo.description]]
|
||||
, Html.div [classes "fl w-30 gray mv1"] [Html.text "INTERFACE"]
|
||||
, Html.div [classes "fl w-70 mv1"] [ Html.span [classes "fl w-100 black"] (recordsToString moduleInfo.service.interface.record_types)]
|
||||
]
|
||||
|
||||
recordsToString : List Record -> List (Html msg)
|
||||
recordsToString record =
|
||||
(List.map recordToString record)
|
||||
|
||||
recordToString : Record -> Html msg
|
||||
recordToString record =
|
||||
Html.div [classes "i"]
|
||||
([Html.span [classes "fl w-100 mt2"] [Html.text (record.name ++ " {")]] ++
|
||||
fieldsToString record.fields ++
|
||||
[Html.span [classes "fl w-100 mb2"] [Html.text ("}")]])
|
||||
|
||||
|
||||
fieldsToString : List (List String) -> List (Html msg)
|
||||
fieldsToString fields =
|
||||
(fields |> List.map (\f -> Html.span [classes "fl w-100 ml2"] [Html.text (String.join ": " f)] ))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user