aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoe <rbo@gmx.us>2023-12-26 20:20:20 +0100
committerJoe <rbo@gmx.us>2023-12-26 20:20:20 +0100
commit900daccebbb57abcbf95e8d708444fbfcb804a86 (patch)
treefa5167cf88ca9e9bbaa9d83ffbef21ae4031149b
parentmust rewrite ui (diff)
downloadhardflip-900daccebbb57abcbf95e8d708444fbfcb804a86.tar.gz
hardflip-900daccebbb57abcbf95e8d708444fbfcb804a86.tar.bz2
hardflip-900daccebbb57abcbf95e8d708444fbfcb804a86.tar.xz
hardflip-900daccebbb57abcbf95e8d708444fbfcb804a86.tar.zst
hardflip-900daccebbb57abcbf95e8d708444fbfcb804a86.zip
cool
Diffstat (limited to '')
-rw-r--r--c_hardflip.go2
-rw-r--r--c_init.go14
-rw-r--r--c_ldirs.go1
-rw-r--r--i_ui.go4
4 files changed, 12 insertions, 9 deletions
diff --git a/c_hardflip.go b/c_hardflip.go
index 6261783..f7585b4 100644
--- a/c_hardflip.go
+++ b/c_hardflip.go
@@ -61,7 +61,7 @@ func main() {
data := HardData{
ldirs,
HardUI{},
- HardOpts{true, true},
+ HardOpts{true, true, false},
data_dir,
}
// dir := data.ldirs.head
diff --git a/c_init.go b/c_init.go
index 927f0af..65e7144 100644
--- a/c_init.go
+++ b/c_init.go
@@ -39,7 +39,7 @@
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* hardflip: src/c_init.go
- * Tue Dec 26 16:19:46 2023
+ * Tue Dec 26 16:32:26 2023
* Joe
*
* init functions
@@ -53,13 +53,14 @@ import (
)
type HardOpts struct {
- Icon bool
- Loop bool
+ Icon bool
+ Loop bool
+ FoldAll bool
}
// this function recurses into the specified root directory in order to load
// every yaml file into memory
-func c_recurse_data_dir(dir, root string, ldirs *DirsList,
+func c_recurse_data_dir(dir, root string, opts HardOpts, ldirs *DirsList,
id *uint64, name string, parent *DirsNode, depth uint16) {
files, err := os.ReadDir(root + dir)
if err != nil {
@@ -71,6 +72,7 @@ func c_recurse_data_dir(dir, root string, ldirs *DirsList,
parent,
depth,
&HostList{},
+ opts.FoldAll,
nil,
}
*id++
@@ -78,7 +80,7 @@ func c_recurse_data_dir(dir, root string, ldirs *DirsList,
for _, file := range files {
filename := file.Name()
if file.IsDir() == true {
- c_recurse_data_dir(dir + filename + "/", root, ldirs,
+ c_recurse_data_dir(dir + filename + "/", root, opts, ldirs,
id, file.Name(), &dir_node, depth + 1)
} else if filepath.Ext(filename) == ".yml" {
host := c_read_yaml_file(root + dir + filename)
@@ -97,6 +99,6 @@ func c_load_data_dir(dir string) *DirsList {
var id uint64
id = 0
- c_recurse_data_dir("", dir + "/", &ldirs, &id, "", nil, 0)
+ c_recurse_data_dir("", data.opts, dir + "/", &ldirs, &id, "", nil, 1)
return &ldirs
}
diff --git a/c_ldirs.go b/c_ldirs.go
index 096dd72..ceee953 100644
--- a/c_ldirs.go
+++ b/c_ldirs.go
@@ -53,6 +53,7 @@ type DirsNode struct {
Parent *DirsNode
Depth uint16
lhost *HostList
+ Folded bool
next *DirsNode
}
diff --git a/i_ui.go b/i_ui.go
index 1b5bcb7..e63428c 100644
--- a/i_ui.go
+++ b/i_ui.go
@@ -263,9 +263,9 @@ func i_info_panel(ui HardUI, lhost *HostList) {
return
}
host = lhost.sel(ui.sel)
- if host.Type == 0 {
+ if host.Protocol == 0 {
host_type = "SSH"
- } else if host.Type == 1 {
+ } else if host.Protocol == 1 {
host_type = "RDP"
}