Skip to content

Commit

Permalink
Merge pull request #52 from jiro4989/hotfix/#51-enter
Browse files Browse the repository at this point in the history
Ctrl enterで実行するように修正 #51
  • Loading branch information
jiro4989 authored Dec 21, 2019
2 parents 941d4e7 + 0777de7 commit a2a4b45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion websh_front/src/index.nim
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,9 @@ proc createDom(): VNode =
tdiv(class = "input-field col s12 m6"):
textarea(id = "inputShell", class = &"materialize-textarea {textInputColor}", setFocus = true):
proc onkeydown(ev: Event, n: VNode) =
if cast[KeyboardEvent](ev).keyCode == 13:
let kbEvt = cast[KeyboardEvent](ev)
# Ctrl + Enterで実行
if kbEvt.ctrlKey and kbEvt.keyCode == 13:
sendShellButtonOnClick(ev, n)
proc onkeyup(ev: Event, n: VNode) =
inputShell = $n.value
Expand Down
2 changes: 1 addition & 1 deletion websh_server/src/websh_server.nim
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ proc runCommand(command: string, args: openArray[string], timeout: int = 3): (st
sleep sleepInterval
elapsedTime += sleepInterval
if timeoutMilSec < elapsedTime:
let msg = &"Over timeout: {timeout} second"
let msg = &"timeout: {timeout} second"
info msg
return ("", "", statusTimeout, msg)
block:
Expand Down

0 comments on commit a2a4b45

Please sign in to comment.