aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-08-29 22:19:46 -0700
committerChris Lu <chris.lu@gmail.com>2021-08-29 22:19:46 -0700
commit44d0ac95f6a068203edc4568660a720c6f5cdf8b (patch)
tree42d0d55bf4fb27cecf340365e81b46352a2683a5
parent18bf556d939555e8b8326239d38f0c9f076b9569 (diff)
downloadseaweedfs-44d0ac95f6a068203edc4568660a720c6f5cdf8b.tar.xz
seaweedfs-44d0ac95f6a068203edc4568660a720c6f5cdf8b.zip
add cluster id if already set
-rw-r--r--weed/shell/shell_liner.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/weed/shell/shell_liner.go b/weed/shell/shell_liner.go
index 765b0efda..64c8094fe 100644
--- a/weed/shell/shell_liner.go
+++ b/weed/shell/shell_liner.go
@@ -1,7 +1,9 @@
package shell
import (
+ "context"
"fmt"
+ "github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
"github.com/chrislusf/seaweedfs/weed/util/grace"
"io"
"os"
@@ -45,6 +47,24 @@ func RunShell(options ShellOptions) {
go commandEnv.MasterClient.KeepConnectedToMaster()
commandEnv.MasterClient.WaitUntilConnected()
+ if commandEnv.option.FilerAddress != "" {
+ commandEnv.WithFilerClient(func(filerClient filer_pb.SeaweedFilerClient) error {
+ resp, err := filerClient.GetFilerConfiguration(context.Background(), &filer_pb.GetFilerConfigurationRequest{})
+ if err != nil {
+ return err
+ }
+ if resp.ClusterId != "" {
+ fmt.Printf(`
+---
+Free Monitoring Data URL:
+https://cloud.seaweedfs.com/ui/%s
+---
+`, resp.ClusterId)
+ }
+ return nil
+ })
+ }
+
for {
cmd, err := line.Prompt("> ")
if err != nil {