github.com/simpleiot/simpleiot@v0.18.3/frontend/src/Components/NodeDb.elm (about)

     1  module Components.NodeDb exposing (view)
     2  
     3  import Api.Point as Point
     4  import Components.NodeOptions exposing (NodeOptions, oToInputO)
     5  import Element exposing (..)
     6  import Element.Border as Border
     7  import UI.Icon as Icon
     8  import UI.NodeInputs as NodeInputs
     9  import UI.Style exposing (colors)
    10  
    11  
    12  view : NodeOptions msg -> Element msg
    13  view o =
    14      column
    15          [ width fill
    16          , Border.widthEach { top = 2, bottom = 0, left = 0, right = 0 }
    17          , Border.color colors.black
    18          , spacing 6
    19          ]
    20      <|
    21          wrappedRow [ spacing 10 ]
    22              [ Icon.database
    23              , text <|
    24                  Point.getText o.node.points Point.typeDescription ""
    25              ]
    26              :: (if o.expDetail then
    27                      let
    28                          labelWidth =
    29                              150
    30  
    31                          opts =
    32                              oToInputO o labelWidth
    33  
    34                          textInput =
    35                              NodeInputs.nodeTextInput opts "0"
    36                      in
    37                      [ text "InfluxDb 2.0 Database"
    38                      , textInput Point.typeDescription "Description" ""
    39                      , textInput Point.typeURI "URL" "https://myserver:8086"
    40                      , textInput Point.typeOrg "Organization" "org name"
    41                      , textInput Point.typeBucket "Bucket" "bucket name"
    42                      , textInput Point.typeAuthToken "Auth Token" ""
    43                      , NodeInputs.nodeListInput opts Point.typeTagPointType "Tag Point Types" "Add Point Type"
    44                      ]
    45  
    46                  else
    47                      []
    48                 )