mirror of
https://github.com/fluencelabs/dashboard
synced 2024-12-04 23:30:20 +00:00
reload button
This commit is contained in:
parent
b61b44de58
commit
8da5493f89
11
images/reload.svg
Normal file
11
images/reload.svg
Normal file
File diff suppressed because one or more lines are too long
After Width: | Height: | Size: 64 KiB |
@ -8,6 +8,7 @@ type alias ModuleDescription =
|
||||
, description : String
|
||||
}
|
||||
|
||||
|
||||
type alias BlueprintDescription =
|
||||
{ description : String
|
||||
}
|
||||
@ -22,10 +23,12 @@ getModuleDescription : String -> String
|
||||
getModuleDescription name =
|
||||
modulesDescription |> Dict.get name |> Maybe.map .description |> Maybe.withDefault ""
|
||||
|
||||
|
||||
getBlueprintDescription : String -> String
|
||||
getBlueprintDescription name =
|
||||
blueprintsDescription |> Dict.get name |> Maybe.map .description |> Maybe.withDefault ""
|
||||
|
||||
|
||||
modulesDescription : Dict String ModuleDescription
|
||||
modulesDescription =
|
||||
Dict.fromList
|
||||
@ -41,6 +44,7 @@ modulesDescription =
|
||||
, ( "facade_url_downloader", { site = "https://github.com/fluencelabs/fce/tree/master/examples/url-downloader/facade", description = "Adapter module for cURL CLI utility" } )
|
||||
]
|
||||
|
||||
|
||||
blueprintsDescription : Dict String BlueprintDescription
|
||||
blueprintsDescription =
|
||||
Dict.fromList
|
||||
|
@ -12,3 +12,4 @@ type Msg
|
||||
| AquamarineEvent Port.ReceiveEvent
|
||||
| RelayChanged String
|
||||
| ToggleInterface String
|
||||
| Reload
|
||||
|
@ -16,6 +16,7 @@ limitations under the License.
|
||||
|
||||
-}
|
||||
|
||||
import AirScripts.GetAll as GetAll
|
||||
import Blueprints.Model exposing (Blueprint)
|
||||
import Browser
|
||||
import Browser.Navigation as Nav
|
||||
@ -25,6 +26,7 @@ import Model exposing (Model, PeerData, emptyPeerData)
|
||||
import Modules.Model exposing (Module)
|
||||
import Msg exposing (..)
|
||||
import Nodes.Model exposing (Identify)
|
||||
import Port exposing (sendAir)
|
||||
import Route exposing (getAllCmd)
|
||||
import Service.Model exposing (Service)
|
||||
import Url
|
||||
@ -66,11 +68,6 @@ update msg model =
|
||||
|
||||
updatedDict =
|
||||
Dict.union model.discoveredPeers newDict
|
||||
|
||||
emptyPeers =
|
||||
Dict.toList updatedDict
|
||||
|> List.filter (\( _, data ) -> List.isEmpty data.identify.external_addresses)
|
||||
|> List.map Tuple.first
|
||||
in
|
||||
( { model | discoveredPeers = updatedDict }, getAllCmd model.peerId model.relayId [] )
|
||||
|
||||
@ -107,6 +104,9 @@ update msg model =
|
||||
RelayChanged relayId ->
|
||||
( { model | relayId = relayId }, Cmd.none )
|
||||
|
||||
Reload ->
|
||||
( model, sendAir (GetAll.air model.peerId model.relayId model.knownPeers) )
|
||||
|
||||
|
||||
updateModel : Model -> String -> Identify -> List Service -> List Module -> List Blueprint -> Model
|
||||
updateModel model peer identify services modules blueprints =
|
||||
|
14
src/View.elm
14
src/View.elm
@ -19,6 +19,7 @@ limitations under the License.
|
||||
import Browser exposing (Document, UrlRequest(..))
|
||||
import Html exposing (Html, a, div, header, img, p, text)
|
||||
import Html.Attributes exposing (attribute, style)
|
||||
import Html.Events exposing (onClick)
|
||||
import Model exposing (Model, Route(..))
|
||||
import Msg exposing (..)
|
||||
import Palette exposing (classes)
|
||||
@ -64,6 +65,19 @@ body model =
|
||||
[ a [ attribute "href" "/nodes", classes "link black" ] [ text "Nodes" ]
|
||||
]
|
||||
]
|
||||
, div [ classes "fl fr" ]
|
||||
[ a [ attribute "href" "/" ]
|
||||
[ img
|
||||
[ classes "mw-100"
|
||||
, style "height" "20px"
|
||||
, attribute "src" "/images/reload.svg"
|
||||
, style "position" "relative"
|
||||
, style "top" "0.85rem"
|
||||
, onClick Reload
|
||||
]
|
||||
[]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user