1
0
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:
James Hillyerd
2018-12-23 13:55:43 -08:00
parent 1a8b5184cd
commit 6189b56b79
7 changed files with 1493 additions and 1465 deletions

View File

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

View File

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

View File

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

View File

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