aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2024-02-20 20:20:20 +0100
committerJoe <rbo@gmx.us>2024-02-20 20:20:20 +0100
commitbb0b6a312f07680514c419b9c7c6d5b3a47a0393 (patch)
tree76add444eb2bfa17fe0781e05599f322882ded82
parenttest (diff)
downloadhardflip-bb0b6a312f07680514c419b9c7c6d5b3a47a0393.tar.gz
hardflip-bb0b6a312f07680514c419b9c7c6d5b3a47a0393.tar.bz2
hardflip-bb0b6a312f07680514c419b9c7c6d5b3a47a0393.tar.xz
hardflip-bb0b6a312f07680514c419b9c7c6d5b3a47a0393.tar.zst
hardflip-bb0b6a312f07680514c419b9c7c6d5b3a47a0393.zip
rdp_file
-rw-r--r--ROADMAP.md5
-rw-r--r--src/c_exec.go6
-rw-r--r--src/c_lhosts.go1
-rw-r--r--src/c_parse.go7
-rw-r--r--src/i_info.go12
5 files changed, 26 insertions, 5 deletions
diff --git a/ROADMAP.md b/ROADMAP.md
index 853db14..2ad28b3 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -27,8 +27,9 @@
## v0.6
- [x] ask gpg key
-- [ ] mkdir
-- [ ] .rdp file
+- [x] mkdir
+- [x] .rdp file
+- [ ] reload keep position
- [ ] add
- [ ] clone
- [ ] edit
diff --git a/src/c_exec.go b/src/c_exec.go
index ba93ec0..722df37 100644
--- a/src/c_exec.go
+++ b/src/c_exec.go
@@ -120,16 +120,20 @@ func c_format_ssh(host *HostNode, pass string) ([]string, []string) {
func c_format_rdp(host *HostNode, pass string) ([]string, []string) {
cmd_fmt := []string{"xfreerdp"}
+ if len(host.RDPFile) > 0 {
+ cmd_fmt = append(cmd_fmt, host.RDPFile)
+ } else {
cmd_fmt = append(cmd_fmt,
"/v:" + host.Host,
"/u:" + host.User)
+ }
if len(host.Domain) > 0 {
cmd_fmt = append(cmd_fmt, "/d:" + host.Domain)
}
if len(pass) > 0 {
cmd_fmt = append(cmd_fmt, "/p:" + pass)
}
- if host.Port != 0 {
+ if host.Port != 0 && len(host.RDPFile) == 0 {
cmd_fmt = append(cmd_fmt, "/port:" + strconv.Itoa(int(host.Port)))
}
if host.Dynamic == true {
diff --git a/src/c_lhosts.go b/src/c_lhosts.go
index 869b0f9..4548d4e 100644
--- a/src/c_lhosts.go
+++ b/src/c_lhosts.go
@@ -84,6 +84,7 @@ type HostNode struct {
User string `yaml:"user"`
Pass string `yaml:"pass"`
Priv string `yaml:"priv"`
+ RDPFile string `yaml:"rdp_file"`
Jump JumpSettings `yaml:"jump"`
Quality uint8 `yaml:"quality"`
Domain string `yaml:"domain"`
diff --git a/src/c_parse.go b/src/c_parse.go
index 11d1677..5375874 100644
--- a/src/c_parse.go
+++ b/src/c_parse.go
@@ -85,7 +85,12 @@ func c_read_yaml_file(file string, ui *HardUI) (*HostNode, error) {
return nil, nil
}
if len(host.Host) == 0 {
- return nil, nil
+ if len(host.RDPFile) > 0 {
+ host.Host = "rdp_file"
+ host.User = "rdp_file"
+ } else {
+ return nil, nil
+ }
}
if host.Protocol == 0 {
if host.Port == 0 {
diff --git a/src/i_info.go b/src/i_info.go
index 85929b4..14eb9b0 100644
--- a/src/i_info.go
+++ b/src/i_info.go
@@ -224,8 +224,18 @@ func i_info_rdp(ui HardUI, host *HostNode, line int) int {
i_draw_text(ui.s,
(ui.dim[W] / 3) + 11, line, ui.dim[W] - 2, line,
ui.style[STYLE_DEF], host.Domain)
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ }
+ if line += 1; line > ui.dim[H] - 3 { return line }
+ if len(host.RDPFile) > 0 {
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line,
+ ui.style[STYLE_TITLE], "RDP File: ")
+ i_draw_text(ui.s,
+ (ui.dim[W] / 3) + 13, line, ui.dim[W] - 2, line,
+ ui.style[STYLE_DEF], host.RDPFile)
+ if line += 2; line > ui.dim[H] - 3 { return line }
}
- if line += 2; line > ui.dim[H] - 3 { return line }
// user infos
i_draw_text(ui.s,
(ui.dim[W] / 3) + 3, line, ui.dim[W] - 2, line,