mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-17 09:23:48 +00:00
dashboard: limit commit length on client side
This commit is contained in:
parent
9a46b5cbc4
commit
57997174f4
2 changed files with 2 additions and 6 deletions
|
|
@ -62,7 +62,7 @@ class Footer extends Component<Props> {
|
||||||
render() {
|
render() {
|
||||||
const {classes, general} = this.props; // The classes property is injected by withStyles().
|
const {classes, general} = this.props; // The classes property is injected by withStyles().
|
||||||
const geth = general.version ? this.info('Geth', general.version) : null;
|
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 (
|
return (
|
||||||
<AppBar position="static" className={classes.footer}>
|
<AppBar position="static" className={classes.footer}>
|
||||||
|
|
|
||||||
|
|
@ -208,15 +208,11 @@ func (db *Dashboard) apiHandler(conn *websocket.Conn) {
|
||||||
if len(params.VersionMeta) > 0 {
|
if len(params.VersionMeta) > 0 {
|
||||||
versionMeta = fmt.Sprintf(" (%s)", params.VersionMeta)
|
versionMeta = fmt.Sprintf(" (%s)", params.VersionMeta)
|
||||||
}
|
}
|
||||||
commit := db.commit
|
|
||||||
if len(commit) > 7 {
|
|
||||||
commit = commit[:7]
|
|
||||||
}
|
|
||||||
// Send the past data.
|
// Send the past data.
|
||||||
client.msg <- Message{
|
client.msg <- Message{
|
||||||
General: &GeneralMessage{
|
General: &GeneralMessage{
|
||||||
Version: fmt.Sprintf("v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta),
|
Version: fmt.Sprintf("v%d.%d.%d%s", params.VersionMajor, params.VersionMinor, params.VersionPatch, versionMeta),
|
||||||
Commit: commit,
|
Commit: db.commit,
|
||||||
},
|
},
|
||||||
Home: &HomeMessage{
|
Home: &HomeMessage{
|
||||||
Memory: db.charts.Memory,
|
Memory: db.charts.Memory,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue