add a "Push" button
This commit is contained in:
parent
cf50e05c16
commit
d836b98a70
2 changed files with 32 additions and 6 deletions
11
dist/think-editor.css
vendored
11
dist/think-editor.css
vendored
|
@ -174,6 +174,17 @@ input {
|
|||
align-items: start;
|
||||
}
|
||||
|
||||
& #jj-buttons {
|
||||
display: flex;
|
||||
justify-content: end;
|
||||
gap: var(--spacing);
|
||||
margin: 0;
|
||||
|
||||
& #start-commit-button {
|
||||
width: 10em;
|
||||
}
|
||||
}
|
||||
|
||||
& #make-log {
|
||||
& > pre {
|
||||
max-width: 20em;
|
||||
|
|
27
src/App.elm
27
src/App.elm
|
@ -134,6 +134,7 @@ type Msg
|
|||
| SetCommitMessage String
|
||||
| JJCommit
|
||||
| JJCommitResponse (Result Http.Error CommandResult)
|
||||
| JJPush
|
||||
|
||||
init : JE.Value -> (Model, Cmd Msg)
|
||||
init flags = (load_flags flags, reload_log)
|
||||
|
@ -301,6 +302,11 @@ update msg model = case msg of
|
|||
Ok (Ok res) -> { model | log = MakeResult res.stdout res.stderr } |> nocmd
|
||||
Ok (Err errmsg) -> { model | log = MakeError errmsg } |> nocmd
|
||||
Err err -> { model | log = HttpError err } |> nocmd
|
||||
|
||||
JJPush ->
|
||||
update
|
||||
(RunCommand "jj bookmark set main -r @- && jj git push -b main --allow-new")
|
||||
model
|
||||
|
||||
NoOp -> (model, Cmd.none)
|
||||
|
||||
|
@ -493,12 +499,21 @@ main_nav model =
|
|||
]
|
||||
else
|
||||
H.text ""
|
||||
, H.button
|
||||
[ HA.id "start-commit-button"
|
||||
, HA.type_ "button"
|
||||
, HE.onClick ShowCommitModal
|
||||
]
|
||||
[ H.text "Commit" ]
|
||||
, H.p
|
||||
[ HA.id "jj-buttons" ]
|
||||
[ H.button
|
||||
[ HA.id "start-commit-button"
|
||||
, HA.type_ "button"
|
||||
, HE.onClick ShowCommitModal
|
||||
]
|
||||
[ H.text "Commit" ]
|
||||
, H.button
|
||||
[ HA.id "jj-push-button"
|
||||
, HA.type_ "button"
|
||||
, HE.onClick JJPush
|
||||
]
|
||||
[ H.text "Push" ]
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
|
Loading…
Reference in a new issue