mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
ui: Add fontawesome-free, use in status & mailbox
This commit is contained in:
@@ -9,7 +9,8 @@ import DateFormat.Relative as Relative
|
||||
import Html exposing (..)
|
||||
import Html.Attributes
|
||||
exposing
|
||||
( class
|
||||
( alt
|
||||
, class
|
||||
, classList
|
||||
, download
|
||||
, href
|
||||
@@ -458,7 +459,11 @@ view session model =
|
||||
, value model.searchInput
|
||||
]
|
||||
[]
|
||||
, button [ onClick PurgeMailboxPrompt ] [ text "Purge" ]
|
||||
, button
|
||||
[ onClick PurgeMailboxPrompt
|
||||
, alt "Purge Mailbox"
|
||||
]
|
||||
[ i [ class "fas fa-trash" ] [] ]
|
||||
]
|
||||
, viewMessageList session model
|
||||
, main_
|
||||
|
||||
@@ -261,6 +261,7 @@ configPanel maybeConfig =
|
||||
|
||||
Just config ->
|
||||
framePanel "Configuration"
|
||||
"fa-cog"
|
||||
[ textEntry "Version" (config.version ++ ", built on " ++ config.buildDate)
|
||||
, textEntry "SMTP Listener" config.smtpConfig.addr
|
||||
, textEntry "POP3 Listener" config.pop3Listener
|
||||
@@ -337,6 +338,7 @@ metricPanels model =
|
||||
|
||||
Just metrics ->
|
||||
[ framePanel "General Metrics"
|
||||
"fa-tachometer-alt"
|
||||
[ textEntry "Uptime" <|
|
||||
"Started "
|
||||
++ Relative.relativeTime model.now metrics.startTime
|
||||
@@ -348,6 +350,7 @@ metricPanels model =
|
||||
, viewMetric model.webSockets
|
||||
]
|
||||
, framePanel "SMTP Metrics"
|
||||
"fa-envelope"
|
||||
[ viewMetric model.smtpConnOpen
|
||||
, viewMetric model.smtpConnTotal
|
||||
, viewMetric model.smtpReceivedTotal
|
||||
@@ -355,6 +358,7 @@ metricPanels model =
|
||||
, viewMetric model.smtpWarnsTotal
|
||||
]
|
||||
, framePanel "Storage Metrics"
|
||||
"fa-archive"
|
||||
[ textEntry "Retention Scan" (retentionScan model)
|
||||
, viewMetric model.retentionDeletesTotal
|
||||
, viewMetric model.retainedCount
|
||||
@@ -495,10 +499,18 @@ graphZero data =
|
||||
]
|
||||
|
||||
|
||||
framePanel : String -> List (Html a) -> Html a
|
||||
framePanel name html =
|
||||
framePanel : String -> String -> List (Html a) -> Html a
|
||||
framePanel name icon html =
|
||||
let
|
||||
fontIcon cn =
|
||||
i [ class ("fas " ++ cn) ] []
|
||||
in
|
||||
div [ class "metric-panel" ]
|
||||
[ h2 [] [ text name ]
|
||||
[ h2 []
|
||||
[ fontIcon icon
|
||||
, text " "
|
||||
, text name
|
||||
]
|
||||
, div [ class "metrics" ] html
|
||||
]
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import './main.css'
|
||||
import '@fortawesome/fontawesome-free/css/all.css'
|
||||
import { Elm } from './Main.elm'
|
||||
import registerMonitorPorts from './registerMonitor'
|
||||
import './renderedHtml'
|
||||
|
||||
@@ -332,9 +332,15 @@ li.navbar-active span,
|
||||
}
|
||||
|
||||
.message-list-controls {
|
||||
display: flex;
|
||||
grid-area: ctrl;
|
||||
}
|
||||
|
||||
.message-list-controls input[type="search"] {
|
||||
flex: 1 1 auto;
|
||||
padding: 2px 4px;
|
||||
}
|
||||
|
||||
.message-list {
|
||||
grid-area: list;
|
||||
overflow-y: scroll;
|
||||
|
||||
Reference in New Issue
Block a user