diff options
author | Joe <rbo@gmx.us> | 2024-03-14 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-03-14 20:20:20 +0100 |
commit | 493ab5462dad55d525fd623b534769651b550afe (patch) | |
tree | 2509e82821f14c290d487a57cdbe0b9c34dd3904 | |
parent | nice (diff) | |
download | hardflip-493ab5462dad55d525fd623b534769651b550afe.tar.gz hardflip-493ab5462dad55d525fd623b534769651b550afe.tar.bz2 hardflip-493ab5462dad55d525fd623b534769651b550afe.tar.xz hardflip-493ab5462dad55d525fd623b534769651b550afe.tar.zst hardflip-493ab5462dad55d525fd623b534769651b550afe.zip |
port
-rw-r--r-- | src/i_events.go | 10 | ||||
-rw-r--r-- | src/i_insert.go | 7 | ||||
-rw-r--r-- | src/i_ui.go | 4 |
3 files changed, 14 insertions, 7 deletions
diff --git a/src/i_events.go b/src/i_events.go index 39db96a..48c3471 100644 --- a/src/i_events.go +++ b/src/i_events.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_events.go - * Tue Feb 27 18:07:11 2024 + * Thu Mar 14 10:38:55 2024 * Joe * * events in the code @@ -321,7 +321,8 @@ func i_set_protocol_defaults(data *HardData, in *HostNode) { switch in.Protocol { case 0: in.Port = 22 - data.ui.insert_sel_max = 6 + in.Jump.Port = 22 + data.ui.insert_sel_max = 7 case 1: in.Port = 3389 in.Quality = 2 @@ -604,7 +605,7 @@ func i_events(data *HardData) { ui.s.HideCursor() i_set_protocol_defaults(data, data.insert) } - case 1, 2, 3, 4, 5, 6: + case 1, 2, 3, 4, 5, 6, 7: if event.Key() == tcell.KeyEnter { switch data.ui.insert_sel { case 1: data.insert.Host = ui.buff @@ -618,6 +619,9 @@ func i_events(data *HardData) { data.insert.Pass = pass case 5: data.insert.Priv = ui.buff case 6: data.insert.Jump.Host = ui.buff + case 7: + tmp, _ := strconv.Atoi(ui.buff) + data.insert.Jump.Port = uint16(tmp) } data.ui.insert_sel_ok = false ui.buff = "" diff --git a/src/i_insert.go b/src/i_insert.go index 7d5a6ed..a0f629f 100644 --- a/src/i_insert.go +++ b/src/i_insert.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_insert.go - * Fri Mar 01 15:35:55 2024 + * Thu Mar 14 10:18:40 2024 * Joe * * insert a new host @@ -123,7 +123,7 @@ func i_draw_insert_ssh(ui HardUI, line int, win Quad, in *HostNode) { false) if line += 1; win.T + line >= win.B { return } i_draw_text_box(ui, win.T + line, win, "Port", strconv.Itoa(int(in.Port)), - 2, ui.insert_sel, false) + 2, ui.insert_sel, false); if line += 2; win.T + line >= win.B { return } i_draw_text_box(ui, win.T + line, win, "User", in.User, 3, ui.insert_sel, false) @@ -157,5 +157,8 @@ func i_draw_insert_ssh(ui HardUI, line int, win Quad, in *HostNode) { if line += 2; win.T + line >= win.B { return } i_draw_text_box(ui, win.T + line, win, "Host/IP", in.Jump.Host, 6, ui.insert_sel, false) + if line += 1; win.T + line >= win.B { return } + i_draw_text_box(ui, win.T + line, win, "Port", + strconv.Itoa(int(in.Jump.Port)), 7, ui.insert_sel, false) // TODO: here } diff --git a/src/i_ui.go b/src/i_ui.go index 1bb927d..97ca3d5 100644 --- a/src/i_ui.go +++ b/src/i_ui.go @@ -43,7 +43,7 @@ * POSSIBILITY OF SUCH DAMAGE. * * hardflip: src/i_ui.go - * Fri Mar 01 15:27:17 2024 + * Thu Mar 14 10:39:01 2024 * Joe * * interfacing with the user @@ -663,7 +663,7 @@ func i_ui(data_dir string) { i_prompt_type(data.ui) case 1, 6: i_prompt_generic(data.ui, "Host/IP: ", false, "") - case 2: + case 2, 7: i_prompt_generic(data.ui, "Port: ", false, "") case 3: i_prompt_generic(data.ui, "User: ", false, "") |