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;
}, 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);

View file

@ -76,8 +76,8 @@ const replacer = <T>(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),

View file

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

View file

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

View file

@ -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,

View file

@ -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 {