minor additions
This commit is contained in:
parent
538c88728f
commit
566109306b
|
@ -20,6 +20,7 @@ library
|
||||||
, Torrent
|
, Torrent
|
||||||
other-modules:
|
other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
|
ghc-options: -Wall
|
||||||
build-depends: base ^>=4.14.1.0
|
build-depends: base ^>=4.14.1.0
|
||||||
, wreq
|
, wreq
|
||||||
, aeson
|
, aeson
|
||||||
|
@ -36,6 +37,7 @@ executable kino
|
||||||
main-is: Main.hs
|
main-is: Main.hs
|
||||||
-- other-modules:
|
-- other-modules:
|
||||||
-- other-extensions:
|
-- other-extensions:
|
||||||
|
ghc-options: -Wall
|
||||||
build-depends: base ^>=4.14.1.0
|
build-depends: base ^>=4.14.1.0
|
||||||
, kino
|
, kino
|
||||||
, brick
|
, brick
|
||||||
|
|
|
@ -5,8 +5,6 @@ module JSONTypes where
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Aeson.Types
|
import Data.Aeson.Types
|
||||||
import qualified Data.Text as T
|
import qualified Data.Text as T
|
||||||
import Data.Aeson.Lens (key, nth)
|
|
||||||
import qualified Data.ByteString.Lazy.Internal as BL
|
|
||||||
|
|
||||||
data JSONResponse d = JSONResponse
|
data JSONResponse d = JSONResponse
|
||||||
{ resp_status :: T.Text
|
{ resp_status :: T.Text
|
||||||
|
|
|
@ -9,8 +9,6 @@ import qualified Network.Wreq as WR (Options)
|
||||||
import Control.Lens
|
import Control.Lens
|
||||||
import Data.Aeson
|
import Data.Aeson
|
||||||
import Data.Text as T
|
import Data.Text as T
|
||||||
import Data.Aeson.Lens (key, nth)
|
|
||||||
import qualified Data.ByteString.Lazy as BL
|
|
||||||
|
|
||||||
makeRequest :: (FromJSON a) => String -> WR.Options -> IO (Either T.Text a)
|
makeRequest :: (FromJSON a) => String -> WR.Options -> IO (Either T.Text a)
|
||||||
makeRequest url opts = do
|
makeRequest url opts = do
|
||||||
|
|
22
src/UI.hs
22
src/UI.hs
|
@ -3,22 +3,36 @@ module UI where
|
||||||
import Brick
|
import Brick
|
||||||
import Brick.Main
|
import Brick.Main
|
||||||
|
|
||||||
data Identifiers = Nil
|
data Ident = Nil
|
||||||
|
|
||||||
data AppState = Null
|
data AppS = Null
|
||||||
|
|
||||||
app :: App AppState () Identifiers
|
app :: App AppS () Ident
|
||||||
app = App
|
app = App
|
||||||
{ appDraw = draw
|
{ appDraw = draw
|
||||||
, appChooseCursor = chooseCursor
|
, appChooseCursor = chooseCursor
|
||||||
, appHandleEvent = eventHandler
|
, appHandleEvent = eventHandler
|
||||||
|
, appStartEvent = startEvent
|
||||||
|
, appAttrMap = attributeMap
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runApp :: IO AppS
|
||||||
|
runApp = defaultMain app initialState
|
||||||
|
|
||||||
|
initialState :: AppS
|
||||||
|
initialState = undefined
|
||||||
|
|
||||||
|
startEvent :: EventM Ident (Next Apps)
|
||||||
|
startEvent = return -- replace if needed
|
||||||
|
|
||||||
|
draw :: AppS -> [Widget Ident]
|
||||||
draw = undefined
|
draw = undefined
|
||||||
|
|
||||||
chooseCursor = undefined
|
chooseCursor :: AppS -> [CursorLocation Ident] -> Maybe (CursorLocation Ident)
|
||||||
|
chooseCursor = showFirstCursor -- replace if needed
|
||||||
|
|
||||||
|
eventHandler :: AppS -> BrickEvent Identifier () -> EventM Ident (Next AppS)
|
||||||
eventHandler = undefined
|
eventHandler = undefined
|
||||||
|
|
||||||
|
attributeMap :: AttrMap
|
||||||
attributeMap = undefined
|
attributeMap = undefined
|
||||||
|
|
Loading…
Reference in New Issue
Block a user