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

Statistics admin page #1567

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Statistics admin page #1567

wants to merge 9 commits into from

Conversation

shudsky
Copy link
Contributor

@shudsky shudsky commented Feb 17, 2025

Pull Request

Description

Improved admin statistics page.
image

Changes

  • Each row displays workspace acronym, department, budget remaining, list of provisioned tools, and the last user login
  • Opening the row displays cost of last 7 days, metadata status, and a list of users (and their emails and roles)
  • CSV download button
  • Includes filtering by workspace name search, tools checkbox, number of users in a workspace, and percent of budget used
    image
    image
    image

Testing

  • Tested visually

Checklist

  • Code follows dotnet coding standards
  • Tests added/updated to cover changes

@shudsky shudsky changed the title Sg/statistics tool Sg/statistics admin tool Feb 17, 2025
@shudsky shudsky changed the title Sg/statistics admin tool Statistics admin tool Feb 17, 2025
@shudsky shudsky changed the title Statistics admin tool Statistics admin page Feb 17, 2025
Copy link
Contributor

@Sean-Stilwell Sean-Stilwell left a comment

Choose a reason for hiding this comment

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

Awesome work with this Siovan. I've left a couple comments in the code itself.

Just a couple extra points:

  1. Is the CSV supposed to download the entire list or the filtered list? Currently it's doing everything, I just wanted to confirm this is intended.
  2. It looks like localization still needs to be done.

Placeholder=@Localizer["Search by workspace name or acronym"]
Adornment="Adornment.Start"
AdornmentIcon="@Icons.Material.Filled.Search"
IconSize="Size.Medium" Class="mt-0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to put everything in line together

Suggested change
IconSize="Size.Medium" Class="mt-0"
IconSize="Size.Medium" Class="mt-4"

image

await using var context = await _dbContextFactory.CreateDbContextAsync();
const int numberOfDays = 7;




_statsRows = context.Projects
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like this block isn't retrieving the Workspace Lead properly, if I download the CSV it's left blank.

Department = p.Sector_Name,
LastLogin = p.LastLoginDate

// Leads = p.Users?.Where(u => u.RoleId == (int) Project_Role.RoleNames.WorkspaceLead).Select(u => u.User_Name).ToList(),
Copy link
Contributor

Choose a reason for hiding this comment

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

If the code is commented out, can we just delete it for clarity?


}
await ReloadWorkspaceStatsTableAsync();
}
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 to delete this; unnecessary (just check for string values)

@@ -33,6 +41,7 @@ public class DatahubProjectStatsRow
public ResourceStatus DatabricksStatus { get; set; }

public bool ShowUserDetails { get; set; }
public bool ShowBudgetDetails { get; set; }
Copy link
Contributor Author

Choose a reason for hiding this comment

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

delete (check for others)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants