dashboard: limit commit length on client side

This commit is contained in:
Kurkó Mihály 2018-01-12 18:00:08 +02:00
parent 9a46b5cbc4
commit 57997174f4
2 changed files with 2 additions and 6 deletions

View file

@ -62,7 +62,7 @@ class Footer extends Component<Props> {
render() {
const {classes, general} = this.props; // The classes property is injected by withStyles().
const geth = general.version ? this.info('Geth', general.version) : null;
const commit = general.commit ? this.info('Commit', general.commit) : null;
const commit = general.commit ? this.info('Commit', general.commit.substring(0, 7)) : null;
return (
<AppBar position="static" className={classes.footer}>

View file

@ -208,15 +208,11 @@ func (db *Dashboard) apiHandler(conn *websocket.Conn) {
if len(params.VersionMeta) > 0 {
versionMeta = fmt.Sprintf(" (%s)", params.VersionMeta)
}
commit := db.commit
if len(commit) > 7 {
commit = commit[:7]
}
// Send the past data.
client.msg <- Message{
General: &GeneralMessage{
Version: fmt.Sprintf("v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta),
Commit: commit,
Commit: db.commit,
},
Home: &HomeMessage{
Memory: db.charts.Memory,