Skip to content

dashboard: deep state update, footer#15837

Merged
karalabe merged 12 commits into
ethereum:masterfrom
kurkomisi:dashboard-footer
Jan 15, 2018
Merged

dashboard: deep state update, footer#15837
karalabe merged 12 commits into
ethereum:masterfrom
kurkomisi:dashboard-footer

Conversation

@kurkomisi
Copy link
Copy Markdown
Contributor

  • bundle.js and dashboard.html is moved to the root directory.
  • An own deep state updater replaces ramda.js.
    • The state of a React component is a JSON object, which needs to be immutable, and in order to keep this rule a state property needs to be changed completely during an update. This causes a problem, when one wants to nest objects in the state, because React doesn't change a small part of the nested object, but completely replaces it. The dashboard relies on such nested objects, which trigger the rerendering of some parts of the UI. In order to handle the deep update the deepUpdate function is used, which copies the original state property, and updates the concerned object properties. For the maximal flexibility of the update an auxiliary JSON object is used, which has the same structure as the state, except that it contains update handler functions.
    • It turns out that the server message and the state content can possess identical structure, so there is no need for handling the different parts of the incoming message, because the deep updater does it already. As a consequence an incoming message triggers all the relevant renders of the UI without further effort.
  • shouldUpdate contains the structure of the incoming message, and it is used at the shouldComponentUpdate methods to check whether the data connected to the actual component was affected or not.
  • Footer is included with the geth version on it.
  • The message structure is changed both on server and client side.

@karalabe
Copy link
Copy Markdown
Member

Ok, this is a bit crude on the UI side :P

Instead of one big 1.8.0-unstable, lets be a bit more specific with it. Something like:

Geth v1.8.0 (unstable)
Commit 12345678

Similar in styling to https://pbs.twimg.com/media/DMQdz7tW4AA_qlX.jpg:large

The (unstable) should only appear if unstable, and nothing should if it's a stable build. The commit hash is again optional, if we have one, display it, otherwise nothing. Also lets push it out to the right edge of the footer.

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

^

@karalabe karalabe added this to the 1.8.0 milestone Jan 10, 2018
@GitCop
Copy link
Copy Markdown

GitCop commented Jan 11, 2018

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: 53f04096a74238406109eacca62abc29684edbfb
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

Comment thread dashboard/message.go Outdated
type GeneralMessage struct {
Version string `json:"version,omitempty"`
Version string `json:"version,omitempty"`
GitCommit string `json:"gitCommit,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call this just Commit pls, also in the json, just commit.

Comment thread dashboard/dashboard.go Outdated

// New creates a new dashboard instance with the given configuration.
func New(config *Config) (*Dashboard, error) {
func New(config *Config, gitCommit string) (*Dashboard, error) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit is enough

Comment thread dashboard/dashboard.go Outdated
listener net.Listener
conns map[uint32]*client // Currently live websocket connections
charts *HomeMessage
gitCommit string
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit pls

Comment thread dashboard/assets/types/content.jsx Outdated

export type General = {
version: string,
gitCommit: string,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

commit

@GitCop
Copy link
Copy Markdown

GitCop commented Jan 11, 2018

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: cbdb465
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@karalabe
Copy link
Copy Markdown
Member

Please move commit under the version, style Geth and Commit a bit darker, make the fonts smaller, these aren't that important infos, just useful to have and move everything to the right side.

@GitCop
Copy link
Copy Markdown

GitCop commented Jan 12, 2018

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: cbdb465
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link
Copy Markdown

GitCop commented Jan 12, 2018

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: cbdb465
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

@GitCop
Copy link
Copy Markdown

GitCop commented Jan 12, 2018

Thank you for your contribution! Your commits seem to not adhere to the repository coding standards

  • Commit: cbdb465
  • Commits must be prefixed with the package(s) they modify

Please check the contribution guidelines for more details.


This message was auto-generated by https://gitcop.com

Copy link
Copy Markdown
Member

@karalabe karalabe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@karalabe karalabe merged commit 938cf45 into ethereum:master Jan 15, 2018
@karalabe karalabe removed this from the 1.8.0 milestone Jan 15, 2018
mariameda pushed a commit to NiluPlatform/go-nilu that referenced this pull request Aug 23, 2018
* dashboard: footer, deep state update

* dashboard: resolve asset path

* dashboard: remove bundle.js

* dashboard: prevent state update on every reconnection

* dashboard: fix linter issue

* dashboard, cmd: minor UI fix, include commit hash

* remove geth binary

* dashboard: gitCommit renamed to commit

* dashboard: move the geth version to the right, make commit optional

* dashboard: commit limited to 7 characters

* dashboard: limit commit length on client side

* dashboard: run go generate
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants