summaryrefslogtreecommitdiff
path: root/Omni
diff options
context:
space:
mode:
Diffstat (limited to 'Omni')
-rw-r--r--Omni/Agent/Core.hs1
-rw-r--r--Omni/Agent/Log.hs15
-rw-r--r--Omni/Agent/Worker.hs1
3 files changed, 7 insertions, 10 deletions
diff --git a/Omni/Agent/Core.hs b/Omni/Agent/Core.hs
index 2d09e39..a2594d6 100644
--- a/Omni/Agent/Core.hs
+++ b/Omni/Agent/Core.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE NoImplicitPrelude #-}
--- : out omni-agent-core
module Omni.Agent.Core where
import Alpha
diff --git a/Omni/Agent/Log.hs b/Omni/Agent/Log.hs
index 07770d0..c78dc4b 100644
--- a/Omni/Agent/Log.hs
+++ b/Omni/Agent/Log.hs
@@ -2,10 +2,11 @@
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE NoImplicitPrelude #-}
--- : out omni-agent-log
+-- | Status of the agent for the UI
module Omni.Agent.Log where
import Alpha
+import Control.Applicative ((<$>), (<*>))
import Data.Aeson ((.:), (.:?))
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Lazy as BL
@@ -133,17 +134,15 @@ data LogEntry = LogEntry
instance Aeson.FromJSON LogEntry where
parseJSON =
Aeson.withObject "LogEntry" <| \v ->
- LogEntry
- </ v
- .: "message"
+ (LogEntry </ (v .: "message"))
<*> v
- .:? "threadId"
+ .:? "threadId"
<*> v
- .:? "credits"
+ .:? "credits"
<*> v
- .:? "totalCredits"
+ .:? "totalCredits"
<*> v
- .:? "timestamp"
+ .:? "timestamp"
-- | Parse a log line and update status
processLogLine :: Text -> IO ()
diff --git a/Omni/Agent/Worker.hs b/Omni/Agent/Worker.hs
index 9f9e3bb..a29feb4 100644
--- a/Omni/Agent/Worker.hs
+++ b/Omni/Agent/Worker.hs
@@ -1,7 +1,6 @@
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE NoImplicitPrelude #-}
--- : out omni-agent-worker
module Omni.Agent.Worker where
import Alpha