cmd, dashboard: dashboard using React, Material-UI, Recharts#15393
Conversation
There was a problem hiding this comment.
Please fix all your files so they have a newline at the end.
There was a problem hiding this comment.
Also skip the bundle.js, since it's an intermediate build step between source jsx and the final assets.go
There was a problem hiding this comment.
No need for user docs, that may or may not be done in some global documentation.
There was a problem hiding this comment.
--dashboard should auto-enable --metrics.
There was a problem hiding this comment.
Unless really really often needed, please just inline the actual code instead of the defaultZero (avoids problems with non-int types).
There was a problem hiding this comment.
Lets use the following order:
- Home
- Chain
- Transactions
- Network
- System
- Logs
|
Please add the LGPL3 copyright headers to all (non-generated) files |
There was a problem hiding this comment.
Pls align these a bit "nicer" ;P
There was a problem hiding this comment.
If possible, please align struct initializers. An automated tool is even better, a CI linter is possibly the best.
There was a problem hiding this comment.
This rule will handle it
https://eslint.org/docs/rules/key-spacing
There was a problem hiding this comment.
new WebSocket(((window.location.protocol === "https:") ? "wss://" : "ws://") + window.location.host + "/api");
There was a problem hiding this comment.
Perhas call metrics -> history.
There was a problem hiding this comment.
Please retain data arrays here and only convert later when actually rendering. Also I don't think there's a need to have specialized memory and traffic datakeys, we can just use value as the key (my 2c, open for debate).
There was a problem hiding this comment.
Pls use TRAFFIC_SAMPLE_LIMIT for the traffic if you defined it.
There was a problem hiding this comment.
Also a bit more flexible would be to do
while (memory.length >= MEMORY_SAMPLE_LIMIT) {
memory.shift();
}
There was a problem hiding this comment.
Please use theme colors everywhere instead of custom ones so they can be easily swapped out with the theme.
There was a problem hiding this comment.
load = event => {
event.preventDefault();
this.props.changeContent(event.target.id);
};
There was a problem hiding this comment.
id={tag.id} onClick={this.load} ...
There was a problem hiding this comment.
Before go-bindata, I'd suggest also regenerating the bundle.js to a dev doesn't need to remembed the "correct" workflow, rather just use go generate and be done with it.
There was a problem hiding this comment.
Lets rename this to chartEntry
There was a problem hiding this comment.
Lets rename metricSamples to charts, containing []chartEntry
There was a problem hiding this comment.
Please inline this and group by chart type, not by operation.
There was a problem hiding this comment.
Perhaps rename Metrics to Charts
There was a problem hiding this comment.
quit is usually the thing used in the go-ethereum codebase
There was a problem hiding this comment.
Don't ignore errors, log at least, preferrably store and return at the end of the function.
There was a problem hiding this comment.
Pls add path to the error log.
There was a problem hiding this comment.
You don't need a pointer, map is already a lightweight wrapper.
There was a problem hiding this comment.
Also please convert the map[string]interface{} to a proper type with typed fields and json tags.
a172ac2 to
c48c55f
Compare
7a34abc to
a77f486
Compare
Work in progress dashboard prototype.
Description in the README file.