Copyright | (c) Soostone Inc 2020 |
---|---|
License | AllRightsReserved |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | GHC2024 |
Synopsis
- type Success = Bool
- data UIName
- data PreviousStates = PreviousStates {}
- prevStatesFinishedTime :: PreviousStates -> Maybe NominalDiffTime
- data StateInfo (bk :: k) = StateInfo {
- state :: TaskState bk
- specName :: Text
- dbName :: Text
- taskType :: TaskType
- previousStates :: PreviousStates
- type States (bk :: k) = Map TaskId (StateInfo bk)
- data DrawState (bk :: k) = DrawState {
- startTime :: UTCTime
- showPostProcessedTableRef :: Bool
- taskStates :: States bk
- elapsedTime :: NominalDiffTime
- processingTime :: NominalDiffTime
- runDone :: Bool
- wantsToQuit :: Bool
- quit :: Bool
- paused :: Bool
- estimatedTotal :: Estimate
- totalStats :: QueryStats bk
- showError :: Bool
- specListView :: SpecListView bk
- now :: UTCTime
- effToHandler :: TMVar UIExecutionControl -> Eff '[Execution, Concurrent, IOE] a -> EventM UIName b a
- pause :: TMVar UIExecutionControl -> EventM UIName b ()
- isPaused :: TMVar UIExecutionControl -> EventM UIName b Bool
- quit :: TMVar UIExecutionControl -> EventM UIName b ()
- isQuitting :: TMVar UIExecutionControl -> EventM UIName b Bool
- type SpecListView (bk :: k) = List UIName (StateLine bk)
- data UpdateEvent (b :: k)
- eventHandler :: forall {k} (b :: k). HasBackendQueryStats b => TMVar UIExecutionControl -> BrickEvent UIName (UpdateEvent b) -> EventM UIName (DrawState b) ()
- eventQueueSize :: Natural
- cliReporter :: forall {k} (b :: k) bk. HasBackendQueryStats b => (SpecTableName -> Ref Table) -> TasksDAG Full bk -> TMVar UIExecutionControl -> RuntimeEventQueueDAG b -> IO Success
- success :: forall {k} (b :: k). DrawState b -> Success
- prettyElapsedTime :: NominalDiffTime -> Text
- printFinalReport :: forall {k} (b :: k). HasBackendQueryStats b => DrawState b -> IO ()
- filterByState :: forall {k} (bk :: k). (TaskState bk -> Bool) -> States bk -> States bk
- infoState :: forall {k} (bk :: k). HasBackendQueryStats bk => States bk -> Bool -> TaskState bk -> Maybe Text
- drawScreen :: forall {k} (bk :: k). HasBackendQueryStats bk => DrawState bk -> [Widget UIName]
- prettyUTCTime :: UTCTime -> Text
- data StateLine (bk :: k) = StateLine {
- specName :: Text
- dbName :: Text
- _type :: Text
- state :: TaskState bk
- previousStates :: PreviousStates
- sortedStatesList :: forall {k} (bk :: k). States bk -> [StateLine bk]
- renderOneState :: forall {k} (bk :: k). HasBackendQueryStats bk => NominalDiffTime -> Bool -> States bk -> Bool -> StateLine bk -> Widget UIName
- cliAttrMap :: AttrMap
- tableRowSelected :: AttrName
- successStateLine :: AttrName
- skippedStateLine :: AttrName
- failureStateLine :: AttrName
- processingStateLine :: AttrName
- pendingStateLine :: AttrName
- dependencyFailedLine :: AttrName
- blockedStateLine :: AttrName
- introBox :: AttrName
- errorBox :: AttrName
- tableStatus :: AttrName
- tableStatusError :: AttrName
- napkinText :: [Text]
Documentation
Unique names for user interface elements necessary for brick.
data PreviousStates #
Instances
StateInfo | |
|
Instances
Generic (StateInfo bk) # | |||||
Defined in Napkin.Spec.CliReporterDAG
| |||||
type Rep (StateInfo bk) # | |||||
Defined in Napkin.Spec.CliReporterDAG type Rep (StateInfo bk) = D1 ('MetaData "StateInfo" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "StateInfo" 'PrefixI 'True) ((S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TaskState bk)) :*: S1 ('MetaSel ('Just "specName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "dbName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "taskType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 TaskType) :*: S1 ('MetaSel ('Just "previousStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PreviousStates))))) |
DrawState | |
|
Instances
Generic (DrawState bk) # | |||||
Defined in Napkin.Spec.CliReporterDAG
| |||||
type Rep (DrawState bk) # | |||||
Defined in Napkin.Spec.CliReporterDAG type Rep (DrawState bk) = D1 ('MetaData "DrawState" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "DrawState" 'PrefixI 'True) (((S1 ('MetaSel ('Just "startTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime) :*: (S1 ('MetaSel ('Just "showPostProcessedTableRef") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "taskStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (States bk)))) :*: ((S1 ('MetaSel ('Just "elapsedTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime) :*: S1 ('MetaSel ('Just "processingTime") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 NominalDiffTime)) :*: (S1 ('MetaSel ('Just "runDone") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "wantsToQuit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)))) :*: ((S1 ('MetaSel ('Just "quit") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: (S1 ('MetaSel ('Just "paused") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "estimatedTotal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Estimate))) :*: ((S1 ('MetaSel ('Just "totalStats") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (QueryStats bk)) :*: S1 ('MetaSel ('Just "showError") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool)) :*: (S1 ('MetaSel ('Just "specListView") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (SpecListView bk)) :*: S1 ('MetaSel ('Just "now") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UTCTime)))))) |
effToHandler :: TMVar UIExecutionControl -> Eff '[Execution, Concurrent, IOE] a -> EventM UIName b a #
isQuitting :: TMVar UIExecutionControl -> EventM UIName b Bool #
type SpecListView (bk :: k) = List UIName (StateLine bk) #
data UpdateEvent (b :: k) #
eventHandler :: forall {k} (b :: k). HasBackendQueryStats b => TMVar UIExecutionControl -> BrickEvent UIName (UpdateEvent b) -> EventM UIName (DrawState b) () #
cliReporter :: forall {k} (b :: k) bk. HasBackendQueryStats b => (SpecTableName -> Ref Table) -> TasksDAG Full bk -> TMVar UIExecutionControl -> RuntimeEventQueueDAG b -> IO Success #
Pump the runtime event queue to display Spec execution progress in the terminal. Returns after all Specs are completed.
printFinalReport :: forall {k} (b :: k). HasBackendQueryStats b => DrawState b -> IO () #
infoState :: forall {k} (bk :: k). HasBackendQueryStats bk => States bk -> Bool -> TaskState bk -> Maybe Text #
drawScreen :: forall {k} (bk :: k). HasBackendQueryStats bk => DrawState bk -> [Widget UIName] #
prettyUTCTime :: UTCTime -> Text #
StateLine | |
|
Instances
Generic (StateLine bk) # | |||||
Defined in Napkin.Spec.CliReporterDAG
| |||||
type Rep (StateLine bk) # | |||||
Defined in Napkin.Spec.CliReporterDAG type Rep (StateLine bk) = D1 ('MetaData "StateLine" "Napkin.Spec.CliReporterDAG" "napkin-cli-2.0.0-4ha97GXrcwU2qMy5j7dc75" 'False) (C1 ('MetaCons "StateLine" 'PrefixI 'True) ((S1 ('MetaSel ('Just "specName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "dbName") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :*: (S1 ('MetaSel ('Just "_type") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: (S1 ('MetaSel ('Just "state") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (TaskState bk)) :*: S1 ('MetaSel ('Just "previousStates") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 PreviousStates))))) |
sortedStatesList :: forall {k} (bk :: k). States bk -> [StateLine bk] #
renderOneState :: forall {k} (bk :: k). HasBackendQueryStats bk => NominalDiffTime -> Bool -> States bk -> Bool -> StateLine bk -> Widget UIName #
cliAttrMap :: AttrMap #
tableStatus :: AttrName #
napkinText :: [Text] #