dashboard/src/Port.elm

50 lines
1013 B
Elm
Raw Normal View History

2020-11-23 14:27:33 +03:00
port module Port exposing (..)
2020-11-26 21:47:37 +03:00
import Blueprints.Model exposing (Blueprint)
2020-11-23 14:27:33 +03:00
import Dict exposing (Dict)
import Json.Encode exposing (Value)
2020-12-01 14:03:25 +03:00
import Modules.Model exposing (Module)
2020-11-26 21:47:37 +03:00
import Nodes.Model exposing (Identify)
2021-06-18 01:02:45 +03:00
import Service.Model exposing (Interface, Service)
type alias ServiceInfo =
{ id : String
, blueprint_id : String
, owner_id : String
}
2020-11-23 14:27:33 +03:00
2021-06-17 23:16:17 +03:00
type alias CollectPeerInfo =
{ peerId : String
, identify : Maybe Identify
2021-06-18 01:02:45 +03:00
, services : Maybe (List ServiceInfo)
2021-06-17 23:16:17 +03:00
, modules : Maybe (List Module)
, blueprints : Maybe (List Blueprint)
}
port collectPeerInfo : (CollectPeerInfo -> msg) -> Sub msg
type alias CollectServiceInterface =
2021-06-18 01:02:45 +03:00
{ peer_id : String
2021-06-17 23:16:17 +03:00
, service_id : String
2021-06-18 01:02:45 +03:00
, interface : Interface
2021-06-17 23:16:17 +03:00
}
2020-11-23 14:27:33 +03:00
2021-06-17 23:16:17 +03:00
port collectServiceInterface : (CollectServiceInterface -> msg) -> Sub msg
2020-11-23 15:44:45 +03:00
port relayChanged : (String -> msg) -> Sub msg
type alias GetAll =
{ relayPeerId : String
, knownPeers : List String
}
port getAll : GetAll -> Cmd msg