[REV] update display region info

This commit is contained in:
ysicing 2019-05-06 14:05:10 +08:00
parent dfda2b8e03
commit d51ce97ef0
2 changed files with 29 additions and 16 deletions

View File

@ -135,6 +135,11 @@ func NewCmdInit() cli.Command {
Usage: "Global Config Path, default",
Value: "/opt/rainbond/rainbond-ansible/scripts/installer/global.sh",
},
cli.StringFlag{
Name: "token",
Usage: "Region Token",
Value: "",
},
cli.StringFlag{
Name: "enable-exdb",
Usage: "default disable external database",
@ -295,7 +300,7 @@ func getConfig(c *cli.Context) map[string]string {
configs["EIP"] = c.String("eip")
configs["VIP"] = c.String("vip")
configs["VERSION"] = c.String("rainbond-version")
// configs["rainbond-repo"] = c.String("rainbond-repo")
configs["INSTALL_TOKEN"] = c.String("token")
configs["INSTALL_TYPE"] = c.String("install-type")
configs["DEPLOY_TYPE"] = c.String("deploy-type")
configs["DOMAIN"] = c.String("domain")

View File

@ -59,30 +59,38 @@ func showSuccessMsg(m string) {
func NewCmdShow() cli.Command {
c := cli.Command{
Name: "show",
Usage: "Display region api address after installation",
Usage: "Display region info",
Action: func(c *cli.Context) error {
Common(c)
manageHosts, err := clients.RegionClient.Nodes().GetNodeByRule("manage")
handleErr(err)
ips := getExternalIP("/opt/rainbond/envs/.exip", manageHosts)
fmt.Println("Manage your apps with webui")
ips := getExternalIP("/opt/rainbond/.init/.ip", manageHosts)
fmt.Println("Manage your apps with webui:\n-------------------------------")
for _, v := range ips {
url := v + ":7070"
fmt.Print(url + " ")
}
fmt.Println()
fmt.Println("The webui use websocket to provide more feture")
for _, v := range ips {
url := v + ":6060"
fmt.Print(url + " ")
fmt.Println("\n")
//fmt.Println("The webui use websocket to provide more feture")
//for _, v := range ips {
// url := v + ":6060"
// fmt.Print(url + " ")
//}
//fmt.Println()
//fmt.Println("Your web apps use nginx for reverse proxy:")
//for _, v := range ips {
// url := v + ":80"
// fmt.Print(url + " ")
//}
//fmt.Println()
if fileExist("/opt/rainbond/.init/.regioninfo") {
regionInfo, err := ioutil.ReadFile("/opt/rainbond/.init/.regioninfo")
if err != nil {
return nil
}
fmt.Println("Current data center information:\n-------------------------------")
fmt.Println(string(regionInfo))
}
fmt.Println()
fmt.Println("Your web apps use nginx for reverse proxy:")
for _, v := range ips {
url := v + ":80"
fmt.Print(url + " ")
}
fmt.Println()
return nil
},
}