Merge branch 'fradrive/jost' into 'master'
minor update Closes #154 and #5 See merge request fradrive/fradrive!38
This commit is contained in:
commit
97446aa9ef
@ -301,7 +301,7 @@ export class ExamCorrect {
|
|||||||
users: [user],
|
users: [user],
|
||||||
status: STATUS.LOADING,
|
status: STATUS.LOADING,
|
||||||
};
|
};
|
||||||
if (results && results !== {}) rowInfo.results = results;
|
if (results && Object.keys(results).length > 0) rowInfo.results = results;
|
||||||
if (result !== undefined) rowInfo.result = result;
|
if (result !== undefined) rowInfo.result = result;
|
||||||
this._addRow(rowInfo);
|
this._addRow(rowInfo);
|
||||||
|
|
||||||
|
|||||||
@ -150,3 +150,9 @@ InterfaceWrite: Schreibend
|
|||||||
InterfaceSuccess: Rückmeldung
|
InterfaceSuccess: Rückmeldung
|
||||||
InterfaceInfo: Nachricht
|
InterfaceInfo: Nachricht
|
||||||
InterfaceFreshness: Prüfungszeitraum (h)
|
InterfaceFreshness: Prüfungszeitraum (h)
|
||||||
|
ConfigInterfacesHeading: Konfiguration Warnung Schnittstellen
|
||||||
|
|
||||||
|
IWTActAdd: Hinzufügen
|
||||||
|
IWTActDelete: Entfernen
|
||||||
|
InterfaceWarningAdded: Schnittstellenwarnungszeit hinzugefügt oder geändert
|
||||||
|
InterfaceWarningDeleted n@Int: #{pluralDEeN n "Schnittstellenwarnungszeit"} gelöscht
|
||||||
@ -150,3 +150,9 @@ InterfaceWrite: Write
|
|||||||
InterfaceSuccess: Returned
|
InterfaceSuccess: Returned
|
||||||
InterfaceInfo: Message
|
InterfaceInfo: Message
|
||||||
InterfaceFreshness: Check hours
|
InterfaceFreshness: Check hours
|
||||||
|
ConfigInterfacesHeading: Configuration interface warnings
|
||||||
|
|
||||||
|
IWTActAdd: Add
|
||||||
|
IWTActDelete: Delete
|
||||||
|
InterfaceWarningAdded: Interface warning time added/changed
|
||||||
|
InterfaceWarningDeleted n: #{pluralENsN n "interface warning time"} deleted
|
||||||
@ -79,6 +79,7 @@ TableCompany: Firma
|
|||||||
TableCompanyFilter: Firma oder Nummer
|
TableCompanyFilter: Firma oder Nummer
|
||||||
TableCompanyShort: Firmenkürzel
|
TableCompanyShort: Firmenkürzel
|
||||||
TableCompanies: Firmen
|
TableCompanies: Firmen
|
||||||
|
TablePrimeCompany: Primäre Firma
|
||||||
TableCompanyNo: Firmennummer
|
TableCompanyNo: Firmennummer
|
||||||
TableCompanyNos: Firmennummern
|
TableCompanyNos: Firmennummern
|
||||||
TableCompanyUser: Firmenangehöriger
|
TableCompanyUser: Firmenangehöriger
|
||||||
|
|||||||
@ -79,6 +79,7 @@ TableCompany: Company
|
|||||||
TableCompanyFilter: Company/Nr
|
TableCompanyFilter: Company/Nr
|
||||||
TableCompanyShort: Company shorthand
|
TableCompanyShort: Company shorthand
|
||||||
TableCompanies: Companies
|
TableCompanies: Companies
|
||||||
|
TablePrimeCompany: Primary company
|
||||||
TableCompanyNo: Company number
|
TableCompanyNo: Company number
|
||||||
TableCompanyNos: Company numbers
|
TableCompanyNos: Company numbers
|
||||||
TableCompanyUser: Associate
|
TableCompanyUser: Associate
|
||||||
|
|||||||
1
routes
1
routes
@ -76,6 +76,7 @@
|
|||||||
/admin/problems/r-without-f ProblemFbutNoR GET
|
/admin/problems/r-without-f ProblemFbutNoR GET
|
||||||
/admin/problems/avs ProblemAvsSynchR GET POST
|
/admin/problems/avs ProblemAvsSynchR GET POST
|
||||||
/admin/problems/avs/errors ProblemAvsErrorR GET
|
/admin/problems/avs/errors ProblemAvsErrorR GET
|
||||||
|
/admin/config/interfaces ConfigInterfacesR GET POST
|
||||||
|
|
||||||
/comm CommCenterR GET
|
/comm CommCenterR GET
|
||||||
/comm/email MailCenterR GET POST
|
/comm/email MailCenterR GET POST
|
||||||
|
|||||||
@ -122,6 +122,7 @@ breadcrumb ProblemWithoutAvsId = i18nCrumb MsgProblemsNoAvsIdHeading $ Just
|
|||||||
breadcrumb ProblemFbutNoR = i18nCrumb MsgProblemsRWithoutFHeading $ Just AdminProblemsR
|
breadcrumb ProblemFbutNoR = i18nCrumb MsgProblemsRWithoutFHeading $ Just AdminProblemsR
|
||||||
breadcrumb ProblemAvsSynchR = i18nCrumb MsgProblemsAvsSynchHeading $ Just AdminProblemsR
|
breadcrumb ProblemAvsSynchR = i18nCrumb MsgProblemsAvsSynchHeading $ Just AdminProblemsR
|
||||||
breadcrumb ProblemAvsErrorR = i18nCrumb MsgProblemsAvsErrorHeading $ Just AdminProblemsR
|
breadcrumb ProblemAvsErrorR = i18nCrumb MsgProblemsAvsErrorHeading $ Just AdminProblemsR
|
||||||
|
breadcrumb ConfigInterfacesR = i18nCrumb MsgConfigInterfacesHeading $ Just AdminProblemsR
|
||||||
|
|
||||||
breadcrumb FirmAllR = i18nCrumb MsgMenuFirms Nothing
|
breadcrumb FirmAllR = i18nCrumb MsgMenuFirms Nothing
|
||||||
breadcrumb FirmsCommR{} = i18nCrumb MsgMenuFirmsComm $ Just FirmAllR
|
breadcrumb FirmsCommR{} = i18nCrumb MsgMenuFirmsComm $ Just FirmAllR
|
||||||
@ -2533,6 +2534,20 @@ pageActions AdminCrontabR = return
|
|||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
|
pageActions AdminProblemsR = return
|
||||||
|
[ NavPageActionPrimary
|
||||||
|
{ navLink = defNavLink MsgConfigInterfacesHeading ConfigInterfacesR
|
||||||
|
, navChildren = []
|
||||||
|
}
|
||||||
|
, NavPageActionPrimary
|
||||||
|
{ navLink = defNavLink MsgProblemsAvsSynchHeading ProblemAvsSynchR
|
||||||
|
, navChildren = []
|
||||||
|
}
|
||||||
|
, NavPageActionSecondary
|
||||||
|
{ navLink = defNavLink MsgProblemsAvsErrorHeading ProblemAvsErrorR
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
pageActions _ = return []
|
pageActions _ = return []
|
||||||
|
|
||||||
submissionList :: ( MonadIO m
|
submissionList :: ( MonadIO m
|
||||||
|
|||||||
@ -8,12 +8,14 @@ module Handler.Health.Interface
|
|||||||
getHealthInterfaceR
|
getHealthInterfaceR
|
||||||
, mkInterfaceLogTable
|
, mkInterfaceLogTable
|
||||||
, runInterfaceChecks
|
, runInterfaceChecks
|
||||||
|
, getConfigInterfacesR, postConfigInterfacesR
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
import Import
|
import Import
|
||||||
|
|
||||||
-- import qualified Data.Set as Set
|
import qualified Data.Set as Set
|
||||||
|
import qualified Data.Map as Map
|
||||||
import qualified Data.Text as Text
|
import qualified Data.Text as Text
|
||||||
import Handler.Utils
|
import Handler.Utils
|
||||||
import Handler.Utils.Concurrent
|
import Handler.Utils.Concurrent
|
||||||
@ -24,6 +26,8 @@ import qualified Database.Esqueleto.Utils as E
|
|||||||
import qualified Database.Esqueleto.Legacy as EL (on)
|
import qualified Database.Esqueleto.Legacy as EL (on)
|
||||||
import qualified Database.Persist.Sql as E (deleteWhereCount)
|
import qualified Database.Persist.Sql as E (deleteWhereCount)
|
||||||
|
|
||||||
|
defaultInterfaceWarnHours :: Int
|
||||||
|
defaultInterfaceWarnHours = 3 * 24 -- if no warn time can be found, use 3 days instead
|
||||||
|
|
||||||
-- | identify a wildcard argument
|
-- | identify a wildcard argument
|
||||||
wc2null :: Text -> Maybe Text
|
wc2null :: Text -> Maybe Text
|
||||||
@ -148,7 +152,7 @@ mkInterfaceLogTable flagError interfs@(reqIfs, banIfs) = do
|
|||||||
-- E.where_ $ E.not_ (ilog E.^. InterfaceLogInterface E.==. E.val "LMS" E.&&. ilog E.^. InterfaceLogSubtype E.==. E.val (sanitize "F")) -- BAD All missing, except for "Printer" "F"
|
-- E.where_ $ E.not_ (ilog E.^. InterfaceLogInterface E.==. E.val "LMS" E.&&. ilog E.^. InterfaceLogSubtype E.==. E.val (sanitize "F")) -- BAD All missing, except for "Printer" "F"
|
||||||
-- E.where_ $ E.not_ $ E.parens (ilog E.^. InterfaceLogInterface E.==. E.val "LMS" E.&&. ilog E.^. InterfaceLogSubtype E.==. E.val (sanitize "F")) -- WORKS OKAY
|
-- E.where_ $ E.not_ $ E.parens (ilog E.^. InterfaceLogInterface E.==. E.val "LMS" E.&&. ilog E.^. InterfaceLogSubtype E.==. E.val (sanitize "F")) -- WORKS OKAY
|
||||||
-- E.where_ $ ilog E.^. InterfaceLogInterface E.!=. E.val "LMS" E.||. ilog E.^. InterfaceLogSubtype E.!=. E.val (sanitize "F") -- WORKS OKAY
|
-- E.where_ $ ilog E.^. InterfaceLogInterface E.!=. E.val "LMS" E.||. ilog E.^. InterfaceLogSubtype E.!=. E.val (sanitize "F") -- WORKS OKAY
|
||||||
let ihour = E.coalesceDefault [ihealth E.?. InterfaceHealthHours] (E.val $ 3 * 24) -- if no default time is set, use 3 days instead
|
let ihour = E.coalesceDefault [ihealth E.?. InterfaceHealthHours] (E.val defaultInterfaceWarnHours) -- if no default time is set, use a default instead
|
||||||
return (ilog, ihour)
|
return (ilog, ihour)
|
||||||
|
|
||||||
queryILog :: (E.SqlExpr (Entity InterfaceLog) `E.LeftOuterJoin` E.SqlExpr (Maybe (Entity InterfaceHealth))) -> E.SqlExpr (Entity InterfaceLog)
|
queryILog :: (E.SqlExpr (Entity InterfaceLog) `E.LeftOuterJoin` E.SqlExpr (Maybe (Entity InterfaceHealth))) -> E.SqlExpr (Entity InterfaceLog)
|
||||||
@ -258,3 +262,140 @@ avsInterfaceCheck interfs = maybeRunCheck interfs (UniqueInterfaceHealth "AVS" (
|
|||||||
-- lastOk <- userAvsLastSynch . entityVal <<$>> selectFirst [UserAvsLastSynchError ==. Nothing] [Desc UserAvsLastSynch]
|
-- lastOk <- userAvsLastSynch . entityVal <<$>> selectFirst [UserAvsLastSynchError ==. Nothing] [Desc UserAvsLastSynch]
|
||||||
writeAvsSynchStats Nothing =<< mkBadInfo badRows badTime
|
writeAvsSynchStats Nothing =<< mkBadInfo badRows badTime
|
||||||
_ -> return ()
|
_ -> return ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
data IWTableAction
|
||||||
|
= IWTActAdd
|
||||||
|
| IWTActDelete
|
||||||
|
deriving (Eq, Ord, Enum, Bounded, Read, Show, Generic)
|
||||||
|
|
||||||
|
instance Universe IWTableAction
|
||||||
|
instance Finite IWTableAction
|
||||||
|
nullaryPathPiece ''IWTableAction $ camelToPathPiece' 2
|
||||||
|
embedRenderMessage ''UniWorX ''IWTableAction id
|
||||||
|
|
||||||
|
data IWTableActionData
|
||||||
|
= IWTActAddData
|
||||||
|
{ iwtActInterface :: Text
|
||||||
|
, iwtActSubtype :: Maybe Text
|
||||||
|
, iwtActWrite :: Maybe Bool
|
||||||
|
, iwtActHours :: Int
|
||||||
|
}
|
||||||
|
| IWTActDeleteData
|
||||||
|
deriving (Eq, Ord, Read, Show, Generic)
|
||||||
|
|
||||||
|
type IWTableExpr = E.SqlExpr (Entity InterfaceHealth)
|
||||||
|
|
||||||
|
queryInterfaceHealth :: IWTableExpr -> E.SqlExpr (Entity InterfaceHealth)
|
||||||
|
queryInterfaceHealth = id
|
||||||
|
|
||||||
|
type IWTableData = DBRow (Entity InterfaceHealth)
|
||||||
|
|
||||||
|
resultInterfaceHealth :: Lens' IWTableData (Entity InterfaceHealth)
|
||||||
|
resultInterfaceHealth = _dbrOutput
|
||||||
|
|
||||||
|
wildcardCell :: IsDBTable m b => (a -> DBCell m b) -> Maybe a -> DBCell m b
|
||||||
|
wildcardCell _ Nothing = textCell "*"
|
||||||
|
wildcardCell c (Just x) = c x
|
||||||
|
|
||||||
|
mkInterfaceWarnTable :: DB (FormResult (IWTableActionData, Set InterfaceHealthId), Widget)
|
||||||
|
mkInterfaceWarnTable = do
|
||||||
|
let
|
||||||
|
mkOption :: E.Value Text -> Option Text
|
||||||
|
mkOption (E.unValue -> t) = Option{ optionDisplay = t, optionInternalValue = t, optionExternalValue = toPathPiece t }
|
||||||
|
getSuggestion pj = E.select $ E.distinct $ do
|
||||||
|
il <- E.from $ E.table @InterfaceLog
|
||||||
|
let res = il E.^. pj
|
||||||
|
E.orderBy [E.asc res]
|
||||||
|
pure res
|
||||||
|
suggestionInterface :: HandlerFor UniWorX (OptionList Text)
|
||||||
|
suggestionInterface = mkOptionList . fmap mkOption <$> runDB (getSuggestion InterfaceLogInterface)
|
||||||
|
suggestionSubtype :: HandlerFor UniWorX (OptionList Text)
|
||||||
|
suggestionSubtype = mkOptionList . fmap mkOption <$> runDB (getSuggestion InterfaceLogSubtype)
|
||||||
|
dbtIdent = "interface-warnings" :: Text
|
||||||
|
dbtSQLQuery :: IWTableExpr -> E.SqlQuery IWTableExpr
|
||||||
|
dbtSQLQuery = return
|
||||||
|
dbtRowKey = queryInterfaceHealth >>> (E.^. InterfaceHealthId)
|
||||||
|
dbtProj = dbtProjId
|
||||||
|
dbtColonnade = formColonnade $ mconcat
|
||||||
|
[ dbSelect (applying _2) id (return . view (resultInterfaceHealth . _entityKey))
|
||||||
|
, sortable (Just "interface") (i18nCell MsgInterfaceName ) $ \(view (resultInterfaceHealth . _entityVal . _interfaceHealthInterface) -> n) -> textCell n
|
||||||
|
, sortable (Just "subtype") (i18nCell MsgInterfaceSubtype ) $ wildcardCell textCell . view (resultInterfaceHealth . _entityVal . _interfaceHealthSubtype )
|
||||||
|
, sortable (Just "write") (i18nCell MsgInterfaceWrite ) $ wildcardCell (`ifIconCell` IconEdit) . view (resultInterfaceHealth . _entityVal . _interfaceHealthWrite )
|
||||||
|
, sortable (Just "hours") (i18nCell MsgInterfaceFreshness ) $ numCell . view (resultInterfaceHealth . _entityVal . _interfaceHealthHours )
|
||||||
|
, sortable (Just "hours") (i18nCell MsgInterfaceFreshness ) $ textCell . formatDiffHours . view (resultInterfaceHealth . _entityVal . _interfaceHealthHours)
|
||||||
|
]
|
||||||
|
dbtSorting = mconcat
|
||||||
|
[ singletonMap "interface" $ SortColumn $ queryInterfaceHealth >>> (E.^. InterfaceHealthInterface)
|
||||||
|
, singletonMap "subtype" $ SortColumn $ queryInterfaceHealth >>> (E.^. InterfaceHealthSubtype)
|
||||||
|
, singletonMap "write" $ SortColumn $ queryInterfaceHealth >>> (E.^. InterfaceHealthWrite)
|
||||||
|
, singletonMap "time" $ SortColumn $ queryInterfaceHealth >>> (E.^. InterfaceHealthHours)
|
||||||
|
]
|
||||||
|
dbtFilter = mempty
|
||||||
|
dbtFilterUI = mempty
|
||||||
|
dbtStyle = def { dbsFilterLayout = defaultDBSFilterLayout }
|
||||||
|
dbtParams = DBParamsForm
|
||||||
|
{ dbParamsFormMethod = POST
|
||||||
|
, dbParamsFormAction = Nothing -- Just $ SomeRoute currentRoute
|
||||||
|
, dbParamsFormAttrs = []
|
||||||
|
, dbParamsFormSubmit = FormSubmit
|
||||||
|
, dbParamsFormAdditional
|
||||||
|
= let acts :: Map IWTableAction (AForm Handler IWTableActionData)
|
||||||
|
acts = mconcat
|
||||||
|
[ singletonMap IWTActAdd $ IWTActAddData
|
||||||
|
<$> apreq (textField & cfStrip & addDatalist suggestionInterface) (fslI MsgInterfaceName) Nothing
|
||||||
|
<*> aopt (textField & cfStrip & addDatalist suggestionSubtype) (fslI MsgInterfaceSubtype) Nothing
|
||||||
|
<*> aopt boolField' (fslI MsgInterfaceWrite) Nothing
|
||||||
|
<*> apreq intField (fslI MsgInterfaceFreshness) Nothing
|
||||||
|
, singletonMap IWTActDelete $ pure IWTActDeleteData
|
||||||
|
]
|
||||||
|
in renderAForm FormStandard
|
||||||
|
$ (, mempty) . First . Just
|
||||||
|
<$> multiActionA acts (fslI MsgTableAction) Nothing
|
||||||
|
, dbParamsFormEvaluate = liftHandler . runFormPost
|
||||||
|
, dbParamsFormResult = id
|
||||||
|
, dbParamsFormIdent = def
|
||||||
|
}
|
||||||
|
dbtCsvEncode = noCsvEncode
|
||||||
|
dbtCsvDecode = Nothing
|
||||||
|
dbtExtraReps = []
|
||||||
|
postprocess :: FormResult (First IWTableActionData, DBFormResult InterfaceHealthId Bool IWTableData)
|
||||||
|
-> FormResult ( IWTableActionData, Set InterfaceHealthId)
|
||||||
|
postprocess inp = do
|
||||||
|
(First (Just act), jobMap) <- inp
|
||||||
|
let jobSet = Map.keysSet . Map.filter id $ getDBFormResult (const False) jobMap
|
||||||
|
return (act, jobSet)
|
||||||
|
psValidator = def & defaultSorting [SortAscBy "interface", SortAscBy "subtype", SortAscBy "write"]
|
||||||
|
over _1 postprocess <$> dbTable psValidator DBTable{..}
|
||||||
|
|
||||||
|
getConfigInterfacesR, postConfigInterfacesR :: Handler Html
|
||||||
|
getConfigInterfacesR = postConfigInterfacesR
|
||||||
|
postConfigInterfacesR = do
|
||||||
|
|
||||||
|
-- we abuse messageTooltip for colored icons here
|
||||||
|
msgSuccessTooltip <- messageI Success MsgMessageSuccess
|
||||||
|
-- msgWarningTooltip <- messageI Warning MsgMessageWarning
|
||||||
|
msgErrorTooltip <- messageI Error MsgMessageError
|
||||||
|
let flagError = messageTooltip . bool msgErrorTooltip msgSuccessTooltip
|
||||||
|
((interfaceOks, interfaceTable), (warnRes, configTable)) <- runDB $ (,)
|
||||||
|
<$> mkInterfaceLogTable flagError mempty
|
||||||
|
<*> mkInterfaceWarnTable
|
||||||
|
let interfacesBadNr = length $ filter (not . snd) interfaceOks
|
||||||
|
formResult warnRes $ \case
|
||||||
|
(IWTActAddData{..}, _) -> do
|
||||||
|
void $ runDB $ upsertBy
|
||||||
|
(UniqueInterfaceHealth iwtActInterface iwtActSubtype iwtActWrite)
|
||||||
|
( InterfaceHealth iwtActInterface iwtActSubtype iwtActWrite iwtActHours)
|
||||||
|
[InterfaceHealthHours =. iwtActHours]
|
||||||
|
addMessageI Success MsgInterfaceWarningAdded
|
||||||
|
reloadKeepGetParams ConfigInterfacesR
|
||||||
|
(IWTActDeleteData, ihids) -> do
|
||||||
|
runDB $ mapM_ delete ihids
|
||||||
|
addMessageI Success $ MsgInterfaceWarningDeleted $ Set.size ihids
|
||||||
|
reloadKeepGetParams ConfigInterfacesR
|
||||||
|
|
||||||
|
siteLayoutMsg MsgConfigInterfacesHeading $ do
|
||||||
|
setTitleI MsgConfigInterfacesHeading
|
||||||
|
let defWarnTime = formatDiffHours defaultInterfaceWarnHours
|
||||||
|
$(i18nWidgetFile "config-interfaces")
|
||||||
@ -220,7 +220,6 @@ data LmsTableCsv = LmsTableCsv -- L..T..C.. -> ltc..
|
|||||||
{ ltcDisplayName :: UserDisplayName
|
{ ltcDisplayName :: UserDisplayName
|
||||||
, ltcEmail :: UserEmail
|
, ltcEmail :: UserEmail
|
||||||
, ltcCompany :: Maybe Text
|
, ltcCompany :: Maybe Text
|
||||||
, ltcCompanyNumbers :: CsvSemicolonList Int
|
|
||||||
, ltcValidUntil :: Day
|
, ltcValidUntil :: Day
|
||||||
, ltcLastRefresh :: Day
|
, ltcLastRefresh :: Day
|
||||||
, ltcFirstHeld :: Day
|
, ltcFirstHeld :: Day
|
||||||
@ -242,8 +241,7 @@ ltcExample :: LmsTableCsv
|
|||||||
ltcExample = LmsTableCsv
|
ltcExample = LmsTableCsv
|
||||||
{ ltcDisplayName = "Max Mustermann"
|
{ ltcDisplayName = "Max Mustermann"
|
||||||
, ltcEmail = "m.mustermann@example.com"
|
, ltcEmail = "m.mustermann@example.com"
|
||||||
, ltcCompany = Just "Example Brothers LLC, SecondaryJobs Inc"
|
, ltcCompany = Just "Example Brothers LLC"
|
||||||
, ltcCompanyNumbers = CsvSemicolonList [27,69]
|
|
||||||
, ltcValidUntil = succ compDay
|
, ltcValidUntil = succ compDay
|
||||||
, ltcLastRefresh = compDay
|
, ltcLastRefresh = compDay
|
||||||
, ltcFirstHeld = pred $ pred compDay
|
, ltcFirstHeld = pred $ pred compDay
|
||||||
@ -285,8 +283,7 @@ instance CsvColumnsExplained LmsTableCsv where
|
|||||||
csvColumnsExplanations = genericCsvColumnsExplanations ltcOptions $ Map.fromList
|
csvColumnsExplanations = genericCsvColumnsExplanations ltcOptions $ Map.fromList
|
||||||
[ ('ltcDisplayName , SomeMessage MsgLmsUser)
|
[ ('ltcDisplayName , SomeMessage MsgLmsUser)
|
||||||
, ('ltcEmail , SomeMessage MsgTableLmsEmail)
|
, ('ltcEmail , SomeMessage MsgTableLmsEmail)
|
||||||
, ('ltcCompany , SomeMessage MsgTableCompanies)
|
, ('ltcCompany , SomeMessage MsgTablePrimeCompany)
|
||||||
, ('ltcCompanyNumbers , SomeMessage MsgTableCompanyNos)
|
|
||||||
, ('ltcValidUntil , SomeMessage MsgLmsQualificationValidUntil)
|
, ('ltcValidUntil , SomeMessage MsgLmsQualificationValidUntil)
|
||||||
, ('ltcLastRefresh , SomeMessage MsgTableQualificationLastRefresh)
|
, ('ltcLastRefresh , SomeMessage MsgTableQualificationLastRefresh)
|
||||||
, ('ltcFirstHeld , SomeMessage MsgTableQualificationFirstHeld)
|
, ('ltcFirstHeld , SomeMessage MsgTableQualificationFirstHeld)
|
||||||
@ -320,7 +317,7 @@ queryQualBlock :: LmsTableExpr -> E.SqlExpr (Maybe (Entity QualificationUserBloc
|
|||||||
queryQualBlock = $(sqlLOJproj 2 2)
|
queryQualBlock = $(sqlLOJproj 2 2)
|
||||||
|
|
||||||
|
|
||||||
type LmsTableData = DBRow (Entity QualificationUser, Entity User, Entity LmsUser, Maybe (Entity QualificationUserBlock), E.Value (Maybe [Maybe UTCTime]), [Entity UserCompany], E.Value Bool)
|
type LmsTableData = DBRow (Entity QualificationUser, Entity User, Entity LmsUser, Maybe (Entity QualificationUserBlock), E.Value (Maybe [Maybe UTCTime]), E.Value (Maybe CompanyId), E.Value Bool)
|
||||||
|
|
||||||
resultQualUser :: Lens' LmsTableData (Entity QualificationUser)
|
resultQualUser :: Lens' LmsTableData (Entity QualificationUser)
|
||||||
resultQualUser = _dbrOutput . _1
|
resultQualUser = _dbrOutput . _1
|
||||||
@ -337,8 +334,8 @@ resultQualBlock = _dbrOutput . _4 . _Just
|
|||||||
resultPrintAck :: Traversal' LmsTableData [Maybe UTCTime]
|
resultPrintAck :: Traversal' LmsTableData [Maybe UTCTime]
|
||||||
resultPrintAck = _dbrOutput . _5 . _unValue . _Just
|
resultPrintAck = _dbrOutput . _5 . _unValue . _Just
|
||||||
|
|
||||||
resultCompanyUser :: Lens' LmsTableData [Entity UserCompany]
|
resultCompanyId :: Traversal' LmsTableData CompanyId
|
||||||
resultCompanyUser = _dbrOutput . _6
|
resultCompanyId = _dbrOutput . _6 . _unValue . _Just
|
||||||
|
|
||||||
resultValidQualification :: Lens' LmsTableData Bool
|
resultValidQualification :: Lens' LmsTableData Bool
|
||||||
resultValidQualification = _dbrOutput . _7 . _unValue
|
resultValidQualification = _dbrOutput . _7 . _unValue
|
||||||
@ -406,6 +403,7 @@ lmsTableQuery :: UTCTime -> QualificationId -> LmsTableExpr
|
|||||||
, E.SqlExpr (Entity LmsUser)
|
, E.SqlExpr (Entity LmsUser)
|
||||||
, E.SqlExpr (Maybe (Entity QualificationUserBlock))
|
, E.SqlExpr (Maybe (Entity QualificationUserBlock))
|
||||||
, E.SqlExpr (E.Value (Maybe [Maybe UTCTime])) -- outer maybe indicates, whether a printJob exists, inner maybe indicates all acknowledged printJobs
|
, E.SqlExpr (E.Value (Maybe [Maybe UTCTime])) -- outer maybe indicates, whether a printJob exists, inner maybe indicates all acknowledged printJobs
|
||||||
|
, E.SqlExpr (E.Value (Maybe CompanyId))
|
||||||
, E.SqlExpr (E.Value Bool)
|
, E.SqlExpr (E.Value Bool)
|
||||||
)
|
)
|
||||||
lmsTableQuery now qid (qualUser `E.InnerJoin` user `E.InnerJoin` lmsUser `E.LeftOuterJoin` qualBlock) = do
|
lmsTableQuery now qid (qualUser `E.InnerJoin` user `E.InnerJoin` lmsUser `E.LeftOuterJoin` qualBlock) = do
|
||||||
@ -421,12 +419,16 @@ lmsTableQuery now qid (qualUser `E.InnerJoin` user `E.InnerJoin` lmsUser `E.Left
|
|||||||
E.where_ $ E.val qid E.==. qualUser E.^. QualificationUserQualification
|
E.where_ $ E.val qid E.==. qualUser E.^. QualificationUserQualification
|
||||||
-- Letztes Datum anzeigen, wenn mehrere, dann diese in klickbaren Tooltip verstecken!
|
-- Letztes Datum anzeigen, wenn mehrere, dann diese in klickbaren Tooltip verstecken!
|
||||||
let printAcknowledged = E.subSelectMaybe . E.from $ \pj -> do
|
let printAcknowledged = E.subSelectMaybe . E.from $ \pj -> do
|
||||||
E.where_ $ E.isJust (pj E.^. PrintJobLmsUser)
|
E.where_ $ E.isJust (pj E.^. PrintJobLmsUser)
|
||||||
E.&&. ((lmsUser E.^. LmsUserIdent) E.=?. (pj E.^. PrintJobLmsUser))
|
E.&&. ((lmsUser E.^. LmsUserIdent) E.=?. (pj E.^. PrintJobLmsUser))
|
||||||
let pjOrder = [E.desc $ pj E.^. PrintJobCreated, E.desc $ pj E.^. PrintJobAcknowledged] -- latest created comes first! This is assumed to be the case later on!
|
let pjOrder = [E.desc $ pj E.^. PrintJobCreated, E.desc $ pj E.^. PrintJobAcknowledged] -- latest created comes first! This is assumed to be the case later on!
|
||||||
pure $ --(E.arrayAggWith E.AggModeAll (pj E.^. PrintJobCreated ) pjOrder, -- return two aggregates only works with select, the restricted type of subSelect does not seem to support this!
|
pure $ --(E.arrayAggWith E.AggModeAll (pj E.^. PrintJobCreated ) pjOrder, -- return two aggregates only works with select, the restricted type of subSelect does not seem to support this!
|
||||||
E.arrayAggWith E.AggModeAll (pj E.^. PrintJobAcknowledged) pjOrder
|
E.arrayAggWith E.AggModeAll (pj E.^. PrintJobAcknowledged) pjOrder
|
||||||
return (qualUser, user, lmsUser, qualBlock, printAcknowledged, validQualification now qualUser)
|
primeComp = E.subSelect . E.from $ \uc -> do
|
||||||
|
E.where_ $ user E.^. UserId E.==. uc E.^. UserCompanyUser
|
||||||
|
E.orderBy [E.desc $ uc E.^. UserCompanyPriority, E.asc $ uc E.^. UserCompanyCompany]
|
||||||
|
return (uc E.^. UserCompanyCompany)
|
||||||
|
return (qualUser, user, lmsUser, qualBlock, printAcknowledged, primeComp, validQualification now qualUser)
|
||||||
|
|
||||||
|
|
||||||
mkLmsTable :: ( Functor h, ToSortable h
|
mkLmsTable :: ( Functor h, ToSortable h
|
||||||
@ -435,25 +437,26 @@ mkLmsTable :: ( Functor h, ToSortable h
|
|||||||
=> Bool
|
=> Bool
|
||||||
-> Entity Qualification
|
-> Entity Qualification
|
||||||
-> Map LmsTableAction (AForm Handler LmsTableActionData)
|
-> Map LmsTableAction (AForm Handler LmsTableActionData)
|
||||||
-> (Map CompanyId Company -> cols)
|
-> ((CompanyId -> CompanyName) -> cols)
|
||||||
-> PSValidator (MForm Handler) (FormResult (First LmsTableActionData, DBFormResult UserId Bool LmsTableData))
|
-> PSValidator (MForm Handler) (FormResult (First LmsTableActionData, DBFormResult UserId Bool LmsTableData))
|
||||||
-> DB (FormResult (LmsTableActionData, Set UserId), Widget)
|
-> DB (FormResult (LmsTableActionData, Set UserId), Widget)
|
||||||
mkLmsTable isAdmin (Entity qid quali) acts cols psValidator = do
|
mkLmsTable isAdmin (Entity qid quali) acts cols psValidator = do
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
-- lookup all companies
|
-- lookup all companies
|
||||||
cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do
|
cmpMap <- memcachedBy (Just . Right $ 15 * diffMinute) ("CompanyDictionary"::Text) $ do
|
||||||
cmps <- selectList [] [] -- [Asc CompanyShorthand]
|
cmps <- selectList [] [] -- [Asc CompanyShorthand]
|
||||||
return $ Map.fromList $ fmap (\Entity{..} -> (entityKey, entityVal)) cmps
|
return $ Map.fromList $ fmap (\Entity{..} -> (entityKey, entityVal)) cmps
|
||||||
let
|
let
|
||||||
|
getCompanyName :: CompanyId -> CompanyName
|
||||||
|
getCompanyName cid = maybe (unCompanyKey cid) companyName $ Map.lookup cid cmpMap -- use shorthand in case of impossible failure
|
||||||
|
|
||||||
csvName = T.replace " " "-" $ ciOriginal (quali ^. _qualificationName)
|
csvName = T.replace " " "-" $ ciOriginal (quali ^. _qualificationName)
|
||||||
dbtIdent :: Text
|
dbtIdent :: Text
|
||||||
dbtIdent = "lms"
|
dbtIdent = "lms"
|
||||||
dbtSQLQuery = lmsTableQuery now qid
|
dbtSQLQuery = lmsTableQuery now qid
|
||||||
dbtRowKey = queryUser >>> (E.^. UserId)
|
dbtRowKey = queryUser >>> (E.^. UserId)
|
||||||
dbtProj = dbtProjSimple $ \(qualUsr, usr, lmsUsr, qUsrBlock, printAcks, validQ) -> do
|
dbtProj = dbtProjId
|
||||||
cmpUsr <- selectList [UserCompanyUser ==. entityKey usr] [Desc UserCompanyPriority, Asc UserCompanyCompany, LimitTo 1]
|
dbtColonnade = cols getCompanyName
|
||||||
return (qualUsr, usr, lmsUsr, qUsrBlock, printAcks, cmpUsr, validQ)
|
|
||||||
dbtColonnade = cols cmpMap
|
|
||||||
dbtSorting = mconcat
|
dbtSorting = mconcat
|
||||||
[ single $ sortUserNameLink queryUser
|
[ single $ sortUserNameLink queryUser
|
||||||
, single $ sortUserEmail queryUser
|
, single $ sortUserEmail queryUser
|
||||||
@ -544,25 +547,20 @@ mkLmsTable isAdmin (Entity qid quali) acts cols psValidator = do
|
|||||||
doEncode' = LmsTableCsv
|
doEncode' = LmsTableCsv
|
||||||
<$> view (resultUser . _entityVal . _userDisplayName)
|
<$> view (resultUser . _entityVal . _userDisplayName)
|
||||||
<*> view (resultUser . _entityVal . _userDisplayEmail)
|
<*> view (resultUser . _entityVal . _userDisplayEmail)
|
||||||
<*> (view resultCompanyUser >>= getCompanies)
|
<*> preview (resultCompanyId . to getCompanyName . _CI)
|
||||||
<*> (view resultCompanyUser >>= getCompanyNos)
|
<*> view (resultQualUser . _entityVal . _qualificationUserValidUntil)
|
||||||
<*> view (resultQualUser . _entityVal . _qualificationUserValidUntil)
|
<*> view (resultQualUser . _entityVal . _qualificationUserLastRefresh)
|
||||||
<*> view (resultQualUser . _entityVal . _qualificationUserLastRefresh)
|
<*> view (resultQualUser . _entityVal . _qualificationUserFirstHeld)
|
||||||
<*> view (resultQualUser . _entityVal . _qualificationUserFirstHeld)
|
|
||||||
<*> preview (resultQualBlock . _entityVal . _qualificationUserBlockUnblock . _not)
|
<*> preview (resultQualBlock . _entityVal . _qualificationUserBlockUnblock . _not)
|
||||||
<*> preview (resultQualBlock . _entityVal . _qualificationUserBlockFrom)
|
<*> preview (resultQualBlock . _entityVal . _qualificationUserBlockFrom)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserIdent)
|
<*> view (resultLmsUser . _entityVal . _lmsUserIdent)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserStatus)
|
<*> view (resultLmsUser . _entityVal . _lmsUserStatus)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserStatusDay)
|
<*> view (resultLmsUser . _entityVal . _lmsUserStatusDay)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserStarted)
|
<*> view (resultLmsUser . _entityVal . _lmsUserStarted)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserDatePin)
|
<*> view (resultLmsUser . _entityVal . _lmsUserDatePin)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserReceived)
|
<*> view (resultLmsUser . _entityVal . _lmsUserReceived)
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserNotified) -- TODO: only exports last email date / print job sending date, not print acknowledge
|
<*> view (resultLmsUser . _entityVal . _lmsUserNotified) -- TODO: only exports last email date / print job sending date, not print acknowledge
|
||||||
<*> view (resultLmsUser . _entityVal . _lmsUserEnded)
|
<*> view (resultLmsUser . _entityVal . _lmsUserEnded)
|
||||||
getCompanies cmps = case mapMaybe (flip Map.lookup cmpMap . view (_entityVal . _userCompanyCompany)) cmps of
|
|
||||||
[] -> pure Nothing
|
|
||||||
somecmps -> pure $ Just $ intercalate ", " $ fmap (view (_companyName . _CI)) somecmps
|
|
||||||
getCompanyNos = pure . CsvSemicolonList . mapMaybe (preview (_Just . _companyAvsId) . flip Map.lookup cmpMap . view (_entityVal . _userCompanyCompany))
|
|
||||||
|
|
||||||
dbtCsvDecode = Nothing
|
dbtCsvDecode = Nothing
|
||||||
dbtExtraReps = []
|
dbtExtraReps = []
|
||||||
@ -627,16 +625,12 @@ postLmsR sid qsh = do
|
|||||||
-- <*> aopt (commentField MsgQualificationActBlockSupervisor) (fslI MsgMessageWarning) Nothing
|
-- <*> aopt (commentField MsgQualificationActBlockSupervisor) (fslI MsgMessageWarning) Nothing
|
||||||
<* aformMessage msgRestartWarning
|
<* aformMessage msgRestartWarning
|
||||||
]
|
]
|
||||||
colChoices cmpMap = mconcat
|
colChoices getCompanyName = mconcat
|
||||||
[ guardMonoid isAdmin $ dbSelect (applying _2) id (return . view (resultUser . _entityKey))
|
[ guardMonoid isAdmin $ dbSelect (applying _2) id (return . view (resultUser . _entityKey))
|
||||||
, colUserNameModalHdrAdmin MsgLmsUser AdminUserR
|
, colUserNameModalHdrAdmin MsgLmsUser AdminUserR
|
||||||
, colUserEmail
|
, colUserEmail
|
||||||
, sortable (Just "user-company") (i18nCell MsgTableCompany) $ \( view resultCompanyUser -> cmps) ->
|
, sortable (Just "user-company") (i18nCell MsgTablePrimeCompany) $ \(preview resultCompanyId -> mcid) ->
|
||||||
let cs = [ companyCell (unCompanyKey cmpId) cmpName cmpSpr
|
maybeEmpty mcid $ \cid -> companyCell (unCompanyKey cid) (getCompanyName cid) False
|
||||||
| Entity _ UserCompany{userCompanyCompany=cmpId, userCompanySupervisor=cmpSpr} <- cmps
|
|
||||||
, let cmpName = maybe (unCompanyKey cmpId) companyName $ Map.lookup cmpId cmpMap
|
|
||||||
]
|
|
||||||
in intercalate spacerCell cs
|
|
||||||
, colUserMatriclenr isAdmin
|
, colUserMatriclenr isAdmin
|
||||||
-- , sortable (Just "validity") (i18nCell MsgQualificationValidIndicator) (qualificationValidIconCell nowaday . view resultQualUser)
|
-- , sortable (Just "validity") (i18nCell MsgQualificationValidIndicator) (qualificationValidIconCell nowaday . view resultQualUser)
|
||||||
, sortable (Just "first-held") (i18nCell MsgTableQualificationFirstHeld) $ \( view $ resultQualUser . _entityVal . _qualificationUserFirstHeld -> d) -> dayCell d
|
, sortable (Just "first-held") (i18nCell MsgTableQualificationFirstHeld) $ \( view $ resultQualUser . _entityVal . _qualificationUserFirstHeld -> d) -> dayCell d
|
||||||
|
|||||||
@ -96,7 +96,7 @@ mkMCTable = do
|
|||||||
, sortable Nothing (i18nCell MsgCommSubject) $ \(view resultMail -> Entity k v) ->
|
, sortable Nothing (i18nCell MsgCommSubject) $ \(view resultMail -> Entity k v) ->
|
||||||
let subject = v ^? _sentMailHeaders . _mailHeaders' . _mailHeader' "Subject"
|
let subject = v ^? _sentMailHeaders . _mailHeaders' . _mailHeader' "Subject"
|
||||||
linkWgt = maybe (msg2widget MsgUtilEMail) text2widget subject
|
linkWgt = maybe (msg2widget MsgUtilEMail) text2widget subject
|
||||||
in anchorCellM (MailPlainR <$> encrypt k) linkWgt
|
in anchorCellM (MailHtmlR <$> encrypt k) linkWgt
|
||||||
-- , sortable Nothing (i18nCell MsgCommContent) $ \(view $ resultMail . _entityKey -> k) -> anchorCellM (MailHtmlR <$> encrypt k) (text2widget "html")
|
-- , sortable Nothing (i18nCell MsgCommContent) $ \(view $ resultMail . _entityKey -> k) -> anchorCellM (MailHtmlR <$> encrypt k) (text2widget "html")
|
||||||
-- , sortable Nothing (i18nCell MsgCommSubject) $ \(preview $ resultMail . _entityVal . _sentMailHeaders . _mailHeaders' . _mailHeader' "Subject" -> h) -> cellMaybe textCell h
|
-- , sortable Nothing (i18nCell MsgCommSubject) $ \(preview $ resultMail . _entityVal . _sentMailHeaders . _mailHeaders' . _mailHeader' "Subject" -> h) -> cellMaybe textCell h
|
||||||
]
|
]
|
||||||
@ -219,10 +219,13 @@ handleMailShow hdr prefTypes cusm = do
|
|||||||
<p>
|
<p>
|
||||||
^{part2widget pt}
|
^{part2widget pt}
|
||||||
|]
|
|]
|
||||||
-- Include for Debugging:
|
-- Include for Debugging:
|
||||||
-- ^{jsonWidget (sm ^. _sentMailHeaders)}
|
-- <section>
|
||||||
-- ^{jsonWidget (sentMailContentContent cn)}
|
-- <h2>Debugging
|
||||||
|
-- <p>
|
||||||
|
-- ^{jsonWidget (sm ^. _sentMailHeaders)}
|
||||||
|
-- <p>
|
||||||
|
-- ^{jsonWidget (sentMailContentContent cn)} -- content fields needs decoding of base64 to make sense here
|
||||||
|
|
||||||
selectAlternative :: [ContentType] -> Alternatives -> Maybe Part
|
selectAlternative :: [ContentType] -> Alternatives -> Maybe Part
|
||||||
selectAlternative (fmap decodeUtf8 -> prefTypes) allAlts = aux prefTypes allAlts
|
selectAlternative (fmap decodeUtf8 -> prefTypes) allAlts = aux prefTypes allAlts
|
||||||
@ -255,8 +258,8 @@ part2widget Part{partContent=PartContent (LB.toStrict -> pc), partType=pt, partD
|
|||||||
|]
|
|]
|
||||||
where
|
where
|
||||||
showBody
|
showBody
|
||||||
| pt == decodeUtf8 typePlain = toWidget $ preEscapedToHtml $ plaintextToHtml $ decodeUtf8 pc
|
| pt == decodeUtf8 typePlain = toWidget $ preEscapedToHtml $ plainTextToHtml $ decodeUtf8 pc
|
||||||
| pt == decodeUtf8 typeHtml = toWidget $ preEscapedToHtml $ decodeUtf8 pc -- preEscapedToHtml :: ToMarkup a => a -> Html
|
| pt == decodeUtf8 typeHtml = toWidget $ preEscapedToHtml $ plainHtmlToHtml $ decodeUtf8 pc -- preEscapedToHtml :: ToMarkup a => a -> Html
|
||||||
| pt == decodeUtf8 typeJson =
|
| pt == decodeUtf8 typeJson =
|
||||||
let jw :: Aeson.Value -> Widget = jsonWidget
|
let jw :: Aeson.Value -> Widget = jsonWidget
|
||||||
in either str2widget jw $ Aeson.eitherDecodeStrict' pc
|
in either str2widget jw $ Aeson.eitherDecodeStrict' pc
|
||||||
|
|||||||
@ -158,7 +158,6 @@ data QualificationTableCsv = QualificationTableCsv -- Q..T..C.. -> qtc..
|
|||||||
{ qtcDisplayName :: UserDisplayName
|
{ qtcDisplayName :: UserDisplayName
|
||||||
, qtcEmail :: UserEmail
|
, qtcEmail :: UserEmail
|
||||||
, qtcCompany :: Maybe Text
|
, qtcCompany :: Maybe Text
|
||||||
, qtcCompanyNumbers :: CsvSemicolonList Int
|
|
||||||
, qtcValidUntil :: Day
|
, qtcValidUntil :: Day
|
||||||
, qtcLastRefresh :: Day
|
, qtcLastRefresh :: Day
|
||||||
, qtcBlockStatus :: Maybe Bool
|
, qtcBlockStatus :: Maybe Bool
|
||||||
@ -174,8 +173,7 @@ qtcExample :: QualificationTableCsv
|
|||||||
qtcExample = QualificationTableCsv
|
qtcExample = QualificationTableCsv
|
||||||
{ qtcDisplayName = "Max Mustermann"
|
{ qtcDisplayName = "Max Mustermann"
|
||||||
, qtcEmail = "m.mustermann@example.com"
|
, qtcEmail = "m.mustermann@example.com"
|
||||||
, qtcCompany = Just "Example Brothers LLC, SecondaryJobs Inc"
|
, qtcCompany = Just "Example Brothers LLC"
|
||||||
, qtcCompanyNumbers = CsvSemicolonList [27,69]
|
|
||||||
, qtcValidUntil = compDay
|
, qtcValidUntil = compDay
|
||||||
, qtcLastRefresh = compDay
|
, qtcLastRefresh = compDay
|
||||||
, qtcBlockStatus = Nothing
|
, qtcBlockStatus = Nothing
|
||||||
@ -209,8 +207,7 @@ instance CsvColumnsExplained QualificationTableCsv where
|
|||||||
csvColumnsExplanations = genericCsvColumnsExplanations qtcOptions $ Map.fromList
|
csvColumnsExplanations = genericCsvColumnsExplanations qtcOptions $ Map.fromList
|
||||||
[ ('qtcDisplayName , SomeMessage MsgLmsUser)
|
[ ('qtcDisplayName , SomeMessage MsgLmsUser)
|
||||||
, ('qtcEmail , SomeMessage MsgTableLmsEmail)
|
, ('qtcEmail , SomeMessage MsgTableLmsEmail)
|
||||||
, ('qtcCompany , SomeMessage MsgTableCompanies)
|
, ('qtcCompany , SomeMessage MsgTablePrimeCompany)
|
||||||
, ('qtcCompanyNumbers , SomeMessage MsgTableCompanyNos)
|
|
||||||
, ('qtcValidUntil , SomeMessage MsgLmsQualificationValidUntil)
|
, ('qtcValidUntil , SomeMessage MsgLmsQualificationValidUntil)
|
||||||
, ('qtcLastRefresh , SomeMessage MsgTableQualificationLastRefresh)
|
, ('qtcLastRefresh , SomeMessage MsgTableQualificationLastRefresh)
|
||||||
, ('qtcBlockStatus , SomeMessage MsgInfoQualificationBlockStatus)
|
, ('qtcBlockStatus , SomeMessage MsgInfoQualificationBlockStatus)
|
||||||
@ -238,7 +235,7 @@ queryLmsUser = $(sqlLOJproj 3 2)
|
|||||||
queryQualBlock :: QualificationTableExpr -> E.SqlExpr (Maybe (Entity QualificationUserBlock))
|
queryQualBlock :: QualificationTableExpr -> E.SqlExpr (Maybe (Entity QualificationUserBlock))
|
||||||
queryQualBlock = $(sqlLOJproj 3 3)
|
queryQualBlock = $(sqlLOJproj 3 3)
|
||||||
|
|
||||||
type QualificationTableData = DBRow (Entity QualificationUser, Entity User, Maybe (Entity LmsUser), Maybe (Entity QualificationUserBlock), [Entity UserCompany])
|
type QualificationTableData = DBRow (Entity QualificationUser, Entity User, Maybe (Entity LmsUser), Maybe (Entity QualificationUserBlock), E.Value (Maybe CompanyId))
|
||||||
|
|
||||||
resultQualUser :: Lens' QualificationTableData (Entity QualificationUser)
|
resultQualUser :: Lens' QualificationTableData (Entity QualificationUser)
|
||||||
resultQualUser = _dbrOutput . _1
|
resultQualUser = _dbrOutput . _1
|
||||||
@ -252,8 +249,8 @@ resultLmsUser = _dbrOutput . _3 . _Just
|
|||||||
resultQualBlock :: Traversal' QualificationTableData (Entity QualificationUserBlock)
|
resultQualBlock :: Traversal' QualificationTableData (Entity QualificationUserBlock)
|
||||||
resultQualBlock = _dbrOutput . _4 . _Just
|
resultQualBlock = _dbrOutput . _4 . _Just
|
||||||
|
|
||||||
resultCompanyUser :: Lens' QualificationTableData [Entity UserCompany]
|
resultCompanyId :: Traversal' QualificationTableData CompanyId
|
||||||
resultCompanyUser = _dbrOutput . _5
|
resultCompanyId = _dbrOutput . _5 . _unValue . _Just
|
||||||
|
|
||||||
|
|
||||||
instance HasEntity QualificationTableData User where
|
instance HasEntity QualificationTableData User where
|
||||||
@ -340,6 +337,7 @@ qualificationTableQuery :: UTCTime -> QualificationId -> (_ -> E.SqlExpr (E.Valu
|
|||||||
, E.SqlExpr (Entity User)
|
, E.SqlExpr (Entity User)
|
||||||
, E.SqlExpr (Maybe (Entity LmsUser))
|
, E.SqlExpr (Maybe (Entity LmsUser))
|
||||||
, E.SqlExpr (Maybe (Entity QualificationUserBlock))
|
, E.SqlExpr (Maybe (Entity QualificationUserBlock))
|
||||||
|
, E.SqlExpr (E.Value (Maybe CompanyId))
|
||||||
)
|
)
|
||||||
qualificationTableQuery now qid fltr (qualUser `E.InnerJoin` user `E.LeftOuterJoin` lmsUser `E.LeftOuterJoin` qualBlock) = do
|
qualificationTableQuery now qid fltr (qualUser `E.InnerJoin` user `E.LeftOuterJoin` lmsUser `E.LeftOuterJoin` qualBlock) = do
|
||||||
-- E.distinctOnOrderBy will not work: sorting with dbTable should work, except that columns contained in distinctOnOrderBy cannot be sorted inversely by user; but PostgreSQL leftJoin with distinct filters too many results, see SQL Example lead/lag under jost/misc DevOps
|
-- E.distinctOnOrderBy will not work: sorting with dbTable should work, except that columns contained in distinctOnOrderBy cannot be sorted inversely by user; but PostgreSQL leftJoin with distinct filters too many results, see SQL Example lead/lag under jost/misc DevOps
|
||||||
@ -351,7 +349,11 @@ qualificationTableQuery now qid fltr (qualUser `E.InnerJoin` user `E.LeftOuterJo
|
|||||||
E.on $ user E.^. UserId E.==. qualUser E.^. QualificationUserUser
|
E.on $ user E.^. UserId E.==. qualUser E.^. QualificationUserUser
|
||||||
E.where_ $ fltr qualUser
|
E.where_ $ fltr qualUser
|
||||||
E.&&. (E.val qid E.==. qualUser E.^. QualificationUserQualification)
|
E.&&. (E.val qid E.==. qualUser E.^. QualificationUserQualification)
|
||||||
return (qualUser, user, lmsUser, qualBlock)
|
let primeComp = E.subSelect . E.from $ \uc -> do
|
||||||
|
E.where_ $ user E.^. UserId E.==. uc E.^. UserCompanyUser
|
||||||
|
E.orderBy [E.desc $ uc E.^. UserCompanyPriority, E.asc $ uc E.^. UserCompanyCompany]
|
||||||
|
return (uc E.^. UserCompanyCompany)
|
||||||
|
return (qualUser, user, lmsUser, qualBlock, primeComp)
|
||||||
|
|
||||||
|
|
||||||
mkQualificationTable ::
|
mkQualificationTable ::
|
||||||
@ -361,17 +363,19 @@ mkQualificationTable ::
|
|||||||
=> Bool
|
=> Bool
|
||||||
-> Entity Qualification
|
-> Entity Qualification
|
||||||
-> Map QualificationTableAction (AForm Handler QualificationTableActionData)
|
-> Map QualificationTableAction (AForm Handler QualificationTableActionData)
|
||||||
-> (Map CompanyId Company -> cols)
|
-> ((CompanyId -> CompanyName) -> cols)
|
||||||
-> PSValidator (MForm Handler) (FormResult (First QualificationTableActionData, DBFormResult UserId Bool QualificationTableData))
|
-> PSValidator (MForm Handler) (FormResult (First QualificationTableActionData, DBFormResult UserId Bool QualificationTableData))
|
||||||
-> DB (FormResult (QualificationTableActionData, Set UserId), Widget)
|
-> DB (FormResult (QualificationTableActionData, Set UserId), Widget)
|
||||||
mkQualificationTable isAdmin (Entity qid quali) acts cols psValidator = do
|
mkQualificationTable isAdmin (Entity qid quali) acts cols psValidator = do
|
||||||
svs <- getSupervisees
|
svs <- getSupervisees
|
||||||
now <- liftIO getCurrentTime
|
now <- liftIO getCurrentTime
|
||||||
-- lookup all companies
|
-- lookup all companies
|
||||||
cmpMap <- memcachedBy (Just . Right $ 5 * diffMinute) ("CompanyDictionary"::Text) $ do
|
cmpMap <- memcachedBy (Just . Right $ 15 * diffMinute) ("CompanyDictionary"::Text) $ do
|
||||||
cmps <- selectList [] [] -- [Asc CompanyShorthand]
|
cmps <- selectList [] [] -- [Asc CompanyShorthand]
|
||||||
return $ Map.fromList $ fmap (\Entity{..} -> (entityKey, entityVal)) cmps
|
return $ Map.fromList $ fmap (\Entity{..} -> (entityKey, entityVal)) cmps
|
||||||
let
|
let
|
||||||
|
getCompanyName :: CompanyId -> CompanyName
|
||||||
|
getCompanyName cid = maybe (unCompanyKey cid) companyName $ Map.lookup cid cmpMap -- use shorthand in case of impossible failure
|
||||||
nowaday = utctDay now
|
nowaday = utctDay now
|
||||||
mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday
|
mbRenewal = addGregorianDurationClip <$> qualificationRefreshWithin quali <*> Just nowaday
|
||||||
csvName = T.replace " " "-" $ CI.original (quali ^. _qualificationName)
|
csvName = T.replace " " "-" $ CI.original (quali ^. _qualificationName)
|
||||||
@ -380,15 +384,8 @@ mkQualificationTable isAdmin (Entity qid quali) acts cols psValidator = do
|
|||||||
fltrSvs = if isAdmin then const E.true else \quser -> quser E.^. QualificationUserUser `Ex.in_` E.vals svs
|
fltrSvs = if isAdmin then const E.true else \quser -> quser E.^. QualificationUserUser `Ex.in_` E.vals svs
|
||||||
dbtSQLQuery = qualificationTableQuery now qid fltrSvs
|
dbtSQLQuery = qualificationTableQuery now qid fltrSvs
|
||||||
dbtRowKey = queryUser >>> (E.^. UserId)
|
dbtRowKey = queryUser >>> (E.^. UserId)
|
||||||
dbtProj = dbtProjSimple $ \(qualUsr, usr, lmsUsr, qUsrBlock) -> do
|
dbtProj = dbtProjId
|
||||||
-- cmps <- E.select . E.from $ \(usrComp `E.InnerJoin` comp) -> do
|
dbtColonnade = cols getCompanyName
|
||||||
-- E.on $ usrComp E.^. UserCompanyCompany E.==. comp E.^. CompanyId
|
|
||||||
-- E.where_ $ usrComp E.^. UserCompanyUser E.==. E.val (entityKey usr)
|
|
||||||
-- E.orderBy [E.asc (comp E.^. CompanyName)]
|
|
||||||
-- return (comp E.^. CompanyName, comp E.^. CompanyAvsId, usrComp E.^. UserCompanySupervisor)
|
|
||||||
cmpUsr <- selectList [UserCompanyUser ==. entityKey usr] [Desc UserCompanyPriority, Asc UserCompanyCompany, LimitTo 1]
|
|
||||||
return (qualUsr, usr, lmsUsr, qUsrBlock, cmpUsr)
|
|
||||||
dbtColonnade = cols cmpMap
|
|
||||||
dbtSorting = mconcat
|
dbtSorting = mconcat
|
||||||
[ single $ sortUserNameLink queryUser
|
[ single $ sortUserNameLink queryUser
|
||||||
, single $ sortUserEmail queryUser
|
, single $ sortUserEmail queryUser
|
||||||
@ -471,8 +468,7 @@ mkQualificationTable isAdmin (Entity qid quali) acts cols psValidator = do
|
|||||||
doEncode' = QualificationTableCsv
|
doEncode' = QualificationTableCsv
|
||||||
<$> view (resultUser . _entityVal . _userDisplayName)
|
<$> view (resultUser . _entityVal . _userDisplayName)
|
||||||
<*> view (resultUser . _entityVal . _userDisplayEmail)
|
<*> view (resultUser . _entityVal . _userDisplayEmail)
|
||||||
<*> (view resultCompanyUser >>= getCompanies)
|
<*> preview (resultCompanyId . to getCompanyName . _CI)
|
||||||
<*> (view resultCompanyUser >>= getCompanyNos)
|
|
||||||
<*> view (resultQualUser . _entityVal . _qualificationUserValidUntil)
|
<*> view (resultQualUser . _entityVal . _qualificationUserValidUntil)
|
||||||
<*> view (resultQualUser . _entityVal . _qualificationUserLastRefresh)
|
<*> view (resultQualUser . _entityVal . _qualificationUserLastRefresh)
|
||||||
<*> preview (resultQualBlock. _entityVal . _qualificationUserBlockUnblock . _not)
|
<*> preview (resultQualBlock. _entityVal . _qualificationUserBlockUnblock . _not)
|
||||||
@ -480,10 +476,6 @@ mkQualificationTable isAdmin (Entity qid quali) acts cols psValidator = do
|
|||||||
<*> view (resultQualUser . _entityVal . _qualificationUserScheduleRenewal)
|
<*> view (resultQualUser . _entityVal . _qualificationUserScheduleRenewal)
|
||||||
<*> getStatusPlusTxt
|
<*> getStatusPlusTxt
|
||||||
<*> getStatusPlusDay
|
<*> getStatusPlusDay
|
||||||
getCompanies cmps = case mapMaybe (flip Map.lookup cmpMap . view (_entityVal . _userCompanyCompany)) cmps of
|
|
||||||
[] -> pure Nothing
|
|
||||||
somecmps -> pure $ Just $ intercalate ", " $ fmap (view (_companyName . _CI)) somecmps
|
|
||||||
getCompanyNos = pure . CsvSemicolonList . mapMaybe (preview (_Just . _companyAvsId) . flip Map.lookup cmpMap . view (_entityVal . _userCompanyCompany))
|
|
||||||
|
|
||||||
getStatusPlusTxt =
|
getStatusPlusTxt =
|
||||||
(join . preview (resultLmsUser . _entityVal . _lmsUserStatus)) >>= \case
|
(join . preview (resultLmsUser . _entityVal . _lmsUserStatus)) >>= \case
|
||||||
@ -585,16 +577,12 @@ postQualificationR sid qsh = do
|
|||||||
] isAdmin
|
] isAdmin
|
||||||
linkLmsUser = toMaybe isAdmin (LmsUserR sid qsh)
|
linkLmsUser = toMaybe isAdmin (LmsUserR sid qsh)
|
||||||
linkUserName = bool ForProfileR ForProfileDataR isAdmin
|
linkUserName = bool ForProfileR ForProfileDataR isAdmin
|
||||||
colChoices cmpMap = mconcat
|
colChoices getCompanyName = mconcat
|
||||||
[ dbSelect (applying _2) id (return . view (hasEntity . _entityKey))
|
[ dbSelect (applying _2) id (return . view (hasEntity . _entityKey))
|
||||||
, colUserNameModalHdr MsgLmsUser linkUserName
|
, colUserNameModalHdr MsgLmsUser linkUserName
|
||||||
, colUserEmail
|
, colUserEmail
|
||||||
, sortable (Just "user-company") (i18nCell MsgTableCompany) $ \( view resultCompanyUser -> cmps) ->
|
, sortable (Just "user-company") (i18nCell MsgTablePrimeCompany) $ \(preview resultCompanyId -> mcid) ->
|
||||||
let cs = [ companyCell (unCompanyKey cmpId) cmpName cmpSpr
|
maybeEmpty mcid $ \cid -> companyCell (unCompanyKey cid) (getCompanyName cid) False
|
||||||
| Entity _ UserCompany{userCompanyCompany=cmpId, userCompanySupervisor=cmpSpr} <- cmps
|
|
||||||
, let cmpName = maybe (unCompanyKey cmpId) companyName $ Map.lookup cmpId cmpMap
|
|
||||||
]
|
|
||||||
in intercalate spacerCell cs
|
|
||||||
, guardMonoid isAdmin $ colUserMatriclenr isAdmin
|
, guardMonoid isAdmin $ colUserMatriclenr isAdmin
|
||||||
-- , sortable (Just "validity") (i18nCell MsgQualificationValidIndicator) (qualificationValidIconCell nowaday . view resultQualUser)
|
-- , sortable (Just "validity") (i18nCell MsgQualificationValidIndicator) (qualificationValidIconCell nowaday . view resultQualUser)
|
||||||
, sortable (Just "first-held") (i18nCell MsgTableQualificationFirstHeld) $ \( view $ resultQualUser . _entityVal . _qualificationUserFirstHeld -> d) -> dayCell d
|
, sortable (Just "first-held") (i18nCell MsgTableQualificationFirstHeld) $ \( view $ resultQualUser . _entityVal . _qualificationUserFirstHeld -> d) -> dayCell d
|
||||||
|
|||||||
@ -10,7 +10,8 @@ module Handler.Utils.DateTime
|
|||||||
, toTimeOfDay
|
, toTimeOfDay
|
||||||
, toMidnight, beforeMidnight, toMidday, toMorning
|
, toMidnight, beforeMidnight, toMidday, toMorning
|
||||||
, toFullHour, roundDownToMinutes, addHours
|
, toFullHour, roundDownToMinutes, addHours
|
||||||
, formatDiffDays, formatCalendarDiffDays
|
, formatDiffDays, formatDiffHours
|
||||||
|
, formatCalendarDiffDays
|
||||||
, formatTime'
|
, formatTime'
|
||||||
, formatTime, formatTimeUser, formatTimeW, formatTimeMail
|
, formatTime, formatTimeUser, formatTimeW, formatTimeMail
|
||||||
, formatTimeRange, formatTimeRangeW, formatTimeRangeMail
|
, formatTimeRange, formatTimeRangeW, formatTimeRangeMail
|
||||||
@ -263,6 +264,9 @@ formatDiffDays t
|
|||||||
inHours = tshow $ convertBy nominalHour
|
inHours = tshow $ convertBy nominalHour
|
||||||
inMinutes = tshow $ convertBy nominalMinute
|
inMinutes = tshow $ convertBy nominalMinute
|
||||||
|
|
||||||
|
formatDiffHours :: Integral a => a -> Text
|
||||||
|
formatDiffHours = formatDiffDays . secondsToNominalDiffTime . (* 360) . fromIntegral
|
||||||
|
|
||||||
formatCalendarDiffDays :: CalendarDiffDays -> Text
|
formatCalendarDiffDays :: CalendarDiffDays -> Text
|
||||||
formatCalendarDiffDays = pack . iso8601Show
|
formatCalendarDiffDays = pack . iso8601Show
|
||||||
|
|
||||||
|
|||||||
@ -74,7 +74,7 @@ plaintextToStoredMarkup :: Textual t => t -> StoredMarkup
|
|||||||
plaintextToStoredMarkup (repack -> t) = StoredMarkup
|
plaintextToStoredMarkup (repack -> t) = StoredMarkup
|
||||||
{ markupInputFormat = MarkupPlaintext
|
{ markupInputFormat = MarkupPlaintext
|
||||||
, markupInput = t
|
, markupInput = t
|
||||||
, markupOutput = plaintextToHtml $ LT.toStrict t
|
, markupOutput = plainTextToHtml $ LT.toStrict t
|
||||||
}
|
}
|
||||||
preEscapedToStoredMarkup :: Textual t => t -> StoredMarkup
|
preEscapedToStoredMarkup :: Textual t => t -> StoredMarkup
|
||||||
preEscapedToStoredMarkup (repack -> t) = StoredMarkup
|
preEscapedToStoredMarkup (repack -> t) = StoredMarkup
|
||||||
@ -86,7 +86,7 @@ markdownToStoredMarkup :: Textual t => t -> StoredMarkup
|
|||||||
markdownToStoredMarkup (repack -> t) = StoredMarkup
|
markdownToStoredMarkup (repack -> t) = StoredMarkup
|
||||||
{ markupInputFormat = MarkupMarkdown
|
{ markupInputFormat = MarkupMarkdown
|
||||||
, markupInput = t
|
, markupInput = t
|
||||||
, markupOutput = plaintextToHtml $ LT.toStrict t
|
, markupOutput = plainTextToHtml $ LT.toStrict t
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -316,6 +316,7 @@ makeLenses_ ''AuthorshipStatementDefinition
|
|||||||
makeLenses_ ''PrintJob
|
makeLenses_ ''PrintJob
|
||||||
|
|
||||||
makeLenses_ ''InterfaceLog
|
makeLenses_ ''InterfaceLog
|
||||||
|
makeLenses_ ''InterfaceHealth
|
||||||
makeLenses_ ''AdminProblem
|
makeLenses_ ''AdminProblem
|
||||||
makeLenses_ ''ProblemLog
|
makeLenses_ ''ProblemLog
|
||||||
|
|
||||||
|
|||||||
@ -19,12 +19,17 @@ import qualified Text.Pandoc as P
|
|||||||
markdownToHtml :: Html -> Either P.PandocError Html
|
markdownToHtml :: Html -> Either P.PandocError Html
|
||||||
markdownToHtml html = P.runPure $ P.writeHtml5 htmlWriterOptions =<< P.readMarkdown markdownReaderOptions (toStrict $ renderHtml html)
|
markdownToHtml html = P.runPure $ P.writeHtml5 htmlWriterOptions =<< P.readMarkdown markdownReaderOptions (toStrict $ renderHtml html)
|
||||||
|
|
||||||
plaintextToHtml :: Text -> Html
|
plainTextToHtml :: Text -> Html
|
||||||
plaintextToHtml text = fromRight (toMarkup text) $ P.runPure $
|
plainTextToHtml text = fromRight (toMarkup text) $ P.runPure $
|
||||||
P.writeHtml5 htmlWriterOptions =<< P.readMarkdown markdownReaderOptions text
|
P.writeHtml5 htmlWriterOptions =<< P.readMarkdown markdownReaderOptions text
|
||||||
-- Line below does not work as intended, also see Handler.Utils.Pandoc.plaintextToMarkdownWith which uses this code
|
-- Line below does not work as intended, also see Handler.Utils.Pandoc.plaintextToMarkdownWith which uses this code
|
||||||
-- where pandoc = P.Pandoc mempty [P.Plain [P.Str text]]
|
-- where pandoc = P.Pandoc mempty [P.Plain [P.Str text]]
|
||||||
|
|
||||||
|
plainHtmlToHtml :: Text -> Html
|
||||||
|
plainHtmlToHtml text = fromRight (toMarkup text) $ P.runPure $
|
||||||
|
P.writeHtml5 htmlWriterOptions =<< P.readHtml markdownReaderOptions text
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
htmlReaderOptions, markdownReaderOptions :: P.ReaderOptions
|
htmlReaderOptions, markdownReaderOptions :: P.ReaderOptions
|
||||||
htmlReaderOptions = markdownReaderOptions
|
htmlReaderOptions = markdownReaderOptions
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
$newline never
|
$newline never
|
||||||
|
|
||||||
$# SPDX-FileCopyrightText: 2022 Steffen Jost <jost@tcs.ifi.lmu.de>
|
$# SPDX-FileCopyrightText: 2022-24 Steffen Jost <s.jost@fraport.de>
|
||||||
$#
|
$#
|
||||||
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
@ -62,7 +62,9 @@ $# SPDX-License-Identifier: AGPL-3.0-or-later
|
|||||||
$else
|
$else
|
||||||
_{MsgInterfacesOk}
|
_{MsgInterfacesOk}
|
||||||
^{interfaceTable}
|
^{interfaceTable}
|
||||||
|
<p>
|
||||||
|
<a href=@{ConfigInterfacesR}>
|
||||||
|
_{MsgConfigInterfacesHeading}
|
||||||
<section>
|
<section>
|
||||||
<h2>
|
<h2>
|
||||||
_{MsgProblemsHeadingMisc}
|
_{MsgProblemsHeadingMisc}
|
||||||
|
|||||||
41
templates/i18n/config-interfaces/de-de-formal.hamlet
Normal file
41
templates/i18n/config-interfaces/de-de-formal.hamlet
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
$newline never
|
||||||
|
|
||||||
|
$# SPDX-FileCopyrightText: 2024 Steffen Jost <s.jost@fraport.de>
|
||||||
|
$#
|
||||||
|
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>
|
||||||
|
_{MsgMenuInterfaces}
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Eine Schnittstelle gilt als fehlgeschlagen, wenn die letzte Transaktion dieser Schnittstelle ein konkreten Fehler lieferte,
|
||||||
|
oder wenn seit einer gewissen Anzahl an Stunden kein erneuter Erfolg für diese Schnittstelle registriert wurde.
|
||||||
|
|
||||||
|
Diese Zeitspanne beträgt normalerweise: #{defWarnTime}
|
||||||
|
|
||||||
|
Mit der nachfolgend gezeigten Tabelle kann diese Zeitspanne zwischen letztem Erfolg und dem Anzeigen eines Fehlers aufgrund
|
||||||
|
des Ausbleibens eines erneuten Erfolges für einzelne Schnittstellen geändert werden.
|
||||||
|
Einträge mit unspezifiertem _{MsgInterfaceSubtype} und/oder _{MsgInterfaceWrite} betreffen alle drauf passenden Schnittstellen,
|
||||||
|
sofern es keine anderen passenden, besser spezifizierten Einträge gibt.
|
||||||
|
|
||||||
|
Die Zeitspanne ist hier immer in Stunden anzugeben.
|
||||||
|
Eine negative Stundenzahl deaktiviert den Warnungsmechanismus für ausbleibende wiederholte Erfolge;
|
||||||
|
in diesem Fall werden für die Schnittstelle nur tatsächliche Fehlschläge als Fehler gemeldet.
|
||||||
|
<p>
|
||||||
|
^{configTable}
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>
|
||||||
|
_{MsgMenuInterfaces}
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Current interface health is shown here for reference
|
||||||
|
<p>
|
||||||
|
$if interfacesBadNr > 0
|
||||||
|
_{MsgInterfacesFail interfacesBadNr}
|
||||||
|
$else
|
||||||
|
_{MsgInterfacesOk}
|
||||||
|
^{interfaceTable}
|
||||||
|
|
||||||
|
|
||||||
36
templates/i18n/config-interfaces/en-eu.hamlet
Normal file
36
templates/i18n/config-interfaces/en-eu.hamlet
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
$newline never
|
||||||
|
|
||||||
|
$# SPDX-FileCopyrightText: 2024 Steffen Jost <s.jost@fraport.de>
|
||||||
|
$#
|
||||||
|
$# SPDX-License-Identifier: AGPL-3.0-or-later
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>
|
||||||
|
_{MsgMenuInterfaces}
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
An interface is flagged as failed, if no success had been reported within the last #{defWarnTime}
|
||||||
|
|
||||||
|
The following table allows to change the time span between the last success and before an error is raised.
|
||||||
|
A time value having _{MsgInterfaceSubtype} and/or _{MsgInterfaceWrite} left unspecified affects all matching interfeaces,
|
||||||
|
unless another more specified matching row exists for a particular interface.
|
||||||
|
|
||||||
|
The time span is configure by a number of hours.
|
||||||
|
A negative hour value disables the raising of an error by time entirely; in this case, an error is only raised if the last interface transaction reported failure.
|
||||||
|
<p>
|
||||||
|
^{configTable}
|
||||||
|
|
||||||
|
<section>
|
||||||
|
<h2>
|
||||||
|
_{MsgMenuInterfaces}
|
||||||
|
<div>
|
||||||
|
<p>
|
||||||
|
Current interface health is shown here for reference
|
||||||
|
<p>
|
||||||
|
$if interfacesBadNr > 0
|
||||||
|
_{MsgInterfacesFail interfacesBadNr}
|
||||||
|
$else
|
||||||
|
_{MsgInterfacesOk}
|
||||||
|
^{interfaceTable}
|
||||||
|
|
||||||
|
|
||||||
Reference in New Issue
Block a user