-
Notifications
You must be signed in to change notification settings - Fork 511
Admin Trace UI - Revival #86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
52fb565 to
9f9f1be
Compare
|
the assets seem not to be built |
9f9f1be to
96b2793
Compare
cesnietor
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested LGTM
| const units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"]; | ||
| const niceBytes = (x: string) => { | ||
| let l = 0, | ||
| n = parseInt(x, 10) || 0; | ||
|
|
||
| while (n >= 1024 && ++l) { | ||
| n = n / 1024; | ||
| } | ||
| //include a decimal point and a tenths-place digit if presenting | ||
| //less than ten of KB or greater units | ||
| return n.toFixed(n < 10 && l > 0 ? 1 : 0) + " " + units[l]; | ||
| }; | ||
| const timeFromdate = (d: Date) => { | ||
| let h = d.getHours() < 10 ? `0${d.getHours()}` : `${d.getHours()}`; | ||
| let m = d.getMinutes() < 10 ? `0${d.getMinutes()}` : `${d.getMinutes()}`; | ||
| let s = d.getSeconds() < 10 ? `0${d.getSeconds()}` : `${d.getSeconds()}`; | ||
|
|
||
| return `${h}:${m}:${s}:${d.getMilliseconds()}`; | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be placed in utils file
| const isDev = process.env.NODE_ENV === "development"; | ||
| const port = isDev ? "9090" : url.port; | ||
|
|
||
| const setCookie = (name: string, val: string) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be set in utils file too
No description provided.