add contact screen
This commit is contained in:
parent
6211d07ca4
commit
db28cfbcdb
33
main.go
33
main.go
@ -5,6 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"errors"
|
"errors"
|
||||||
"flag"
|
"flag"
|
||||||
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"log"
|
"log"
|
||||||
"net"
|
"net"
|
||||||
@ -201,6 +202,15 @@ func menuHandler(ctx context.Context, conn net.Conn, w *gaio.Watcher) {
|
|||||||
log.Printf("error sending screenHandler from cmd `help`: %v", err)
|
log.Printf("error sending screenHandler from cmd `help`: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case "contact":
|
||||||
|
contactStr, err := screenHandler("contact", nil)
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("err loading contact screen: %v\n", err)
|
||||||
|
}
|
||||||
|
if err := w.Write(ctx, conn, contactStr); err != nil {
|
||||||
|
log.Printf("error sending screenHandler from cmd `contact`: %v", err)
|
||||||
|
}
|
||||||
|
|
||||||
case "operator":
|
case "operator":
|
||||||
opStr, err := screenHandler("operator", nil)
|
opStr, err := screenHandler("operator", nil)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@ -444,9 +454,30 @@ func getUptime(wg *sync.WaitGroup) string {
|
|||||||
func getTubePeers(wg *sync.WaitGroup) string {
|
func getTubePeers(wg *sync.WaitGroup) string {
|
||||||
defer wg.Done()
|
defer wg.Done()
|
||||||
out, err := exec.Command("/usr/local/bin/getTubesPeers.bash").Output()
|
out, err := exec.Command("/usr/local/bin/getTubesPeers.bash").Output()
|
||||||
|
outStr := ""
|
||||||
|
// clean up the output formatting a little
|
||||||
|
for _, line := range strings.Split(string(out), "\n") {
|
||||||
|
formattedLine := ""
|
||||||
|
for j, field := range strings.Fields(line) {
|
||||||
|
switch j {
|
||||||
|
case 0:
|
||||||
|
formattedLine = field
|
||||||
|
case 1:
|
||||||
|
formattedLine += "\x1b[9G" + field
|
||||||
|
case 2:
|
||||||
|
offset := 10 - len(field) + 57
|
||||||
|
formattedLine += "\x1b[" + fmt.Sprintf("%d", offset) + "G" + field
|
||||||
|
case 3:
|
||||||
|
offset := 10 - len(field) + 74
|
||||||
|
formattedLine += "\x1b[" + fmt.Sprintf("%d", offset) + "G" + field
|
||||||
|
}
|
||||||
|
}
|
||||||
|
outStr = outStr + formattedLine + "\n"
|
||||||
|
}
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("err loading getTubePeers: %v\n", err)
|
log.Printf("err loading getTubePeers: %v\n", err)
|
||||||
return string(err.Error()) // again, might as well pass on the love to my future co-workers for debugging assistance
|
return string(err.Error()) // again, might as well pass on the love to my future co-workers for debugging assistance
|
||||||
}
|
}
|
||||||
return string(out)
|
return outStr
|
||||||
}
|
}
|
||||||
|
19
screens/contact.ans
Normal file
19
screens/contact.ans
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
[2J[H
|
||||||
|
[38;2;255;0;255m
|
||||||
|
______ __ __ _ _____ __ [38;2;224;0;224m
|
||||||
|
/ ____/___ ____ / /_____ ______/ /_(_)___ ____ _ / ___/__ ______ ____/ /___ ____ _ [38;2;192;0;192m
|
||||||
|
/ / / __ \/ __ \/ __/ __ `/ ___/ __/ / __ \/ __ `/ \__ \/ / / / __ \/ __ / __ \/ __ `/ [38;2;160;0;160m
|
||||||
|
/ /___/ /_/ / / / / /_/ /_/ / /__/ /_/ / / / / /_/ / ___/ / /_/ / / / / /_/ / /_/ / /_/ / [38;2;128;0;128m
|
||||||
|
\____/\____/_/ /_/\__/\__,_/\___/\__/_/_/ /_/\__, / /____/\__,_/_/ /_/\__,_/\____/\__, / [38;2;96;0;96m
|
||||||
|
/____/ /____/ [38;2;72;0;72m
|
||||||
|
|
||||||
|
|
||||||
|
[32m \rHey there!
|
||||||
|
|
||||||
|
The easiest way to contact me is via email to [38;2;90;255;0mdquick@versestudios.com[32m
|
||||||
|
The second easiest way is to send an SMS to [38;2;90;255;0m1-650-485-3283[32m
|
||||||
|
And if you happen to see [38;2;90;255;0msundog[32m or [38;2;90;255;0mdjsundog[32m online anywhere,
|
||||||
|
there's a good chance that that's me as well - feel free to reach out!
|
||||||
|
|
||||||
|
|
||||||
|
>
|
Loading…
Reference in New Issue
Block a user