diff options
author | Joe <rbo@gmx.us> | 2024-01-23 20:20:20 +0100 |
---|---|---|
committer | Joe <rbo@gmx.us> | 2024-01-23 20:20:20 +0100 |
commit | 559281aa9c0a649925587f65e420c530733b5a24 (patch) | |
tree | 2119267078dcea7883d299ec5c6182101595bfac /src/i_info.go | |
parent | better org (diff) | |
download | hardflip-559281aa9c0a649925587f65e420c530733b5a24.tar.gz hardflip-559281aa9c0a649925587f65e420c530733b5a24.tar.bz2 hardflip-559281aa9c0a649925587f65e420c530733b5a24.tar.xz hardflip-559281aa9c0a649925587f65e420c530733b5a24.tar.zst hardflip-559281aa9c0a649925587f65e420c530733b5a24.zip |
alright
Diffstat (limited to 'src/i_info.go')
-rw-r--r-- | src/i_info.go | 92 |
1 files changed, 46 insertions, 46 deletions
diff --git a/src/i_info.go b/src/i_info.go index 271f1d0..21bc670 100644 --- a/src/i_info.go +++ b/src/i_info.go @@ -65,28 +65,28 @@ func i_info_panel_dirs(ui HardUI, dir *DirsNode) { i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Name: ") + ui.style[TITLE_STYLE], "Name: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, dir.Name) + ui.style[DEF_STYLE], dir.Name) if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Type: ") + ui.style[TITLE_STYLE], "Type: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, "Directory") + ui.style[DEF_STYLE], "Directory") if line += 2; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Path: ") + ui.style[TITLE_STYLE], "Path: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, dir.path()) + ui.style[DEF_STYLE], dir.path()[1:]) } func i_info_panel_host(ui HardUI, host *HostNode) { @@ -98,19 +98,19 @@ func i_info_panel_host(ui HardUI, host *HostNode) { // name, type i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Name: ") + ui.style[TITLE_STYLE], "Name: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, host.Name) + ui.style[DEF_STYLE], host.Name) if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Type: ") + ui.style[TITLE_STYLE], "Type: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, host_type) + ui.style[DEF_STYLE], host_type) if line += 2; line > ui.dim[H] - 3 { return } @@ -120,19 +120,19 @@ func i_info_panel_host(ui HardUI, host *HostNode) { // host, port i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Host: ") + ui.style[TITLE_STYLE], "Host: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, host.Host) + ui.style[DEF_STYLE], host.Host) if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Port: ") + ui.style[TITLE_STYLE], "Port: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, strconv.Itoa(int(host.Port))) + ui.style[DEF_STYLE], strconv.Itoa(int(host.Port))) if line += 1; line > ui.dim[H] - 3 { return } @@ -141,10 +141,10 @@ func i_info_panel_host(ui HardUI, host *HostNode) { if len(host.Domain) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Domain: ") + ui.style[TITLE_STYLE], "Domain: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 11, line, ui.dim[W] - 2, line, - ui.def_style, host.Domain) + ui.style[DEF_STYLE], host.Domain) if line += 1; line > ui.dim[H] - 3 { return } @@ -156,20 +156,20 @@ func i_info_panel_host(ui HardUI, host *HostNode) { // user infos i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "User: ") + ui.style[TITLE_STYLE], "User: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, host.User) + ui.style[DEF_STYLE], host.User) if line += 1; line > ui.dim[H] - 3 { return } if len(host.Pass) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Pass: ") + ui.style[TITLE_STYLE], "Pass: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, "***") + ui.style[DEF_STYLE], "***") if line += 1; line > ui.dim[H] - 3 { return } @@ -177,10 +177,10 @@ func i_info_panel_host(ui HardUI, host *HostNode) { if host.Protocol == 0 && len(host.Priv) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Privkey: ") + ui.style[TITLE_STYLE], "Privkey: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 12, line, ui.dim[W] - 2, line, - ui.def_style, host.Priv) + ui.style[DEF_STYLE], host.Priv) if line += 1; line > ui.dim[H] - 3 { return } @@ -192,44 +192,44 @@ func i_info_panel_host(ui HardUI, host *HostNode) { if host.Protocol == 0 && len(host.Jump) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Jump settings: ") + ui.style[TITLE_STYLE], "Jump settings: ") if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line, - ui.title_style, "Host: ") + ui.style[TITLE_STYLE], "Host: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line, - ui.def_style, host.Jump) + ui.style[DEF_STYLE], host.Jump) if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line, - ui.title_style, "Port: ") + ui.style[TITLE_STYLE], "Port: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line, - ui.def_style, strconv.Itoa(int(host.JumpPort))) + ui.style[DEF_STYLE], strconv.Itoa(int(host.JumpPort))) if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line, - ui.title_style, "User: ") + ui.style[TITLE_STYLE], "User: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line, - ui.def_style, host.JumpUser) + ui.style[DEF_STYLE], host.JumpUser) if line += 1; line > ui.dim[H] - 3 { return } if len(host.JumpPass) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line, - ui.title_style, "Pass: ") + ui.style[TITLE_STYLE], "Pass: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 10, line, ui.dim[W] - 2, line, - ui.def_style, "***") + ui.style[DEF_STYLE], "***") if line += 1; line > ui.dim[H] - 3 { return } @@ -237,10 +237,10 @@ func i_info_panel_host(ui HardUI, host *HostNode) { if host.Protocol == 0 && len(host.JumpPriv) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 4, line, ui.dim[W] - 2, line, - ui.title_style, "Privkey: ") + ui.style[TITLE_STYLE], "Privkey: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 13, line, ui.dim[W] - 2, line, - ui.def_style, host.JumpPriv) + ui.style[DEF_STYLE], host.JumpPriv) if line += 1; line > ui.dim[H] - 3 { return } @@ -254,10 +254,10 @@ func i_info_panel_host(ui HardUI, host *HostNode) { qual := [3]string{"Low", "Medium", "High"} i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Screen size: ") + ui.style[TITLE_STYLE], "Screen size: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 16, line, ui.dim[W] - 2, line, - ui.def_style, + ui.style[DEF_STYLE], strconv.Itoa(int(host.Width)) + "x" + strconv.Itoa(int(host.Height))) if line += 1; line > ui.dim[H] - 3 { @@ -265,19 +265,19 @@ func i_info_panel_host(ui HardUI, host *HostNode) { } i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Dynamic window: ") + ui.style[TITLE_STYLE], "Dynamic window: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 19, line, ui.dim[W] - 2, line, - ui.def_style, strconv.FormatBool(host.Dynamic)) + ui.style[DEF_STYLE], strconv.FormatBool(host.Dynamic)) if line += 1; line > ui.dim[H] - 3 { return } i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Quality: ") + ui.style[TITLE_STYLE], "Quality: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 12, line, ui.dim[W] - 2, line, - ui.def_style, qual[host.Quality]) + ui.style[DEF_STYLE], qual[host.Quality]) line += 1 if line += 1; line > ui.dim[H] - 3 { return @@ -287,10 +287,10 @@ func i_info_panel_host(ui HardUI, host *HostNode) { if len(host.Note) > 0 { i_draw_text(ui.s, (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line, - ui.title_style, "Note: ") + ui.style[TITLE_STYLE], "Note: ") i_draw_text(ui.s, (ui.dim[W] / 3) + 9, line, ui.dim[W] - 2, line, - ui.def_style, host.Note) + ui.style[DEF_STYLE], host.Note) if line += 1; line > ui.dim[H] - 3 { return } @@ -300,10 +300,10 @@ func i_info_panel_host(ui HardUI, host *HostNode) { func i_draw_info_panel(ui HardUI, percent bool, litems *ItemsList) { i_draw_box(ui.s, (ui.dim[W] / 3), 0, ui.dim[W] - 1, ui.dim[H] - 2, - " Infos ", false) - ui.s.SetContent(ui.dim[W] / 3, 0, tcell.RuneTTee, nil, ui.def_style) + ui.style[BOX_STYLE], ui.style[HEAD_STYLE], " Infos ", false) + ui.s.SetContent(ui.dim[W] / 3, 0, tcell.RuneTTee, nil, ui.style[BOX_STYLE]) ui.s.SetContent(ui.dim[W] / 3, ui.dim[H] - 2, - tcell.RuneBTee, nil, ui.def_style) + tcell.RuneBTee, nil, ui.style[BOX_STYLE]) if litems == nil { return } @@ -320,7 +320,7 @@ func i_draw_info_panel(ui HardUI, percent bool, litems *ItemsList) { ui.dim[H] - 2, (ui.dim[W] - 1) - 1, ui.dim[H] - 2, - ui.def_style, + ui.style[DEF_STYLE], text) } else { text := " 0 hosts " @@ -329,7 +329,7 @@ func i_draw_info_panel(ui HardUI, percent bool, litems *ItemsList) { ui.dim[H] - 2, (ui.dim[W] - 1) - 1, ui.dim[H] - 2, - ui.def_style, + ui.style[DEF_STYLE], text) } // panel |