webapp: Now has a page to view the log, accessed from the control menu.

This commit is contained in:
Joey Hess 2013-01-15 13:52:35 -04:00
parent d7ca6fb856
commit e15cca7db8
6 changed files with 31 additions and 2 deletions

View file

@ -11,6 +11,7 @@ module Assistant.WebApp.Control where
import Assistant.WebApp.Common
import Locations.UserConfig
import Utility.LogFile
import Control.Concurrent
import System.Posix (getProcessID, signalProcess, sigTERM)
@ -40,3 +41,10 @@ getRestartR = page "Restarting" Nothing $ do
where
restartcommand program = program ++ " assistant --stop; " ++
program ++ " webapp"
getLogR :: Handler RepHtml
getLogR = page "Logs" Nothing $ do
logfile <- lift $ runAnnex undefined $ fromRepo gitAnnexLogFile
logs <- liftIO $ listLogs logfile
logcontent <- liftIO $ concat <$> mapM readFile logs
$(widgetFile "control/log")