diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index cc700c3..7d62525 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,6 +2,11 @@ name: test on: push: + paths-ignore: + - 'LICENSE' + - 'README.*' + - '*/README.*' + - 'docs/*' release: types: [published] diff --git a/websh_front/src/index.nim b/websh_front/src/index.nim index c71e05f..b214d57 100644 --- a/websh_front/src/index.nim +++ b/websh_front/src/index.nim @@ -13,6 +13,7 @@ type stdout: cstring stderr: cstring images: seq[ImageObj] + elapsed_time: cstring ImageObj = object image: cstring filesize: cint @@ -39,6 +40,7 @@ var outputStdout = cstring"" outputStderr = cstring"" outputImages: seq[ImageObj] + outputElapsedTime = cstring"0milsec" isProgress: bool ## シェルの実行中表示を切り替えるためのフラグ @@ -49,6 +51,7 @@ proc respCb(httpStatus: int, response: cstring) = outputStdout = resp.stdout outputStderr = resp.stderr outputImages = resp.images + outputElapsedTime = resp.elapsed_time # シェルの実行中表示 OFF isProgress = false @@ -102,9 +105,9 @@ proc createDom(): VNode = if isProgress: text "Running ..." elif outputStatus != statusOk: - text outputSystemMessage + text &"{outputSystemMessage} ({outputElapsedTime})" else: - text "none" + text &"none ({outputElapsedTime})" # 入力、出力スペース tdiv(class = "columns is-desktop"): diff --git a/websh_server/src/websh_server.nim b/websh_server/src/websh_server.nim index 7a23c1c..1ed8f58 100644 --- a/websh_server/src/websh_server.nim +++ b/websh_server/src/websh_server.nim @@ -80,8 +80,8 @@ proc runCommand(command: string, args: openArray[string], timeout: int = 3): (st router myrouter: post "/shellgei": + let now = now() try: - let now = now() let uuid = $genUUID() var respJson = request.body().parseJson().to(ReqShellgeiJSON) info "uuid", uuid, "json", respJson @@ -163,11 +163,12 @@ router myrouter: let elapsedTime = $(now() - now).inMilliseconds & "milsec" info "uuid", uuid, "elapsedTime", elapsedTime, "msg", "complete" - resp %*{"status":status, "system_message":systemMsg, "stdout":stdoutStr, "stderr":stderrStr, "images":images} + resp %*{"status":status, "system_message":systemMsg, "stdout":stdoutStr, "stderr":stderrStr, "images":images, "elapsed_time":elapsedTime} except: let msg = getCurrentExceptionMsg() error "msg", msg - resp %*{"status":statusSystemError, "system_message":"System error occured.", "stdout":"", "stderr":"", "images":[]} + let elapsedTime = $(now() - now).inMilliseconds & "milsec" + resp %*{"status":statusSystemError, "system_message":"System error occured.", "stdout":"", "stderr":"", "images":[], "elapsed_time":elapsedTime} get "/ping": resp %*{"status":"ok"}