From 76c744963a3e7cbfc2f7d3aa8a3321c3eb200aa2 Mon Sep 17 00:00:00 2001 From: Igor Pashev Date: Sat, 20 May 2017 21:47:51 +0300 Subject: Rename index.html -> app.html Not to confuse Hackage. --- app.html | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ index.html | 60 ------------------------------------------------------ mywatch.cabal | 3 ++- src/Application.hs | 3 ++- 4 files changed, 64 insertions(+), 62 deletions(-) create mode 100644 app.html delete mode 100644 index.html diff --git a/app.html b/app.html new file mode 100644 index 0000000..6a75cf4 --- /dev/null +++ b/app.html @@ -0,0 +1,60 @@ + + + + + + + + + + + MyWatch + + + + + +
+

Loading, please wait...

+
+
+ + + + + + + + + + diff --git a/index.html b/index.html deleted file mode 100644 index 6a75cf4..0000000 --- a/index.html +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - - - - - - MyWatch - - - - - -
-

Loading, please wait...

-
-
- - - - - - - - - - diff --git a/mywatch.cabal b/mywatch.cabal index ee3813b..3c4118e 100644 --- a/mywatch.cabal +++ b/mywatch.cabal @@ -14,7 +14,7 @@ build-type: Simple extra-source-files: README.md ChangeLog.md cabal-version: >= 1.20 data-files: - index.html + app.html static/external/bootstrap/css/*.min.css static/external/bootstrap/js/*.min.js static/external/jquery-2.2.4.min.js @@ -45,6 +45,7 @@ executable mywatch , data-default-class , docopt >= 0.7 , fast-logger + , filepath , http-types >= 0.9 , interpolatedstring-perl6 >= 1.0 , MissingH diff --git a/src/Application.hs b/src/Application.hs index bdedd5e..3c57079 100644 --- a/src/Application.hs +++ b/src/Application.hs @@ -24,6 +24,7 @@ import Network.Wai.Middleware.RequestLogger (Destination(Handle), mkRequestLogger, RequestLoggerSettings(destination, outputFormat), OutputFormat(CustomOutputFormat)) import Network.Wai.Middleware.Static (addBase, hasPrefix, staticPolicy, (>->)) +import System.FilePath.Posix (()) import System.IO (stderr) import Web.Scotty (ScottyM, ActionM, middleware, json, file, addroute, get, delete, status, text, param, scottyApp) @@ -47,7 +48,7 @@ myProcess ps logger dataDir = do middleware $ Gzip.gzip Gzip.def {Gzip.gzipFiles = Gzip.GzipCompress} middleware $ staticPolicy (hasPrefix "static" >-> addBase dataDir) - get "/" $ file (dataDir ++ "/" ++ "index.html") + get "/" $ file (dataDir "app.html") get "/serverlist.json" $ json (sort $ HM.keys ps) get "/server/:server/processlist.json" $ apiGetProcessList ps -- cgit v1.2.3