diff --git a/dashboard/assets.go b/dashboard/assets.go index b2a173107b..dd7450e338 100644 --- a/dashboard/assets.go +++ b/dashboard/assets.go @@ -26828,7 +26828,7 @@ var _bundleJs = []byte((((((((((`!function(modules) { }), updated; }, shouldUpdate = function shouldUpdate(msg, updater) { var su = {}; - return Object.keys(msg).forEach(function(key) { + return console.log(msg), Object.keys(msg).forEach(function(key) { su[key] = "function" == typeof updater[key] || shouldUpdate(msg[key], updater[key]); }), su; }, appender = function(limit) { @@ -26840,7 +26840,7 @@ var _bundleJs = []byte((((((((((`!function(modules) { }, defaultContent = { general: { version: "-", - gitCommit: "-" + commit: "-" }, home: { memory: [], @@ -26856,7 +26856,7 @@ var _bundleJs = []byte((((((((((`!function(modules) { }, updaters = { general: { version: replacer, - gitCommit: replacer + commit: replacer }, home: { memory: appender(200), @@ -26895,7 +26895,7 @@ var _bundleJs = []byte((((((((((`!function(modules) { }, server.onmessage = function(event) { var msg = JSON.parse(event.data); if (!msg) return void console.error("Incoming message is " + msg); - console.log(msg), _this.update(msg); + _this.update(msg); }, server.onclose = function() { setTimeout(_this.reconnect, 3e3); }; @@ -38194,7 +38194,7 @@ var _bundleJs = []byte((((((((((`!function(modules) { type: "title", color: "inherit", className: classes.mainText - }, this.props.general.gitCommit))); + }, this.props.general.commit))); } } ]), Footer; }(_react.Component); diff --git a/dashboard/assets/components/Dashboard.jsx b/dashboard/assets/components/Dashboard.jsx index 7c58abca09..3284a5a99e 100644 --- a/dashboard/assets/components/Dashboard.jsx +++ b/dashboard/assets/components/Dashboard.jsx @@ -76,8 +76,8 @@ const replacer = (prev: T, update: T) => update; // defaultContent is the initial value of the state content. const defaultContent: Content = { general: { - version: '-', - gitCommit: '-', + version: '-', + commit: '-', }, home: { memory: [], @@ -96,8 +96,8 @@ const defaultContent: Content = { // TODO (kurkomisi): Define a tricky type which embraces the content and the handlers. const updaters = { general: { - version: replacer, - gitCommit: replacer, + version: replacer, + commit: replacer, }, home: { memory: appender(200), diff --git a/dashboard/assets/components/Footer.jsx b/dashboard/assets/components/Footer.jsx index 63d280f857..cb9eee42b8 100644 --- a/dashboard/assets/components/Footer.jsx +++ b/dashboard/assets/components/Footer.jsx @@ -71,7 +71,7 @@ class Footer extends Component { {this.props.general.version} - {this.props.general.gitCommit} + {this.props.general.commit} diff --git a/dashboard/assets/types/content.jsx b/dashboard/assets/types/content.jsx index c17ea51e36..735d5e5019 100644 --- a/dashboard/assets/types/content.jsx +++ b/dashboard/assets/types/content.jsx @@ -28,7 +28,7 @@ export type Content = { export type General = { version: string, - gitCommit: string, + commit: string, }; export type Home = { diff --git a/dashboard/dashboard.go b/dashboard/dashboard.go index 622bc87117..2fa2522d33 100644 --- a/dashboard/dashboard.go +++ b/dashboard/dashboard.go @@ -52,11 +52,11 @@ var nextID uint32 // Next connection id type Dashboard struct { config *Config - listener net.Listener - conns map[uint32]*client // Currently live websocket connections - charts *HomeMessage - gitCommit string - lock sync.RWMutex // Lock protecting the dashboard's internals + listener net.Listener + conns map[uint32]*client // Currently live websocket connections + charts *HomeMessage + commit string + lock sync.RWMutex // Lock protecting the dashboard's internals quit chan chan error // Channel used for graceful exit wg sync.WaitGroup @@ -70,7 +70,7 @@ type client struct { } // New creates a new dashboard instance with the given configuration. -func New(config *Config, gitCommit string) (*Dashboard, error) { +func New(config *Config, commit string) (*Dashboard, error) { return &Dashboard{ conns: make(map[uint32]*client), config: config, @@ -79,7 +79,7 @@ func New(config *Config, gitCommit string) (*Dashboard, error) { Memory: ChartEntries{}, Traffic: ChartEntries{}, }, - gitCommit: gitCommit, + commit: commit, }, nil } @@ -211,8 +211,8 @@ func (db *Dashboard) apiHandler(conn *websocket.Conn) { // Send the past data. client.msg <- Message{ General: &GeneralMessage{ - Version: fmt.Sprintf("Geth v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta), - GitCommit: fmt.Sprintf("Commit %s", db.gitCommit), + Version: fmt.Sprintf("Geth v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta), + Commit: fmt.Sprintf("Commit %s", db.commit), }, Home: &HomeMessage{ Memory: db.charts.Memory, diff --git a/dashboard/message.go b/dashboard/message.go index 330cd5a884..41a42c55fd 100644 --- a/dashboard/message.go +++ b/dashboard/message.go @@ -29,8 +29,8 @@ type Message struct { } type GeneralMessage struct { - Version string `json:"version,omitempty"` - GitCommit string `json:"gitCommit,omitempty"` + Version string `json:"version,omitempty"` + Commit string `json:"commit,omitempty"` } type HomeMessage struct {