-
Notifications
You must be signed in to change notification settings - Fork 2
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
HOSTSD-199 Add storage trends chart #40
Conversation
padding-left: 42px; | ||
} | ||
|
||
.spinner { |
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.
Ugly spinner
import React from 'react'; | ||
import { IStats } from './IStats'; | ||
import { defaultData } from './defaultData'; | ||
import { updateData } from './updateData'; | ||
|
||
export const useDonutChart = () => { | ||
const serverItem = useFiltered((state) => state.serverItem); | ||
const serverItems = useFiltered((state) => state.serverItems); | ||
const serverItems = useDashboard((state) => state.serverItems); |
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.
Simplified
const { organizations } = useOrganizations(); | ||
const { operatingSystemItems } = useOperatingSystemItems(); | ||
const { serverItems } = useServerItems(); | ||
const { isReady: tenantsReady, tenants } = useTenants(); |
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.
Filter now displays loading spinners
@@ -111,4 +111,20 @@ | |||
.selected { | |||
background-color: $bc-blue; | |||
color: $white; | |||
} | |||
|
|||
.spinner { |
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.
Ugly spinner
* @returns A string representing the storage size. | ||
*/ | ||
export const convertToStorageSize = ( | ||
export const convertToStorageSize = <T extends string | number>( |
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.
Needed a way to return just the converted value. I don't love the generics in this case.
@@ -291,10 +291,6 @@ private async Task ProcessConfigurationItemsAsync(Models.DataSyncModel option) | |||
_serverItems[serverItem.ServiceNowKey] = serverItem; | |||
} | |||
|
|||
// Add the server history item to HSB. |
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.
Adding historical records is the api job now
@@ -15,6 +15,7 @@ public override void Configure(EntityTypeBuilder<ServerItem> builder) | |||
builder.Property(m => m.TenantId); | |||
builder.Property(m => m.OrganizationId); | |||
builder.Property(m => m.OperatingSystemItemId); | |||
builder.Property(m => m.HistoryKey); |
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 essentially a foreign key, but it's not enforced otherwise we'd have a chicken/egg issue.
We now have storage trends and a way to access historical data.
I needed to update the DB schema to support maintaining a link between historical server items and the current server item. This was required to improve performance by offloading capacity calculations to the Data Server.
I've also added some horrible looking loading spinners to slightly improve the user experience when waiting for data.
Loading Spinners
Dashboard