mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add cluster id if already set
This commit is contained in:
parent
18bf556d93
commit
44d0ac95f6
|
@ -1,7 +1,9 @@
|
||||||
package shell
|
package shell
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"github.com/chrislusf/seaweedfs/weed/pb/filer_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
"github.com/chrislusf/seaweedfs/weed/util/grace"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
|
@ -45,6 +47,24 @@ func RunShell(options ShellOptions) {
|
||||||
go commandEnv.MasterClient.KeepConnectedToMaster()
|
go commandEnv.MasterClient.KeepConnectedToMaster()
|
||||||
commandEnv.MasterClient.WaitUntilConnected()
|
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 {
|
for {
|
||||||
cmd, err := line.Prompt("> ")
|
cmd, err := line.Prompt("> ")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue