v0.8.0 wasm client added, cli client and makefile updated
This commit is contained in:
@ -3,8 +3,6 @@ package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
@ -37,14 +35,6 @@ func (r *Registry) registerDebugCommands() {
|
||||
Usage: "raw <method> <path> [json-body]",
|
||||
Handler: rawRequestHandler,
|
||||
})
|
||||
|
||||
r.Register(&Command{
|
||||
Name: "clear",
|
||||
ShortName: "-",
|
||||
Description: "Clear screen",
|
||||
Usage: "clear",
|
||||
Handler: clearHandler,
|
||||
})
|
||||
}
|
||||
|
||||
func healthHandler(s *session.Session, args []string) error {
|
||||
@ -54,7 +44,7 @@ func healthHandler(s *session.Session, args []string) error {
|
||||
return err
|
||||
}
|
||||
|
||||
display.Println(display.Cyan, "%sServer Health:%s")
|
||||
display.Println(display.Cyan, "Server Health:")
|
||||
fmt.Printf(" Status: %s\n", resp.Status)
|
||||
// Convert Unix timestamp to readable time
|
||||
t := time.Unix(resp.Time, 0)
|
||||
@ -100,10 +90,4 @@ func rawRequestHandler(s *session.Session, args []string) error {
|
||||
|
||||
c := s.GetClient().(*api.Client)
|
||||
return c.RawRequest(method, path, body)
|
||||
}
|
||||
|
||||
func clearHandler(s *session.Session, args []string) error {
|
||||
cmd := exec.Command("clear")
|
||||
cmd.Stdout = os.Stdout
|
||||
return cmd.Run()
|
||||
}
|
||||
@ -1,4 +1,4 @@
|
||||
// FILE: internal/client/command/auth_unix.go
|
||||
// FILE: lixenwraith/chess/internal/client/command/pass_native.go
|
||||
//go:build !js && !wasm
|
||||
|
||||
package command
|
||||
@ -1,4 +1,4 @@
|
||||
// FILE: lixenwraith/chess/internal/client/command/auth_wasm.go
|
||||
// FILE: lixenwraith/chess/internal/client/command/pass_wasm.go
|
||||
//go:build js && wasm
|
||||
|
||||
package command
|
||||
|
||||
@ -141,7 +141,6 @@ func (r *Registry) helpHandler(s *session.Session, args []string) error {
|
||||
{"health", ".", ""},
|
||||
{"url", "/", ""},
|
||||
{"raw", ":", ""},
|
||||
{"clear", "-", ""},
|
||||
{"help", "?", ""},
|
||||
{"exit", "x", ""},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user