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

     1  module Components.NodeMessageService 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.send
    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  
    37                          optionInput =
    38                              NodeInputs.nodeOptionInput opts "0"
    39                      in
    40                      [ textInput Point.typeDescription "Description" ""
    41                      , optionInput Point.typeService
    42                          "Service"
    43                          [ ( Point.valueTwilio, "Twilio SMS" )
    44                          ]
    45                      , textInput Point.typeSID "SID" ""
    46                      , textInput Point.typeAuthToken "Auth Token" ""
    47                      , textInput Point.typeFrom "From" ""
    48                      , NodeInputs.nodeKeyValueInput opts Point.typeTag "Tags" "Add Tag"
    49                      ]
    50  
    51                  else
    52                      []
    53                 )