Skip to content
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

Merged
merged 1 commit into from
Jan 12, 2024
Merged

HOSTSD-203 Add storage trends by drive #50

merged 1 commit into from
Jan 12, 2024

Conversation

Fosol
Copy link
Contributor

@Fosol Fosol commented Jan 12, 2024

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.

image

Windows

image

@Fosol Fosol added the enhancement New feature or request label Jan 12, 2024
@Fosol Fosol self-assigned this Jan 12, 2024
@Fosol Fosol force-pushed the 203 branch 2 times, most recently from 89b7205 to 0e7f57f Compare January 12, 2024 23:52
@@ -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);
Copy link
Contributor Author

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 />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add to client page

Copy link
Contributor Author

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 {
Copy link
Contributor Author

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) => {
Copy link
Contributor Author

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 =
Copy link
Contributor Author

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) => {
Copy link
Contributor Author

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) => {
Copy link
Contributor Author

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);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed bug

@Fosol Fosol merged commit 577a4b7 into bcgov:main Jan 12, 2024
2 checks passed
@Fosol Fosol deleted the 203 branch January 12, 2024 23:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant