dashboard: deep state update, footer#15837
Conversation
|
Ok, this is a bit crude on the UI side :P Instead of one big Similar in styling to https://pbs.twimg.com/media/DMQdz7tW4AA_qlX.jpg:large The |
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
| type GeneralMessage struct { | ||
| Version string `json:"version,omitempty"` | ||
| Version string `json:"version,omitempty"` | ||
| GitCommit string `json:"gitCommit,omitempty"` |
There was a problem hiding this comment.
Call this just Commit pls, also in the json, just commit.
|
|
||
| // New creates a new dashboard instance with the given configuration. | ||
| func New(config *Config) (*Dashboard, error) { | ||
| func New(config *Config, gitCommit string) (*Dashboard, error) { |
| listener net.Listener | ||
| conns map[uint32]*client // Currently live websocket connections | ||
| charts *HomeMessage | ||
| gitCommit string |
|
|
||
| export type General = { | ||
| version: string, | ||
| gitCommit: string, |
53f0409 to
e9e7e5c
Compare
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
|
Please move commit under the version, style |
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
|
Thank you for your contribution! Your commits seem to not adhere to the repository coding standards
Please check the contribution guidelines for more details. This message was auto-generated by https://gitcop.com |
* 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
bundle.jsanddashboard.htmlis moved to the root directory.ramda.js.Reactcomponent 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, becauseReactdoesn'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 thedeepUpdatefunction 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.shouldUpdatecontains the structure of the incoming message, and it is used at theshouldComponentUpdatemethods to check whether the data connected to the actual component was affected or not.gethversion on it.