-
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-203 Add storage trends by drive #50
Conversation
89b7205
to
0e7f57f
Compare
@@ -147,8 +147,7 @@ public IActionResult FindHistory() | |||
var user = _authorization.GetUser(); | |||
if (user == null) return Forbid(); | |||
|
|||
var result = _fileSystemHistoryItemService.FindHistoryByMonth(filter.StartDate ?? DateTime.UtcNow.AddYears(-1), filter.EndDate, filter.TenantId, filter.OrganizationId, filter.OperatingSystemItemId, filter.ServerItemServiceNowKey); | |||
// var result = _fileSystemHistoryItemService.FindForUser(user.Id, filter); | |||
var result = _fileSystemHistoryItemService.FindHistoryByMonthForUser(user.Id, filter.StartDate ?? DateTime.UtcNow.AddYears(-1), filter.EndDate, filter.TenantId, filter.OrganizationId, filter.OperatingSystemItemId, filter.ServerItemServiceNowKey); |
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.
Fixed bug
@@ -17,6 +18,7 @@ export default function Page() { | |||
<TotalStorage /> | |||
<AllocationByOS /> | |||
<AllocationTable operatingSystem={OperatingSystems.Windows} /> | |||
<SegmentedBarChart /> |
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.
Add to client page
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.
Mostly formatting changes from my auto-linter
justify-content: space-evenly; | ||
} | ||
|
||
.legend { |
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.
Added this to display the label on two lines.
'November', | ||
'December', | ||
]; | ||
export const SegmentedBarChart = ({ maxVolumes = 4 }: ISegmentedBarChart) => { |
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.
When a user selected the server in the filter it will automatically display the drives in this chart.
.slice(0, actualMaxVolumes) | ||
.map((volume, index) => { | ||
// Get color pair based on the current drive | ||
const cIndex = |
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 handles more than 3 volumes and keeps reusing the 3 colours.
@@ -0,0 +1,5 @@ | |||
export const extractVolumeName = (name?: 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.
Need this to keep the linux names shorter in the label
* @param minColumns Minimum number of columns | ||
* @returns An array of months to contain history for each month. | ||
*/ | ||
export const useStorageHistoryDateRange = <T>(minColumns: number = 1) => { |
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.
Extracted to separate hook so it can be shared.
@@ -18,18 +20,18 @@ export const useDashboardFileSystemHistoryItems = () => { | |||
const fetch = React.useCallback( | |||
async (filter: IFileSystemHistoryItemFilter) => { | |||
try { | |||
setServerHistoryItemsReady(false); | |||
setFileSystemHistoryItemsReady(false); |
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.
Fixed bug
This one was complicated. Many of our servers have more than 3 mapped volumes, and many have no mapped volumes. I have updated the Storage Trends by Drive to display how many total drives are on the server.
There are many drives with 0 storage, which could be a data issue, or simple some of these drives are not relevant (i.e. System).
Linux
I've extracted the last portion of their mapped name for the label.
Windows