add spinners to bp page and module page

This commit is contained in:
DieMyst 2021-03-12 18:05:13 +03:00
parent 2c4186946e
commit 3349097582
6 changed files with 24 additions and 14 deletions

View File

@ -8,13 +8,13 @@ import Html.Attributes exposing (attribute)
import Html.Events exposing (onClick)
import Info exposing (getBlueprintDescription)
import Instances.View
import Interface.View exposing (interfaceView)
import List.Unique exposing (..)
import Model exposing (Model)
import Modules.Model exposing (Module)
import Msg exposing (Msg(..))
import Palette exposing (classes, darkRed, redFont)
import Service.Model exposing (Interface)
import SpinnerView exposing (spinner)
view : Model -> String -> Html Msg
@ -41,8 +41,8 @@ view model id =
]
Nothing ->
div [ classes "cf ph2-ns" ]
[]
div [ classes "cf ph2-ns mt6" ]
(spinner model)
blueprintToInfo : Model -> String -> Maybe BlueprintViewInfo

View File

@ -35,7 +35,7 @@ view model =
List.map viewService filtered
finalView =
if List.length servicesView == 0 then
if List.isEmpty servicesView then
spinner model
else

View File

@ -48,7 +48,7 @@ view model filter =
|> List.concat
finalView =
if List.length instances == 0 then
if List.isEmpty instances then
Html.div [] (spinner model)
else

View File

@ -11,6 +11,7 @@ import Model exposing (Model)
import ModulePage.Model exposing (ModuleViewInfo)
import Modules.Model exposing (Module)
import Palette exposing (classes, redFont)
import SpinnerView exposing (spinner)
view : Model -> String -> Html msg
@ -41,8 +42,8 @@ view model id =
]
Nothing ->
div [ classes "cf ph2-ns" ]
[]
div [ classes "cf ph2-ns mt6" ]
(spinner model)
moduleToInfo : Dict String Module -> String -> Maybe ModuleViewInfo

View File

@ -118,7 +118,7 @@ view model =
List.map viewService info
finalView =
if List.length modulesView == 0 then
if List.isEmpty modulesView then
spinner model
else

View File

@ -5,6 +5,7 @@ import Html exposing (Html, div, p, table, tbody, td, text, th, thead, tr)
import Html.Attributes exposing (attribute)
import Model exposing (Model)
import Palette exposing (classes, redFont)
import SpinnerView exposing (spinner)
type alias Node =
@ -19,13 +20,21 @@ view model =
let
nodes =
modelToNodes model
finalView =
if List.isEmpty nodes then
spinner model
else
[ div [ classes "fl w-100 cf ph2-ns" ]
[ div [ classes "fl w-100 mb2 pt4 pb4" ]
[ div [ redFont, classes "f1 fw4 pt3" ] [ text "Network Nodes" ]
]
, div [ classes "fl w-100 mt2 mb4 bg-white br3" ] [ nodesView nodes ]
]
]
in
div [ classes "fl w-100 cf ph2-ns" ]
[ div [ classes "fl w-100 mb2 pt4 pb4" ]
[ div [ redFont, classes "f1 fw4 pt3" ] [ text "Network Nodes" ]
]
, div [ classes "fl w-100 mt2 mb4 bg-white br3" ] [ nodesView nodes ]
]
div [] finalView
modelToNodes : Model -> List Node