mirror of
https://github.com/jhillyerd/inbucket.git
synced 2025-12-17 17:47:03 +00:00
ui: Reformat with new elm-format
This commit is contained in:
@@ -1,10 +1,10 @@
|
|||||||
module Data.Session
|
module Data.Session
|
||||||
exposing
|
exposing
|
||||||
( Session
|
( Msg(..)
|
||||||
, Persistent
|
, Persistent
|
||||||
, Msg(..)
|
, Session
|
||||||
, decoder
|
|
||||||
, decodeValueWithDefault
|
, decodeValueWithDefault
|
||||||
|
, decoder
|
||||||
, init
|
, init
|
||||||
, none
|
, none
|
||||||
, update
|
, update
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module Main exposing (..)
|
module Main exposing (..)
|
||||||
|
|
||||||
import Data.Session as Session exposing (Session, decoder)
|
import Data.Session as Session exposing (Session, decoder)
|
||||||
import Json.Decode as Decode exposing (Value)
|
|
||||||
import Html exposing (..)
|
import Html exposing (..)
|
||||||
|
import Json.Decode as Decode exposing (Value)
|
||||||
import Navigation exposing (Location)
|
import Navigation exposing (Location)
|
||||||
import Page.Home as Home
|
import Page.Home as Home
|
||||||
import Page.Mailbox as Mailbox
|
import Page.Mailbox as Mailbox
|
||||||
@@ -217,7 +217,7 @@ setRoute route model =
|
|||||||
( { model | page = Status Status.init }
|
( { model | page = Status Status.init }
|
||||||
, Cmd.batch
|
, Cmd.batch
|
||||||
[ Ports.windowTitle "Inbucket Status"
|
[ Ports.windowTitle "Inbucket Status"
|
||||||
, Cmd.map StatusMsg (Status.load)
|
, Cmd.map StatusMsg Status.load
|
||||||
]
|
]
|
||||||
, Session.none
|
, Session.none
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
module Page.Home exposing (Model, Msg, init, update, view)
|
module Page.Home exposing (Model, Msg, init, update, view)
|
||||||
|
|
||||||
|
import Data.Session as Session exposing (Session)
|
||||||
import Html exposing (..)
|
import Html exposing (..)
|
||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
import Data.Session as Session exposing (Session)
|
|
||||||
|
|
||||||
|
|
||||||
-- MODEL --
|
-- MODEL --
|
||||||
|
|||||||
@@ -4,9 +4,8 @@ import Data.Message as Message exposing (Message)
|
|||||||
import Data.MessageHeader as MessageHeader exposing (MessageHeader)
|
import Data.MessageHeader as MessageHeader exposing (MessageHeader)
|
||||||
import Data.Session as Session exposing (Session)
|
import Data.Session as Session exposing (Session)
|
||||||
import Date exposing (Date)
|
import Date exposing (Date)
|
||||||
import DateFormat.Relative as Relative
|
|
||||||
import DateFormat
|
import DateFormat
|
||||||
import Json.Decode as Decode exposing (Decoder)
|
import DateFormat.Relative as Relative
|
||||||
import Html exposing (..)
|
import Html exposing (..)
|
||||||
import Html.Attributes
|
import Html.Attributes
|
||||||
exposing
|
exposing
|
||||||
@@ -24,6 +23,7 @@ import Html.Attributes
|
|||||||
import Html.Events exposing (..)
|
import Html.Events exposing (..)
|
||||||
import Http exposing (Error)
|
import Http exposing (Error)
|
||||||
import HttpUtil
|
import HttpUtil
|
||||||
|
import Json.Decode as Decode exposing (Decoder)
|
||||||
import Json.Encode as Encode
|
import Json.Encode as Encode
|
||||||
import Ports
|
import Ports
|
||||||
import Route
|
import Route
|
||||||
|
|||||||
@@ -5,17 +5,17 @@ import Data.Session as Session exposing (Session)
|
|||||||
import Date exposing (Date)
|
import Date exposing (Date)
|
||||||
import DateFormat
|
import DateFormat
|
||||||
exposing
|
exposing
|
||||||
( format
|
( amPmUppercase
|
||||||
, monthNameFirstThree
|
|
||||||
, dayOfMonthFixed
|
, dayOfMonthFixed
|
||||||
|
, format
|
||||||
, hourNumber
|
, hourNumber
|
||||||
, minuteFixed
|
, minuteFixed
|
||||||
, amPmUppercase
|
, monthNameFirstThree
|
||||||
)
|
)
|
||||||
import Json.Decode exposing (decodeString)
|
|
||||||
import Html exposing (..)
|
import Html exposing (..)
|
||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
import Html.Events as Events
|
import Html.Events as Events
|
||||||
|
import Json.Decode exposing (decodeString)
|
||||||
import Route
|
import Route
|
||||||
import WebSocket
|
import WebSocket
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import Html exposing (..)
|
|||||||
import Html.Attributes exposing (..)
|
import Html.Attributes exposing (..)
|
||||||
import Http exposing (Error)
|
import Http exposing (Error)
|
||||||
import HttpUtil
|
import HttpUtil
|
||||||
import Sparkline exposing (sparkline, Point, DataSet, Size)
|
import Sparkline exposing (DataSet, Point, Size, sparkline)
|
||||||
import Svg.Attributes as SvgAttrib
|
import Svg.Attributes as SvgAttrib
|
||||||
import Time exposing (Time)
|
import Time exposing (Time)
|
||||||
|
|
||||||
@@ -69,7 +69,7 @@ init =
|
|||||||
initDataSet : DataSet
|
initDataSet : DataSet
|
||||||
initDataSet =
|
initDataSet =
|
||||||
List.range 0 59
|
List.range 0 59
|
||||||
|> List.map (\x -> ( toFloat (x), 0 ))
|
|> List.map (\x -> ( toFloat x, 0 ))
|
||||||
|
|
||||||
|
|
||||||
load : Cmd Msg
|
load : Cmd Msg
|
||||||
@@ -171,8 +171,8 @@ updateLocalMetric metric x value =
|
|||||||
{ metric
|
{ metric
|
||||||
| value = value
|
| value = value
|
||||||
, history =
|
, history =
|
||||||
(Maybe.withDefault [] (List.tail metric.history))
|
Maybe.withDefault [] (List.tail metric.history)
|
||||||
++ [ ( x, (toFloat value) ) ]
|
++ [ ( x, toFloat value ) ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -380,7 +380,7 @@ zeroPadList numbers =
|
|||||||
60 - List.length numbers
|
60 - List.length numbers
|
||||||
in
|
in
|
||||||
if needed > 0 then
|
if needed > 0 then
|
||||||
(List.repeat needed 0) ++ numbers
|
List.repeat needed 0 ++ numbers
|
||||||
else
|
else
|
||||||
numbers
|
numbers
|
||||||
|
|
||||||
@@ -395,6 +395,6 @@ fmtInt n =
|
|||||||
if String.length str <= 3 then
|
if String.length str <= 3 then
|
||||||
str
|
str
|
||||||
else
|
else
|
||||||
(thousands (String.slice 0 -3 str)) ++ "," ++ (String.right 3 str)
|
thousands (String.slice 0 -3 str) ++ "," ++ String.right 3 str
|
||||||
in
|
in
|
||||||
thousands (toString n)
|
thousands (toString n)
|
||||||
|
|||||||
@@ -10,8 +10,8 @@ import Html.Attributes
|
|||||||
, href
|
, href
|
||||||
, id
|
, id
|
||||||
, placeholder
|
, placeholder
|
||||||
, type_
|
|
||||||
, selected
|
, selected
|
||||||
|
, type_
|
||||||
, value
|
, value
|
||||||
)
|
)
|
||||||
import Html.Events as Events
|
import Html.Events as Events
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
module Tests exposing (..)
|
module Tests exposing (..)
|
||||||
|
|
||||||
import Test exposing (..)
|
|
||||||
import Expect
|
import Expect
|
||||||
|
import Test exposing (..)
|
||||||
|
|
||||||
|
|
||||||
-- Check out http://package.elm-lang.org/packages/elm-community/elm-test/latest to learn more about testing in Elm!
|
-- Check out http://package.elm-lang.org/packages/elm-community/elm-test/latest to learn more about testing in Elm!
|
||||||
|
|||||||
Reference in New Issue
Block a user