Show "running command" in the log pane when running a command.

This commit is contained in:
Christian Lawson-Perfect 2025-02-12 10:51:52 +00:00
parent e595bbbea8
commit 0b982a326d

View file

@ -62,6 +62,7 @@ type Log
| MakeResult String String
| MakeError String
| CommandResult String String
| RunningCommand String
type alias CommandResult = Result String { stdout : String, stderr : String }
@ -261,7 +262,7 @@ update msg model = case msg of
SetCommand cmd -> { model | command_to_run = cmd } |> nocmd
RunCommand cmd ->
(model
({ model | log = RunningCommand cmd }
, Http.post
{ url = "run-command"
, body = Http.multipartBody
@ -649,6 +650,11 @@ log_pane model =
, H.dt [] [H.text "stderr" ]
, H.dd [] [H.pre [] [ H.text stderr ]]
]
RunningCommand cmd ->
H.div
[]
[ H.p [] [H.text "Running command ", H.code [] [H.text cmd] ]]
CommandResult stdout stderr ->
H.dl