mirror of
https://github.com/prometheus/alertmanager
synced 2025-01-19 12:40:49 +00:00
Render page header aka nav bar with elm (#4)
This replaces the static nav bar specification in the index.html file.
This commit is contained in:
parent
5e56d34e88
commit
0790930343
18
index.html
18
index.html
@ -8,21 +8,6 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<header class="bg-black-90 fixed w-100 ph3 pv3 pv4-ns ph4-m ph5-l">
|
||||
<nav class="w-80 center f6 fw6 ttu tracked">
|
||||
<a class="link dim white dib mr3" href="#" title="Home">AlertManager</a>
|
||||
<a class="link dim white dib mr3" href="#/alerts" title="Alerts">Alerts</a>
|
||||
<a class="link dim white dib mr3" href="#/silences" title="Silences">Silences</a>
|
||||
<a class="link dim white dib" href="#/status" title="Status">Status</a>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- Container -->
|
||||
<div class="pt6 w-80 center pa3">
|
||||
<div id="app">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
<!-- Your source after making -->
|
||||
@ -30,8 +15,7 @@
|
||||
|
||||
<!-- Removes splash and starts elm app. -->
|
||||
<script type="text/javascript">
|
||||
var node = document.getElementById('app');
|
||||
var app = Elm.Main.embed(node);
|
||||
var app = Elm.Main.embed(document.body);
|
||||
</script>
|
||||
|
||||
</html>
|
||||
|
20
src/NavBar/Views.elm
Normal file
20
src/NavBar/Views.elm
Normal file
@ -0,0 +1,20 @@
|
||||
module NavBar.Views exposing (appHeader)
|
||||
|
||||
import Html exposing (Html, header, text, a, nav)
|
||||
import Html.Attributes exposing (class, href, title)
|
||||
import Types exposing (Model, Msg)
|
||||
|
||||
appHeader : Model -> Html Msg
|
||||
appHeader model =
|
||||
header [ class "bg-black-90 fixed w-100 ph3 pv3 pv4-ns ph4-m ph5-l" ]
|
||||
[ nav [ class "w-80 center f6 fw6 ttu tracked" ]
|
||||
[ a [ class "link dim white dib mr3", href "#", title "Home" ]
|
||||
[ text "AlertManager" ]
|
||||
, a [ class "link dim white dib mr3", href "#/alerts", title "Alerts" ]
|
||||
[ text "Alerts" ]
|
||||
, a [ class "link dim white dib mr3", href "#/silences", title "Silences" ]
|
||||
[ text "Silences" ]
|
||||
, a [ class "link dim white dib", href "#/status", title "Status" ]
|
||||
[ text "Status" ]
|
||||
]
|
||||
]
|
@ -7,10 +7,19 @@ import Utils.Views exposing (error, loading, notFoundView)
|
||||
import Translators exposing (alertTranslator, silenceTranslator)
|
||||
import Silences.Views
|
||||
import Alerts.Views
|
||||
import NavBar.Views exposing (appHeader)
|
||||
|
||||
|
||||
view : Model -> Html Msg
|
||||
view model =
|
||||
div []
|
||||
[ appHeader model
|
||||
, div [ class "pt6 w-80 center pa3" ]
|
||||
[ appBody model ]
|
||||
]
|
||||
|
||||
appBody : Model -> Html Msg
|
||||
appBody model =
|
||||
case model.route of
|
||||
AlertsRoute route ->
|
||||
case model.alertGroups of
|
||||
|
Loading…
Reference in New Issue
Block a user