aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorjoe <rbo@gmx.us>2025-09-01 11:11:47 +0200
committerjoe <rbo@gmx.us>2025-09-01 11:11:47 +0200
commitf6e349dc97fb4a3aec15fa0a674f079b04693dfe (patch)
tree8e6e398b70fcc66fba5f7a65b896b487f8eae91a /src
parentfixed bad bug (diff)
downloadhardflip-f6e349dc97fb4a3aec15fa0a674f079b04693dfe.tar.gz
hardflip-f6e349dc97fb4a3aec15fa0a674f079b04693dfe.tar.bz2
hardflip-f6e349dc97fb4a3aec15fa0a674f079b04693dfe.tar.xz
hardflip-f6e349dc97fb4a3aec15fa0a674f079b04693dfe.tar.zst
hardflip-f6e349dc97fb4a3aec15fa0a674f079b04693dfe.zip
capital update
Diffstat (limited to 'src')
-rw-r--r--src/c_defs.go4
-rw-r--r--src/c_exec.go6
-rw-r--r--src/i_insert.go50
-rw-r--r--src/i_ui.go65
4 files changed, 69 insertions, 56 deletions
diff --git a/src/c_defs.go b/src/c_defs.go
index f0eeb12..42dce0a 100644
--- a/src/c_defs.go
+++ b/src/c_defs.go
@@ -224,11 +224,11 @@ var (
"1920x1080",
"2560x1440",
}
- RDP_QUALITY = [3]string{"Low", "Medium", "High"}
+ RDP_QUALITY = [3]string{"low", "medium", "high"}
PROTOCOL_STR = [PROTOCOL_MAX + 1]string{
"SSH",
"RDP",
- "Single command",
+ "single command",
"OpenStack CLI",
}
)
diff --git a/src/c_exec.go b/src/c_exec.go
index f6d84ed..c6d08dd 100644
--- a/src/c_exec.go
+++ b/src/c_exec.go
@@ -212,7 +212,8 @@ func c_format_cmd(host *HostNode, opts HardOpts,
}
if len(gpg) > 0 && gpg != "plain" && len(host.Pass) > 0 {
if ui.s != nil {
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " GnuPG ")
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.style[HEAD_STYLE],
+ ui.dim, " GnuPG ")
text := "decryption using gpg..."
left, right := i_left_right(len(text), *ui)
i_draw_text(ui.s, left, ui.dim[H] - 3, right, ui.dim[H] - 3,
@@ -301,7 +302,8 @@ func c_exec(host *HostNode, opts HardOpts, ui *HardUI) {
}
} else if ui.s != nil {
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " Exec ")
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " exec ")
text := "running command..."
left, right := i_left_right(len(text), *ui)
i_draw_text(ui.s, left, ui.dim[H] - 3, right, ui.dim[H] - 3,
diff --git a/src/i_insert.go b/src/i_insert.go
index 5dc10ce..082710b 100644
--- a/src/i_insert.go
+++ b/src/i_insert.go
@@ -354,81 +354,81 @@ func i_draw_insert_inputs(ui HardUI, in *HostNode, home_dir string) {
}
switch ui.insert_sel {
case INS_PROTOCOL:
- i_prompt_list(ui, "Connection type", "Type:",
+ i_prompt_list(ui, "connection type", "type:",
PROTOCOL_STR[:])
case INS_SSH_HOST,
INS_SSH_JUMP_HOST,
INS_RDP_JUMP_HOST + len(in.Drive),
INS_RDP_HOST:
- i_prompt_generic(ui, "Host/IP: ", false, "")
+ i_prompt_generic(ui, "host/IP: ", false, "")
case INS_SSH_PORT,
INS_SSH_JUMP_PORT,
INS_RDP_JUMP_PORT + len(in.Drive),
INS_RDP_PORT:
- i_prompt_generic(ui, "Port: ", false, "")
+ i_prompt_generic(ui, "port: ", false, "")
case INS_SSH_USER,
INS_SSH_JUMP_USER,
INS_RDP_JUMP_USER + len(in.Drive),
INS_RDP_USER,
INS_OS_USER:
- i_prompt_generic(ui, "User: ", false, "")
+ i_prompt_generic(ui, "user: ", false, "")
case INS_SSH_PASS,
INS_SSH_JUMP_PASS,
INS_RDP_JUMP_PASS + len(in.Drive),
INS_RDP_PASS,
INS_OS_PASS:
- i_prompt_generic(ui, "Pass: ", true, "")
+ i_prompt_generic(ui, "pass: ", true, "")
case INS_SSH_PRIV,
INS_SSH_JUMP_PRIV,
INS_RDP_JUMP_PRIV + len(in.Drive):
- i_prompt_generic(ui, "Private key: ", false, home_dir)
+ i_prompt_generic(ui, "private key: ", false, home_dir)
case INS_SSH_EXEC:
- i_prompt_generic(ui, "Command: ", false, "")
+ i_prompt_generic(ui, "command: ", false, "")
case INS_SSH_NOTE,
INS_RDP_NOTE + len(in.Drive),
INS_CMD_NOTE,
INS_OS_NOTE:
- i_prompt_generic(ui, "Note: ", false, "")
+ i_prompt_generic(ui, "note: ", false, "")
case INS_RDP_DOMAIN:
- i_prompt_generic(ui, "Domain: ", false, "")
+ i_prompt_generic(ui, "domain: ", false, "")
case INS_RDP_FILE:
i_prompt_generic(ui, "RDP file: ", false, home_dir)
case INS_RDP_SCREENSIZE:
- i_prompt_list(ui, "Window size", "Size:",
+ i_prompt_list(ui, "window size", "size:",
RDP_SCREENSIZE[:])
case INS_RDP_QUALITY:
- i_prompt_list(ui, "Quality", "Quality:",
+ i_prompt_list(ui, "quality", "quality:",
RDP_QUALITY[:])
case INS_RDP_DRIVE + len(in.Drive):
if len(ui.drives_buff) == 0 {
- i_prompt_generic(ui, "Name: ", false, "")
+ i_prompt_generic(ui, "name: ", false, "")
} else {
- i_prompt_dir(ui, "Local directory: ", home_dir)
+ i_prompt_dir(ui, "local directory: ", home_dir)
}
case INS_CMD_CMD:
- i_prompt_generic(ui, "Command: ", false, "")
+ i_prompt_generic(ui, "command: ", false, "")
case INS_CMD_SHELL:
- i_prompt_generic(ui, "Shell: ", false, home_dir)
+ i_prompt_generic(ui, "shell: ", false, home_dir)
case INS_OS_HOST:
- i_prompt_generic(ui, "Endpoint: ", false, "")
+ i_prompt_generic(ui, "endpoint: ", false, "")
case INS_OS_USERDOMAINID:
- i_prompt_generic(ui, "User Domain ID: ", false, "")
+ i_prompt_generic(ui, "user domain ID: ", false, "")
case INS_OS_PROJECTID:
- i_prompt_generic(ui, "Project ID: ", false, "")
+ i_prompt_generic(ui, "project ID: ", false, "")
case INS_OS_REGION:
- i_prompt_generic(ui, "Region name: ", false, "")
+ i_prompt_generic(ui, "region name: ", false, "")
case INS_OS_ENDTYPE:
- i_prompt_generic(ui, "Endpoint type: ", false, "")
+ i_prompt_generic(ui, "endpoint type: ", false, "")
case INS_OS_INTERFACE:
- i_prompt_generic(ui, "Interface: ", false, "")
+ i_prompt_generic(ui, "interface: ", false, "")
case INS_OS_IDAPI:
- i_prompt_generic(ui, "Identity API version: ", false, "")
+ i_prompt_generic(ui, "identity API version: ", false, "")
case INS_OS_IMGAPI:
- i_prompt_generic(ui, "Image API version: ", false, "")
+ i_prompt_generic(ui, "image API version: ", false, "")
case INS_OS_NETAPI:
- i_prompt_generic(ui, "Network API version: ", false, "")
+ i_prompt_generic(ui, "network API version: ", false, "")
case INS_OS_VOLAPI:
- i_prompt_generic(ui, "Volume API version: ", false, "")
+ i_prompt_generic(ui, "volume API version: ", false, "")
}
if len(in.Drive) > 0 &&
ui.insert_sel >= INS_RDP_DRIVE &&
diff --git a/src/i_ui.go b/src/i_ui.go
index b404cd3..915631d 100644
--- a/src/i_ui.go
+++ b/src/i_ui.go
@@ -173,7 +173,7 @@ func i_draw_box(s tcell.Screen, x1, y1, x2, y2 int,
i_draw_text(s, x1 + 1, y1, x2 - 1, y1, head_style, title)
}
-func i_draw_msg(s tcell.Screen, lines int, box_style tcell.Style,
+func i_draw_msg(s tcell.Screen, lines int, box_style, head_style tcell.Style,
dim [2]int, title string) {
lines += 1
@@ -202,7 +202,7 @@ func i_draw_msg(s tcell.Screen, lines int, box_style tcell.Style,
}
}
i_draw_text(s, 1, dim[H] - 2 - lines, len(title) + 2, dim[H] - 2 - lines,
- box_style, title)
+ head_style, title)
}
func i_set_box_style(ui *HardUI) {
@@ -218,12 +218,12 @@ func i_set_box_style(ui *HardUI) {
case DELETE_MODE,
ERROR_MODE:
ui.style[BOX_STYLE] = tmp.Foreground(tcell.ColorRed).Dim(true)
- ui.style[HEAD_STYLE] = tmp.Foreground(tcell.ColorRed).Dim(true)
+ // ui.style[HEAD_STYLE] = tmp.Foreground(tcell.ColorRed).Dim(true)
case MKDIR_MODE,
INSERT_MODE,
RENAME_MODE:
ui.style[BOX_STYLE] = tmp.Foreground(tcell.ColorBlue).Dim(true)
- ui.style[HEAD_STYLE] = tmp.Foreground(tcell.ColorBlue).Dim(true)
+ // ui.style[HEAD_STYLE] = tmp.Foreground(tcell.ColorBlue).Dim(true)
}
}
@@ -349,7 +349,8 @@ func i_prompt_gpg(ui HardUI, keys [][2]string) {
if lines == 1 {
lines = 2
}
- i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.dim, " GnuPG keys ")
+ i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " GnuPG keys ")
for k, v := range keys {
text := ""
if v[0] != "plain" {
@@ -375,15 +376,17 @@ func i_prompt_gpg(ui HardUI, keys [][2]string) {
func i_prompt_confirm_gpg(ui HardUI, opts HardOpts) {
if opts.GPG == "plain" {
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " Confirm plaintext ")
- text := "Really use plaintext to store passwords?"
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " confirm plaintext ")
+ text := "really use plaintext to store passwords?"
l, r := i_left_right(len(text), ui)
i_draw_text(ui.s, l, ui.dim[H] - 3, r, ui.dim[H] - 3,
ui.style[DEF_STYLE], text)
return
}
- i_draw_msg(ui.s, 2, ui.style[BOX_STYLE], ui.dim, " Confirm GnuPG key ")
- text := "Really use this gpg key?"
+ i_draw_msg(ui.s, 2, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " confirm GnuPG key ")
+ text := "really use this gpg key?"
l, r := i_left_right(len(text), ui)
i_draw_text(ui.s, l, ui.dim[H] - 4, r, ui.dim[H] - 4,
ui.style[DEF_STYLE], text)
@@ -393,20 +396,21 @@ func i_prompt_confirm_gpg(ui HardUI, opts HardOpts) {
}
func i_prompt_def_sshkey(ui HardUI, home_dir string) {
- i_draw_msg(ui.s, 4, ui.style[BOX_STYLE], ui.dim, " Default SSH key ")
- text := "Please enter here a path for your most used SSH key"
+ i_draw_msg(ui.s, 4, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " default SSH key ")
+ text := "please enter here a path for your most used SSH key"
l, r := i_left_right(len(text), ui)
i_draw_text(ui.s, l, ui.dim[H] - 6, r, ui.dim[H] - 6,
ui.style[DEF_STYLE],text)
- text = "It will be entered by default when adding SSH hosts"
+ text = "it will be entered by default when adding SSH hosts"
l, r = i_left_right(len(text), ui)
i_draw_text(ui.s, l, ui.dim[H] - 5, r, ui.dim[H] - 5,
ui.style[DEF_STYLE],text)
- text = "This can save some time"
+ text = "this can save some time"
l, r = i_left_right(len(text), ui)
i_draw_text(ui.s, l, ui.dim[H] - 4, r, ui.dim[H] - 4,
ui.style[DEF_STYLE],text)
- text = "Leave empty if you don't want to set a default key"
+ text = "leave empty if you don't want to set a default key"
l, r = i_left_right(len(text), ui)
i_draw_text(ui.s, l, ui.dim[H] - 3, r, ui.dim[H] - 3,
ui.style[DEF_STYLE],text)
@@ -435,7 +439,8 @@ func i_prompt_mkdir(ui HardUI, curr *ItemsNode) {
func i_prompt_list(ui HardUI, name, prompt string, list []string) {
i := len(list)
- i_draw_msg(ui.s, i, ui.style[BOX_STYLE], ui.dim, " " + name + " ")
+ i_draw_msg(ui.s, i, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " " + name + " ")
for k, v := range list {
i_draw_text(ui.s, 2, ui.dim[H] - 2 - i,
ui.dim[W] - 2, ui.dim[H] - 2 - i,
@@ -518,7 +523,7 @@ func i_prompt_insert(ui HardUI, curr *ItemsNode) {
}
}
path = path[1:]
- prompt := "Name: "
+ prompt := "name: "
i_draw_text(ui.s,
1, ui.dim[H] - 1, ui.dim[W] - 1, ui.dim[H] - 1,
ui.style[DEF_STYLE], prompt)
@@ -533,17 +538,19 @@ func i_prompt_insert(ui HardUI, curr *ItemsNode) {
}
func i_draw_remove_share(ui HardUI) {
- text := "Really remove this share?"
+ text := "really remove this share?"
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " Remove share ")
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " remove share ")
left, right := i_left_right(len(text), ui)
line := ui.dim[H] - 2 - 1
i_draw_text(ui.s, left, line, right, line, ui.style[DEF_STYLE], text)
}
func i_draw_zhosts_box(ui HardUI) {
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, " No hosts ")
- text := "Hosts list empty. Add hosts/folders by pressing (a/m)"
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " no hosts ")
+ text := "hosts list empty, add hosts/folders by pressing (a/m)"
left, right := i_left_right(len(text), ui)
i_draw_text(ui.s, left, ui.dim[H] - 2 - 1, right, ui.dim[H] - 2 - 1,
ui.style[DEF_STYLE], text)
@@ -555,13 +562,14 @@ func i_draw_delete_msg(ui HardUI, item *ItemsNode) {
file = item.path()
if item.is_dir() == true {
- text = "Really delete this directory and all of its content?"
+ text = "really delete this directory and all of its content?"
} else {
- text = "Really delete this host?"
+ text = "really delete this host?"
file += item.Host.filename
}
file = file[1:]
- i_draw_msg(ui.s, 2, ui.style[BOX_STYLE], ui.dim, " Delete ")
+ i_draw_msg(ui.s, 2, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " delete ")
left, right := i_left_right(len(text), ui)
line := ui.dim[H] - 2 - 2
i_draw_text(ui.s, left, line, right, line, ui.style[DEF_STYLE], text)
@@ -574,7 +582,8 @@ func i_draw_delete_msg(ui HardUI, item *ItemsNode) {
func i_draw_insert_err_msg(ui HardUI, insert_err []error) {
lines := len(insert_err)
- i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.dim, " Errors ")
+ i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " errors ")
left, right := 1, ui.dim[W] - 1
line := ui.dim[H] - 2 - 1 - len(insert_err)
line = max(line, 0)
@@ -588,7 +597,8 @@ func i_draw_insert_err_msg(ui HardUI, insert_err []error) {
func i_draw_load_error_msg(ui HardUI, load_err []error) {
lines := len(load_err)
- i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.dim, " Load time errors ")
+ i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " load time errors ")
left, right := 1, ui.dim[W] - 1
line := ui.dim[H] - 2 - 1 - len(load_err)
line = max(line, 0)
@@ -609,7 +619,8 @@ func i_draw_error_msg(ui HardUI, load_err []error) {
if len(ui.err[ERROR_ERR]) == 0 {
lines = 1
}
- i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.dim, " Error ")
+ i_draw_msg(ui.s, lines, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim,
+ " error ")
left, right := 1, ui.dim[W] - 2
line := ui.dim[H] - 2 - 2
if len(ui.err[ERROR_ERR]) == 0 {
@@ -648,7 +659,7 @@ func i_draw_scrollhint(ui HardUI, litems *ItemsList) {
}
func i_draw_match_buff(ui HardUI) {
- i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.dim, "")
+ i_draw_msg(ui.s, 1, ui.style[BOX_STYLE], ui.style[HEAD_STYLE], ui.dim, "")
i_draw_text(ui.s, 2, ui.dim[H] - 2 - 1, ui.dim[W] - 2, ui.dim[H] - 2 - 1,
ui.style[DEF_STYLE], ui.match_buff)
}