mirror of
https://github.com/fluencelabs/dashboard
synced 2025-04-29 01:32:13 +00:00
combine all modules
This commit is contained in:
parent
a3bce9f135
commit
39cb18306e
@ -23,6 +23,7 @@ import Browser.Navigation as Nav
|
|||||||
import Dict
|
import Dict
|
||||||
import Json.Decode exposing (decodeValue, list, string)
|
import Json.Decode exposing (decodeValue, list, string)
|
||||||
import Json.Encode exposing (Value)
|
import Json.Encode exposing (Value)
|
||||||
|
import List.Unique exposing (filterDuplicates)
|
||||||
import Maybe exposing (withDefault)
|
import Maybe exposing (withDefault)
|
||||||
import Model exposing (Model, emptyPeerData)
|
import Model exposing (Model, emptyPeerData)
|
||||||
import Modules.Air
|
import Modules.Air
|
||||||
@ -173,3 +174,12 @@ updateModel model peer identify services modules blueprints =
|
|||||||
in
|
in
|
||||||
{ model | discoveredPeers = updated }
|
{ model | discoveredPeers = updated }
|
||||||
|
|
||||||
|
getAllModules : Model -> List String
|
||||||
|
getAllModules model =
|
||||||
|
let
|
||||||
|
peerDatas = Dict.values model.discoveredPeers
|
||||||
|
allModules = peerDatas |> List.map (\pd -> pd.modules)
|
||||||
|
flatten = List.foldr (++) [] (allModules)
|
||||||
|
modulesUnique = filterDuplicates (flatten)
|
||||||
|
in
|
||||||
|
modulesUnique
|
||||||
|
Loading…
x
Reference in New Issue
Block a user