reload button

This commit is contained in:
DieMyst 2020-12-14 14:17:26 +03:00
parent b61b44de58
commit 8da5493f89
5 changed files with 35 additions and 5 deletions

11
images/reload.svg Normal file

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 64 KiB

View File

@ -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

View File

@ -12,3 +12,4 @@ type Msg
| AquamarineEvent Port.ReceiveEvent
| RelayChanged String
| ToggleInterface String
| Reload

View File

@ -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 =

View File

@ -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
]
[]
]
]
]
]
]