diff options
author | Péter Szilágyi <peterke@gmail.com> | 2017-10-23 17:24:25 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2017-11-21 21:09:36 +0800 |
commit | 6eb38e02a8e3bd39ba155df0b40560e384e2c6f4 (patch) | |
tree | b52a604e47af88a63a40ce1b55ebd9474eccf6b5 /cmd/puppeth/wizard_dashboard.go | |
parent | 51a86f61be52fdd16a409fc93cf89a2226129697 (diff) | |
download | go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.tar go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.tar.gz go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.tar.bz2 go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.tar.lz go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.tar.xz go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.tar.zst go-tangerine-6eb38e02a8e3bd39ba155df0b40560e384e2c6f4.zip |
cmd/puppeth: fix dashboard iframes, extend with new services
Diffstat (limited to 'cmd/puppeth/wizard_dashboard.go')
-rw-r--r-- | cmd/puppeth/wizard_dashboard.go | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/cmd/puppeth/wizard_dashboard.go b/cmd/puppeth/wizard_dashboard.go index b59489b03..10aa6ee05 100644 --- a/cmd/puppeth/wizard_dashboard.go +++ b/cmd/puppeth/wizard_dashboard.go @@ -58,7 +58,6 @@ func (w *wizard) deployDashboard() { available[service] = append(available[service], server) } } - listing := make(map[string]string) for _, service := range []string{"ethstats", "explorer", "wallet", "faucet"} { // Gather all the locally hosted pages of this type var pages []string @@ -74,6 +73,14 @@ func (w *wizard) deployDashboard() { if infos, err := checkEthstats(client, w.network); err == nil { port = infos.port } + case "explorer": + if infos, err := checkExplorer(client, w.network); err == nil { + port = infos.webPort + } + case "wallet": + if infos, err := checkWallet(client, w.network); err == nil { + port = infos.webPort + } case "faucet": if infos, err := checkFaucet(client, w.network); err == nil { port = infos.port @@ -101,30 +108,41 @@ func (w *wizard) deployDashboard() { log.Error("Invalid listing choice, aborting") return } + var page string switch { case choice <= len(pages): - listing[service] = pages[choice-1] + page = pages[choice-1] case choice == len(pages)+1: fmt.Println() fmt.Printf("Which address is the external %s service at?\n", service) - listing[service] = w.readString() + page = w.readString() default: // No service hosting for this } + // Save the users choice + switch service { + case "ethstats": + infos.ethstats = page + case "explorer": + infos.explorer = page + case "wallet": + infos.wallet = page + case "faucet": + infos.faucet = page + } } // If we have ethstats running, ask whether to make the secret public or not - var ethstats bool if w.conf.ethstats != "" { fmt.Println() fmt.Println("Include ethstats secret on dashboard (y/n)? (default = yes)") - ethstats = w.readDefaultString("y") == "y" + infos.trusted = w.readDefaultString("y") == "y" } // Try to deploy the dashboard container on the host fmt.Println() fmt.Printf("Should the dashboard be built from scratch (y/n)? (default = no)\n") nocache := w.readDefaultString("n") != "n" - if out, err := deployDashboard(client, w.network, infos.port, infos.host, listing, &w.conf, ethstats, nocache); err != nil { + if out, err := deployDashboard(client, w.network, &w.conf, infos, nocache); err != nil { log.Error("Failed to deploy dashboard container", "err", err) if len(out) > 0 { fmt.Printf("%s\n", out) |