mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
ui: Move div.page into Page frame
This commit is contained in:
@@ -81,12 +81,12 @@ errorFlash error =
|
|||||||
}
|
}
|
||||||
|
|
||||||
Http.NetworkError ->
|
Http.NetworkError ->
|
||||||
{ title = "HTTP Network error"
|
{ title = "HTTP network error"
|
||||||
, table = []
|
, table = []
|
||||||
}
|
}
|
||||||
|
|
||||||
Http.BadStatus res ->
|
Http.BadStatus res ->
|
||||||
{ title = "Bad HTTP status"
|
{ title = "HTTP response error"
|
||||||
, table = [ ( "Response Code", String.fromInt res ) ]
|
, table = [ ( "Response Code", String.fromInt res ) ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ view model =
|
|||||||
framePage :
|
framePage :
|
||||||
ActivePage
|
ActivePage
|
||||||
-> (msg -> Msg)
|
-> (msg -> Msg)
|
||||||
-> { title : String, modal : Maybe (Html msg), content : Html msg }
|
-> { title : String, modal : Maybe (Html msg), content : List (Html msg) }
|
||||||
-> Document Msg
|
-> Document Msg
|
||||||
framePage page toMsg { title, modal, content } =
|
framePage page toMsg { title, modal, content } =
|
||||||
Document title
|
Document title
|
||||||
@@ -315,7 +315,7 @@ view model =
|
|||||||
model.session
|
model.session
|
||||||
page
|
page
|
||||||
(Maybe.map (Html.map toMsg) modal)
|
(Maybe.map (Html.map toMsg) modal)
|
||||||
(Html.map toMsg content)
|
(List.map (Html.map toMsg) content)
|
||||||
]
|
]
|
||||||
in
|
in
|
||||||
case model.page of
|
case model.page of
|
||||||
|
|||||||
@@ -45,16 +45,15 @@ update session msg model =
|
|||||||
-- VIEW --
|
-- VIEW --
|
||||||
|
|
||||||
|
|
||||||
view : Session -> Model -> { title : String, modal : Maybe (Html msg), content : Html Msg }
|
view : Session -> Model -> { title : String, modal : Maybe (Html msg), content : List (Html Msg) }
|
||||||
view session model =
|
view session model =
|
||||||
{ title = "Inbucket"
|
{ title = "Inbucket"
|
||||||
, modal = Nothing
|
, modal = Nothing
|
||||||
, content =
|
, content =
|
||||||
div [ class "page" ]
|
[ Html.node "rendered-html"
|
||||||
[ Html.node "rendered-html"
|
[ class "greeting"
|
||||||
[ class "greeting"
|
, property "content" (Encode.string model.greeting)
|
||||||
, property "content" (Encode.string model.greeting)
|
|
||||||
]
|
|
||||||
[]
|
|
||||||
]
|
]
|
||||||
|
[]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -444,12 +444,12 @@ updateOpenMessage session model id =
|
|||||||
-- VIEW
|
-- VIEW
|
||||||
|
|
||||||
|
|
||||||
view : Session -> Model -> { title : String, modal : Maybe (Html Msg), content : Html Msg }
|
view : Session -> Model -> { title : String, modal : Maybe (Html Msg), content : List (Html Msg) }
|
||||||
view session model =
|
view session model =
|
||||||
{ title = model.mailboxName ++ " - Inbucket"
|
{ title = model.mailboxName ++ " - Inbucket"
|
||||||
, modal = viewModal model.promptPurge
|
, modal = viewModal model.promptPurge
|
||||||
, content =
|
, content =
|
||||||
div [ class "page mailbox" ]
|
[ div [ class "mailbox" ]
|
||||||
[ aside [ class "message-list-controls" ]
|
[ aside [ class "message-list-controls" ]
|
||||||
[ input
|
[ input
|
||||||
[ type_ "search"
|
[ type_ "search"
|
||||||
@@ -480,6 +480,7 @@ view session model =
|
|||||||
text ""
|
text ""
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -88,35 +88,34 @@ update session msg model =
|
|||||||
-- VIEW
|
-- VIEW
|
||||||
|
|
||||||
|
|
||||||
view : Session -> Model -> { title : String, modal : Maybe (Html msg), content : Html Msg }
|
view : Session -> Model -> { title : String, modal : Maybe (Html msg), content : List (Html Msg) }
|
||||||
view session model =
|
view session model =
|
||||||
{ title = "Inbucket Monitor"
|
{ title = "Inbucket Monitor"
|
||||||
, modal = Nothing
|
, modal = Nothing
|
||||||
, content =
|
, content =
|
||||||
div [ class "page" ]
|
[ h1 [] [ text "Monitor" ]
|
||||||
[ h1 [] [ text "Monitor" ]
|
, p []
|
||||||
, p []
|
[ text "Messages will be listed here shortly after delivery. "
|
||||||
[ text "Messages will be listed here shortly after delivery. "
|
, em []
|
||||||
, em []
|
[ text
|
||||||
[ text
|
(if model.connected then
|
||||||
(if model.connected then
|
"Connected."
|
||||||
"Connected."
|
|
||||||
|
|
||||||
else
|
else
|
||||||
"Disconnected!"
|
"Disconnected!"
|
||||||
)
|
)
|
||||||
]
|
|
||||||
]
|
|
||||||
, table [ class "monitor" ]
|
|
||||||
[ thead []
|
|
||||||
[ th [] [ text "Date" ]
|
|
||||||
, th [ class "desktop" ] [ text "From" ]
|
|
||||||
, th [] [ text "Mailbox" ]
|
|
||||||
, th [] [ text "Subject" ]
|
|
||||||
]
|
|
||||||
, tbody [] (List.map (viewMessage session.zone) model.messages)
|
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
|
, table [ class "monitor" ]
|
||||||
|
[ thead []
|
||||||
|
[ th [] [ text "Date" ]
|
||||||
|
, th [ class "desktop" ] [ text "From" ]
|
||||||
|
, th [] [ text "Mailbox" ]
|
||||||
|
, th [] [ text "Subject" ]
|
||||||
|
]
|
||||||
|
, tbody [] (List.map (viewMessage session.zone) model.messages)
|
||||||
|
]
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -225,15 +225,14 @@ updateRemoteTotal metric value history =
|
|||||||
-- VIEW --
|
-- VIEW --
|
||||||
|
|
||||||
|
|
||||||
view : Session -> Model -> { title : String, modal : Maybe (Html msg), content : Html Msg }
|
view : Session -> Model -> { title : String, modal : Maybe (Html msg), content : List (Html Msg) }
|
||||||
view session model =
|
view session model =
|
||||||
{ title = "Inbucket Status"
|
{ title = "Inbucket Status"
|
||||||
, modal = Nothing
|
, modal = Nothing
|
||||||
, content =
|
, content =
|
||||||
div [ class "page" ]
|
[ h1 [] [ text "Status" ]
|
||||||
[ h1 [] [ text "Status" ]
|
, div [] (configPanel model.config :: metricPanels model)
|
||||||
, div [] (configPanel model.config :: metricPanels model)
|
]
|
||||||
]
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ type alias FrameControls msg =
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
frame : FrameControls msg -> Session -> ActivePage -> Maybe (Html msg) -> Html msg -> Html msg
|
frame : FrameControls msg -> Session -> ActivePage -> Maybe (Html msg) -> List (Html msg) -> Html msg
|
||||||
frame controls session page modal content =
|
frame controls session page modal content =
|
||||||
div [ class "app" ]
|
div [ class "app" ]
|
||||||
[ header []
|
[ header []
|
||||||
@@ -59,11 +59,10 @@ frame controls session page modal content =
|
|||||||
]
|
]
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
, errorFlash controls session.flash
|
|
||||||
]
|
]
|
||||||
, div [ class "navbar-bg" ] [ text "" ]
|
, div [ class "navbar-bg" ] [ text "" ]
|
||||||
, frameModal modal
|
, frameModal modal
|
||||||
, content
|
, div [ class "page" ] ([ errorFlash controls session.flash ] ++ content)
|
||||||
, footer []
|
, footer []
|
||||||
[ div [ class "footer" ]
|
[ div [ class "footer" ]
|
||||||
[ externalLink "https://www.inbucket.org" "Inbucket"
|
[ externalLink "https://www.inbucket.org" "Inbucket"
|
||||||
|
|||||||
@@ -115,7 +115,9 @@ header {
|
|||||||
|
|
||||||
.page {
|
.page {
|
||||||
grid-area: page;
|
grid-area: page;
|
||||||
min-height: 0; /* Allows scrolling in nested flex/grids. */
|
/* Explicit minimums required for sizing/scrolling in nested flex+grids. */
|
||||||
|
min-height: 0;
|
||||||
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
footer {
|
footer {
|
||||||
@@ -159,7 +161,6 @@ h1 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.flash-table {
|
.flash-table {
|
||||||
max-width: 90vw;
|
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -310,7 +311,6 @@ li.navbar-active span,
|
|||||||
|
|
||||||
.mailbox {
|
.mailbox {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-area: page;
|
|
||||||
grid-gap: 1px 20px;
|
grid-gap: 1px 20px;
|
||||||
grid:
|
grid:
|
||||||
"ctrl mesg" auto
|
"ctrl mesg" auto
|
||||||
|
|||||||
Reference in New Issue
Block a user