Skip to content

Commit

Permalink
Enhance user experience
Browse files Browse the repository at this point in the history
  • Loading branch information
kerwin612 committed Jun 17, 2024
1 parent c7cfa7a commit db0d452
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
18 changes: 10 additions & 8 deletions cli/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ package main

import (
"os"
"fmt"
"log"
"flag"
"errors"
"strings"
Expand Down Expand Up @@ -49,19 +49,21 @@ func parseTarget(s string) (string, string, int, error) {
}

func main() {
source := flag.String("s", "", "Source Addr: addr:port")
target := flag.String("t", "", "Target Addr: protocol:addr:port")
source := flag.String("s", "", "Source Addr: [addr]<:port>")
target := flag.String("t", "", "Target Addr: <protocol:addr:port>")

flag.Parse()

source_addr, source_port, err := parseSource(*source)
if err != nil {
panic(err)
flag.PrintDefaults()
log.Fatal("Source Addr Error: ", err)
}

protocol, target_addr, target_port, err := parseTarget(*target)
if err != nil {
panic(err)
flag.PrintDefaults()
log.Fatal("Target Addr Error: ", err)
}

ln, err := core.Forward(core.Info{
Expand All @@ -72,15 +74,15 @@ func main() {
Protocol: protocol,
})
if err != nil {
panic(err)
log.Fatal("Forward Error: ", err)
}
fmt.Printf("Forwarded: [[%s]] ==>> [[%s]]\n", *source, *target)
log.Printf("Forwarded: [[%s]] ==>> [[%s]]\n", *source, *target)

sigs := make(chan os.Signal, 1)
signal.Notify(sigs, syscall.SIGINT, syscall.SIGTERM)

sig := <-sigs
fmt.Printf("Received signal: %s, shutting down...\n", sig)
log.Printf("Received signal: %s, shutting down...\n", sig)

ln.Close()
os.Exit(0)
Expand Down
4 changes: 2 additions & 2 deletions gui/src/components/business/Main/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,8 +302,8 @@ export default function Main() {
return (
<>
<Tooltip target={`.${cn}`} position="mouse" showDelay={300} autoHide={false} style={{maxWidth: '30vw'}}/>
<div className={cn} data-pr-tooltip={rowData.description} style={{maxWidth: '20vw', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis'}}>
{rowData.description}
<div style={{maxWidth: '20vw', overflow: 'hidden', whiteSpace: 'nowrap', textOverflow: 'ellipsis'}}>
<span className={cn} data-pr-tooltip={rowData.description}>{rowData.description}</span>
</div>
</>
);
Expand Down

0 comments on commit db0d452

Please # to comment.