Skip to content

Commit ba22be6

Browse files
committed
reverted the orange/red based on usage
1 parent c893257 commit ba22be6

File tree

2 files changed

+5
-78
lines changed

2 files changed

+5
-78
lines changed

site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.stories.tsx

Lines changed: 3 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -24,70 +24,13 @@ const meta: Meta<typeof ManagedAgentsConsumption> = {
2424
export default meta;
2525
type Story = StoryObj<typeof ManagedAgentsConsumption>;
2626

27-
export const Default: Story = {
28-
name: "Normal Usage (42% of limit)",
29-
};
30-
31-
export const Warning: Story = {
32-
name: "Warning (80-99% of limit)",
33-
args: {
34-
managedAgentFeature: {
35-
enabled: true,
36-
actual: 96000, // 80% of limit - should show orange
37-
soft_limit: 60000,
38-
limit: 120000,
39-
usage_period: {
40-
start: "February 27, 2025",
41-
end: "February 27, 2026",
42-
issued_at: "February 27, 2025",
43-
},
44-
entitlement: "entitled",
45-
},
46-
},
47-
};
27+
export const Default: Story = {};
4828

4929
export const NearLimit: Story = {
50-
name: "Near Limit (95% of limit)",
51-
args: {
52-
managedAgentFeature: {
53-
enabled: true,
54-
actual: 114000, // 95% of limit - should show orange
55-
soft_limit: 60000,
56-
limit: 120000,
57-
usage_period: {
58-
start: "February 27, 2025",
59-
end: "February 27, 2026",
60-
issued_at: "February 27, 2025",
61-
},
62-
entitlement: "entitled",
63-
},
64-
},
65-
};
66-
67-
export const AtLimit: Story = {
68-
name: "At Limit (100% of limit)",
69-
args: {
70-
managedAgentFeature: {
71-
enabled: true,
72-
actual: 120000, // 100% of limit - should show red
73-
soft_limit: 60000,
74-
limit: 120000,
75-
usage_period: {
76-
start: "February 27, 2025",
77-
end: "February 27, 2026",
78-
issued_at: "February 27, 2025",
79-
},
80-
entitlement: "entitled",
81-
},
82-
},
83-
};
84-
85-
export const OverLimit: Story = {
86-
name: "Over Limit (120% of limit)",
8730
args: {
8831
managedAgentFeature: {
8932
enabled: true,
90-
actual: 144000, // 120% of limit - should show red
33+
actual: 115000,
9134
soft_limit: 60000,
9235
limit: 120000,
9336
usage_period: {
@@ -101,11 +44,10 @@ export const OverLimit: Story = {
10144
};
10245

10346
export const OverIncluded: Story = {
104-
name: "Over Included (67% of limit)",
10547
args: {
10648
managedAgentFeature: {
10749
enabled: true,
108-
actual: 80000, // Over included but under 80% of total limit - should still be green
50+
actual: 80000,
10951
soft_limit: 60000,
11052
limit: 120000,
11153
usage_period: {
@@ -119,7 +61,6 @@ export const OverIncluded: Story = {
11961
};
12062

12163
export const LowUsage: Story = {
122-
name: "Low Usage (21% of limit)",
12364
args: {
12465
managedAgentFeature: {
12566
enabled: true,

site/src/pages/DeploymentSettingsPage/LicensesSettingsPage/ManagedAgentsConsumption.tsx

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,20 +94,6 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
9494
const includedPercentage = Math.min((included / limit) * 100, 100);
9595
const remainingPercentage = Math.max(100 - includedPercentage, 0);
9696

97-
// Determine usage bar color based on percentage
98-
const getUsageColor = () => {
99-
const actualUsagePercent = (usage / limit) * 100;
100-
if (actualUsagePercent >= 100) {
101-
return "bg-highlight-red"; // Critical: at or over limit
102-
}
103-
if (actualUsagePercent >= 80) {
104-
return "bg-surface-orange"; // Warning: approaching limit
105-
}
106-
return "bg-highlight-green"; // Normal: safe usage
107-
};
108-
109-
const usageBarColor = getUsageColor();
110-
11197
return (
11298
<section className="border border-solid rounded">
11399
<div className="p-4">
@@ -145,7 +131,7 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
145131
<ul>
146132
<li className="flex items-center gap-2">
147133
<div
148-
className={`rounded-[2px] ${usageBarColor} size-3 inline-block`}
134+
className="rounded-[2px] bg-highlight-green size-3 inline-block"
149135
aria-label="Legend for current usage in the chart"
150136
/>
151137
Amount of started workspaces with an AI agent.
@@ -182,7 +168,7 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
182168

183169
<div className="relative h-6 bg-surface-secondary rounded overflow-hidden">
184170
<div
185-
className={`absolute top-0 left-0 h-full ${usageBarColor} transition-all duration-300`}
171+
className="absolute top-0 left-0 h-full bg-highlight-green transition-all duration-300"
186172
style={{ width: `${usagePercentage}%` }}
187173
/>
188174

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy