dashboard: gitCommit renamed to commit

This commit is contained in:
Kurkó Mihály 2018-01-11 23:40:57 +02:00
parent cbdb465003
commit e9e7e5c30a
6 changed files with 22 additions and 22 deletions

View file

@ -26828,7 +26828,7 @@ var _bundleJs = []byte((((((((((`!function(modules) {
}), updated; }), updated;
}, shouldUpdate = function shouldUpdate(msg, updater) { }, shouldUpdate = function shouldUpdate(msg, updater) {
var su = {}; 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[key] = "function" == typeof updater[key] || shouldUpdate(msg[key], updater[key]);
}), su; }), su;
}, appender = function(limit) { }, appender = function(limit) {
@ -26840,7 +26840,7 @@ var _bundleJs = []byte((((((((((`!function(modules) {
}, defaultContent = { }, defaultContent = {
general: { general: {
version: "-", version: "-",
gitCommit: "-" commit: "-"
}, },
home: { home: {
memory: [], memory: [],
@ -26856,7 +26856,7 @@ var _bundleJs = []byte((((((((((`!function(modules) {
}, updaters = { }, updaters = {
general: { general: {
version: replacer, version: replacer,
gitCommit: replacer commit: replacer
}, },
home: { home: {
memory: appender(200), memory: appender(200),
@ -26895,7 +26895,7 @@ var _bundleJs = []byte((((((((((`!function(modules) {
}, server.onmessage = function(event) { }, server.onmessage = function(event) {
var msg = JSON.parse(event.data); var msg = JSON.parse(event.data);
if (!msg) return void console.error("Incoming message is " + msg); if (!msg) return void console.error("Incoming message is " + msg);
console.log(msg), _this.update(msg); _this.update(msg);
}, server.onclose = function() { }, server.onclose = function() {
setTimeout(_this.reconnect, 3e3); setTimeout(_this.reconnect, 3e3);
}; };
@ -38194,7 +38194,7 @@ var _bundleJs = []byte((((((((((`!function(modules) {
type: "title", type: "title",
color: "inherit", color: "inherit",
className: classes.mainText className: classes.mainText
}, this.props.general.gitCommit))); }, this.props.general.commit)));
} }
} ]), Footer; } ]), Footer;
}(_react.Component); }(_react.Component);

View file

@ -77,7 +77,7 @@ const replacer = <T>(prev: T, update: T) => update;
const defaultContent: Content = { const defaultContent: Content = {
general: { general: {
version: '-', version: '-',
gitCommit: '-', commit: '-',
}, },
home: { home: {
memory: [], memory: [],
@ -97,7 +97,7 @@ const defaultContent: Content = {
const updaters = { const updaters = {
general: { general: {
version: replacer, version: replacer,
gitCommit: replacer, commit: replacer,
}, },
home: { home: {
memory: appender(200), memory: appender(200),

View file

@ -71,7 +71,7 @@ class Footer extends Component<Props> {
{this.props.general.version} {this.props.general.version}
</Typography> </Typography>
<Typography type="title" color="inherit" className={classes.mainText}> <Typography type="title" color="inherit" className={classes.mainText}>
{this.props.general.gitCommit} {this.props.general.commit}
</Typography> </Typography>
</Toolbar> </Toolbar>
</AppBar> </AppBar>

View file

@ -28,7 +28,7 @@ export type Content = {
export type General = { export type General = {
version: string, version: string,
gitCommit: string, commit: string,
}; };
export type Home = { export type Home = {

View file

@ -55,7 +55,7 @@ type Dashboard struct {
listener net.Listener listener net.Listener
conns map[uint32]*client // Currently live websocket connections conns map[uint32]*client // Currently live websocket connections
charts *HomeMessage charts *HomeMessage
gitCommit string commit string
lock sync.RWMutex // Lock protecting the dashboard's internals lock sync.RWMutex // Lock protecting the dashboard's internals
quit chan chan error // Channel used for graceful exit quit chan chan error // Channel used for graceful exit
@ -70,7 +70,7 @@ type client struct {
} }
// New creates a new dashboard instance with the given configuration. // 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{ return &Dashboard{
conns: make(map[uint32]*client), conns: make(map[uint32]*client),
config: config, config: config,
@ -79,7 +79,7 @@ func New(config *Config, gitCommit string) (*Dashboard, error) {
Memory: ChartEntries{}, Memory: ChartEntries{},
Traffic: ChartEntries{}, Traffic: ChartEntries{},
}, },
gitCommit: gitCommit, commit: commit,
}, nil }, nil
} }
@ -212,7 +212,7 @@ func (db *Dashboard) apiHandler(conn *websocket.Conn) {
client.msg <- Message{ client.msg <- Message{
General: &GeneralMessage{ General: &GeneralMessage{
Version: fmt.Sprintf("Geth v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta), Version: fmt.Sprintf("Geth v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta),
GitCommit: fmt.Sprintf("Commit %s", db.gitCommit), Commit: fmt.Sprintf("Commit %s", db.commit),
}, },
Home: &HomeMessage{ Home: &HomeMessage{
Memory: db.charts.Memory, Memory: db.charts.Memory,

View file

@ -30,7 +30,7 @@ type Message struct {
type GeneralMessage struct { type GeneralMessage struct {
Version string `json:"version,omitempty"` Version string `json:"version,omitempty"`
GitCommit string `json:"gitCommit,omitempty"` Commit string `json:"commit,omitempty"`
} }
type HomeMessage struct { type HomeMessage struct {