-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(manager): move and update metrics cards in the server view #2241
Conversation
daniellacosse
commented
Oct 14, 2024
•
edited
Loading
edited

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 is very helpful to see how the API is used. I believe we will benefit a lot from merging the stats flows into one.
55108a4
to
ee8c388
Compare
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.
Updated with the new endpoint JSON: will merge methods next
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.
As discussed offline, Per-ASN breakdown was a significant gap during the Iran crisis. It's a confirmed need and and we put a lot of effort to implement it. It's more of a question of how, not whether we want to surface that.
I would like to see that surfaced somehow in this PR, to inform the UX design. We've discussed a simple table, which seems to work well.
Sure thing, working on it! |
Here's an initial PR for a data table component: #2273 |
Co-authored-by: Sander Bruens <[email protected]>
server_manager/www/testing/models.ts
Outdated
new Error('FakeServer.getServerMetrics not implemented') | ||
); | ||
} | ||
getSupportedExperimentalEndpoints(): Promise<Set<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 private.
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.
And you can turn it into a boolean for the specific endpoint you are checking.
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.
making it private in the test classes messes up the inheritance in TS - but I made it private on shadowbox_server
|
||
try { | ||
await this.api.request<MetricsJson>( | ||
'experimental/server/metrics?since=30d' |
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.
@sbruens HEAD
gave 405 (Method Not Allowed) and OPTIONS
returned a 404 - is there another HTTP Method I can use that the server supports?
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.
OPTIONS
sounds like the perfect method for this!
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.
Ah, I'm so used to most web servers having middleware that configure the right HEAD
and OPTIONS
by default. Agree OPTIONS
is even more appropriate.
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.
Looks good. The OPTIONS situation is unfortunate, that would be ideal. But I think we don't register an OPTIONS handler.
|
||
try { | ||
await this.api.request<MetricsJson>( | ||
'experimental/server/metrics?since=30d' |
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.
OPTIONS
sounds like the perfect method for this!
|
||
<style> | ||
/* | ||
TODO: currently webpack wants to relove the `url` link here but doesen't know how. |
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.
TODO: currently webpack wants to relove the `url` link here but doesen't know how. | |
TODO: currently webpack wants to relove the `url` link here but doesn't know how. |
|
||
try { | ||
await this.api.request<MetricsJson>( | ||
'experimental/server/metrics?since=30d' |
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.
Ah, I'm so used to most web servers having middleware that configure the right HEAD
and OPTIONS
by default. Agree OPTIONS
is even more appropriate.
@@ -1066,6 +1129,35 @@ export class ServerView extends DirMixin(PolymerElement) { | |||
return formatting.formatBytesParts(totalBytes, language).value; | |||
} | |||
|
|||
_formatHourUnits(hours: number, language: string) { | |||
// This happens during app startup before we set the language |
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 is because we don't set a default value for the property in the Polymer property lifecycle. We should set it properly and then you should be able to remove this.
* feat(manager): move and update metrics cards in the server view * getting close. trying to figure out this weird data model * style update * don't use reduce lol * okay it roughly works end to end * add metrics messages * access key tab * update to use new "endpoint" - feedback next * feedback * endpoint implemented * Update server_manager/www/app.ts Co-authored-by: Vinicius Fortuna <[email protected]> * Update server_manager/model/server.ts Co-authored-by: Vinicius Fortuna <[email protected]> * partial feedback * feedback - needs test * move implementatino * fix * fix unit formatting * refactor for testing * Update server_manager/www/shadowbox_server.ts Co-authored-by: Sander Bruens <[email protected]> * partial feedback * simply method and remove from model * make private --------- Co-authored-by: Vinicius Fortuna <[email protected]> Co-authored-by: Sander Bruens <[email protected]>