Skip to content

[usage] Personal usage tab #14161

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

Merged
merged 1 commit into from
Oct 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/dashboard/src/components/UsageView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,12 @@ function UsageView({ attributionId }: UsageViewProps) {

const currentPaginatedResults = usagePage?.usageEntriesList.filter((u) => u.kind === "workspaceinstance") ?? [];

const headerTitle = attributionId.kind === "team" ? "Team Usage" : "Personal Usage";

return (
<>
<Header
title="Usage"
title={headerTitle}
subtitle={`${new Date(startDateOfBillMonth).toLocaleDateString()} - ${new Date(
endDateOfBillMonth,
).toLocaleDateString()} (updated every 15 minutes).`}
Expand Down
9 changes: 9 additions & 0 deletions components/dashboard/src/settings/settings-menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
settingsPathTeams,
settingsPathVariables,
settingsPathSSHKeys,
settingsPathUsage,
} from "./settings.routes";

export default function getSettingsMenu(params: { userBillingMode?: BillingMode }) {
Expand Down Expand Up @@ -80,6 +81,14 @@ function renderBillingMenuEntries(billingMode?: BillingMode) {
title: "Billing",
link: [settingsPathBilling],
},
...(BillingMode.showUsageBasedBilling(billingMode)
? [
{
title: "Usage",
link: [settingsPathUsage],
},
]
: []),
// We need to allow access to "Team Plans" here, at least for owners.
...(BillingMode.showTeamSubscriptionUI(billingMode)
? [
Expand Down
1 change: 1 addition & 0 deletions components/dashboard/src/settings/settings.routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const settingsPathAccount = "/account";
export const settingsPathIntegrations = "/integrations";
export const settingsPathNotifications = "/notifications";
export const settingsPathBilling = "/billing";
export const settingsPathUsage = "/usage";
export const settingsPathPlans = "/plans";
export const settingsPathPreferences = "/preferences";

Expand Down