github.com/simpleiot/simpleiot@v0.18.3/frontend/src/Components/NodeNetworkManagerConn.elm (about) 1 module Components.NodeNetworkManagerConn 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 Element.Font as Font 8 import UI.Icon as Icon 9 import UI.NodeInputs as NodeInputs 10 import UI.Style as Style 11 12 13 view : NodeOptions msg -> Element msg 14 view o = 15 column 16 [ width fill 17 , Border.widthEach { top = 2, bottom = 0, left = 0, right = 0 } 18 , Border.color Style.colors.black 19 , spacing 6 20 ] 21 <| 22 wrappedRow [ spacing 10 ] 23 [ Icon.cable 24 , text <| 25 Point.getText o.node.points Point.typeDescription "" 26 ] 27 :: (if o.expDetail then 28 let 29 labelWidth = 30 150 31 32 opts = 33 oToInputO o labelWidth 34 35 textInput = 36 NodeInputs.nodeTextInput opts "0" 37 38 textInputKey = 39 NodeInputs.nodeTextInput opts 40 41 checkboxInput = 42 NodeInputs.nodeCheckboxInput opts "0" 43 44 checkboxInputKey = 45 NodeInputs.nodeCheckboxInput opts 46 47 numberInput = 48 NodeInputs.nodeNumberInput opts "0" 49 50 numberInputKey = 51 NodeInputs.nodeNumberInput opts 52 in 53 [ textInput Point.typeDescription "Description" "" 54 , checkboxInput "disabled" "Disabled" 55 , textInput "interface" "Interface" "" 56 , checkboxInput "autoConnect" "Auto connect" 57 , numberInput "autoConnectPriority" "Auto conn priority" 58 , el [ Font.bold, centerX ] <| text "IPv4 Settings" 59 , checkboxInputKey "ipv4Config" "staticIP" "Static IP" 60 , textInputKey "ipv4Config" "address" "Address" "1.2.3.4" 61 , textInputKey "ipv4Config" "netmask" "Netmask" "255.255.0.0" 62 , textInputKey "ipv4Config" "gateway" "Gateway" "10.0.0.1" 63 , textInputKey "ipv4Config" "dnsServer1" "DNS Server 1" "8.8.8.8" 64 , textInputKey "ipv4Config" "dnsServer2" "DNS Server 2" "8.8.4.4" 65 , el [ Font.bold, centerX ] <| text "IPv6 Settings" 66 , checkboxInputKey "ipv6Config" "staticIP" "Static IP" 67 , textInputKey "ipv6Config" "address" "Address" "" 68 , numberInputKey "ipv6Config" "prefix" "Prefix" 69 , textInputKey "ipv6Config" "gateway" "Gateway" "" 70 , textInputKey "ipv6Config" "dnsServer1" "DNS Server 1" "" 71 , textInputKey "ipv6Config" "dnsServer2" "DNS Server 2" "" 72 ] 73 74 else 75 [] 76 )