Skip to content

Commit

Permalink
Deploy related changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dfordivam committed Jun 25, 2018
1 parent b66736d commit 2c20acf
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion android/src/LoginWidget.hs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ showLogin incorrectEv = elClass "section" "hero is-fullheight" $ do
return (ev, toggleEv)

checkLogin lEv = do
let url s = "http://192.168.2.60:3000/websocket/app/" <> s
-- let url s = "http://192.168.2.60:3000/websocket/app/" <> s
let url s = "https://tenjinreader.com/websocket/app/" <> s
r <- getAndDecode (url <$> lEv)
let incorrectEv = fforMaybe r (\case
(Just True) -> Nothing
Expand Down
3 changes: 2 additions & 1 deletion android/src/TopWidget.hs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ afterLoginWidget :: MonadWidget t m
=> Text
-> m (Event t (Maybe Text), Event t ())
afterLoginWidget secret = do
let url = "ws://192.168.2.60:3000/websocket/app/" <> secret
-- let url = "ws://192.168.2.60:3000/websocket/app/" <> secret
let url = "wss://tenjinreader.com/websocket/app/" <> secret
((ev,d),wsConn) <- withWSConnection
url
never -- close event
Expand Down
2 changes: 1 addition & 1 deletion deploy/deploy.hs
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ doDeploy bePath deployDir = do
beHash = getHashFromPath bePath
targetDir = destHost <> ":~/" <> beHash

run_ "nix-copy-closure" ["--sign", "--include-outputs", destHost, toTextArg bePath]
run_ "rsync" ["-az", toTextArg deployDir, targetDir]
run_ "nix-copy-closure" ["--include-outputs", destHost, toTextArg bePath]

closureCompiler :: FilePath
closureCompiler = "/nix/store/n7h36mmdgd9y5g59qasznjvsl3psg0g2-closure-compiler-20170218/bin/closure-compiler"
Expand Down
10 changes: 5 additions & 5 deletions frontend/frontend.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ executable frontend
, vector
, array
, hs-nlp-jp-utils
, ghcjs-dom
-- Fix this
if impl(ghcjs)
build-depends: ghcjs-base
, ghcjs-dom-jsffi
else
build-depends: jsaddle-dom
, ghcjs-dom

if flag(debug)
CPP-options: "-DDEBUG"
Expand Down Expand Up @@ -122,13 +122,13 @@ executable frontend-recog
, vector
, array
, hs-nlp-jp-utils
, ghcjs-dom
-- Fix this
if impl(ghcjs)
build-depends: ghcjs-base
, ghcjs-dom-jsffi
else
build-depends: jsaddle-dom
, ghcjs-dom

if flag(debug)
CPP-options: "-DDEBUG"
Expand Down Expand Up @@ -163,13 +163,13 @@ executable frontend-reader-only
, vector
, array
, hs-nlp-jp-utils
, ghcjs-dom

if impl(ghcjs)
build-depends: ghcjs-base
, ghcjs-dom-jsffi
else
build-depends: jsaddle-dom
, ghcjs-dom

if flag(debug)
CPP-options: "-DDEBUG"
Expand Down Expand Up @@ -204,13 +204,13 @@ executable frontend-srs-only
, vector
, array
, hs-nlp-jp-utils
, ghcjs-dom

if impl(ghcjs)
build-depends: ghcjs-base
, ghcjs-dom-jsffi
else
build-depends: jsaddle-dom
, ghcjs-dom

if flag(debug)
CPP-options: "-DDEBUG"
Expand Down Expand Up @@ -248,13 +248,13 @@ executable frontend-srs-only-recog
, vector
, array
, hs-nlp-jp-utils
, ghcjs-dom

if impl(ghcjs)
build-depends: ghcjs-base
, ghcjs-dom-jsffi
else
build-depends: jsaddle-dom
, ghcjs-dom

if flag(debug)
CPP-options: "-DDEBUG"
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

module Main where

import Language.Javascript.JSaddle.Warp
import Reflex.Dom.Core (mainWidget, mainWidgetWithCss)
-- import Language.Javascript.JSaddle.Warp
-- import Reflex.Dom.Core (mainWidget, mainWidgetWithCss)
-- import Reflex.Dom hiding (mainWidget, run)
-- import Reflex.Dom
import Reflex.Dom
-- import Data.FileEmbed
import TopWidget
import Protolude
Expand All @@ -15,7 +15,7 @@ import Protolude
main :: IO ()
main =
-- mainWidget $ topWidget
run 3911 $
-- run 3911 $
mainWidgetWithCss
-- ($(embedFile "src/bootstrap.css") <> $(embedFile "src/custom.css"))
-- ($(embedFile "src/slate_bootstrap.min.css") <> $(embedFile "src/custom.css"))
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/SpeechRecog.hs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ import qualified Data.Text as T
import Data.JSString.Text

#if defined (ENABLE_SPEECH_RECOG)
import GHCJS.DOM.SpeechRecognition
import GHCJS.DOM.SpeechRecognitionEvent
import GHCJS.DOM.SpeechGrammar
import GHCJS.DOM.JSFFI.SpeechRecognition
import GHCJS.DOM.JSFFI.SpeechRecognitionEvent
import GHCJS.DOM.JSFFI.SpeechGrammar
import GHCJS.DOM.EventM
import Language.Javascript.JSaddle.Object
import Language.Javascript.JSaddle.Types
Expand Down Expand Up @@ -60,7 +60,7 @@ speechRecogSetup = do
GHCJS.DOM.EventM.on recog nomatch (liftIO $ timeoutAction ())
GHCJS.DOM.EventM.on recog audioend (liftIO $ timeoutAction ())
GHCJS.DOM.EventM.on recog soundend (liftIO $ timeoutAction ())
GHCJS.DOM.EventM.on recog GHCJS.DOM.SpeechRecognition.error (liftIO $ errorAction ())
GHCJS.DOM.EventM.on recog GHCJS.DOM.JSFFI.SpeechRecognition.error (liftIO $ errorAction ())
return recog

return (\stop e -> do
Expand Down

0 comments on commit 2c20acf

Please sign in to comment.