Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitba22be6

Browse files
committed
reverted the orange/red based on usage
1 parentc893257 commitba22be6

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
exportdefaultmeta;
2525
typeStory=StoryObj<typeofManagedAgentsConsumption>;
2626

27-
exportconstDefault:Story={
28-
name:"Normal Usage (42% of limit)",
29-
};
30-
31-
exportconstWarning: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+
exportconstDefault:Story={};
4828

4929
exportconstNearLimit: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-
exportconstAtLimit: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-
exportconstOverLimit: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
exportconstOverIncluded: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
exportconstLowUsage: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
constincludedPercentage=Math.min((included/limit)*100,100);
9595
constremainingPercentage=Math.max(100-includedPercentage,0);
9696

97-
// Determine usage bar color based on percentage
98-
constgetUsageColor=()=>{
99-
constactualUsagePercent=(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-
constusageBarColor=getUsageColor();
110-
11197
return(
11298
<sectionclassName="border border-solid rounded">
11399
<divclassName="p-4">
@@ -145,7 +131,7 @@ export const ManagedAgentsConsumption: FC<ManagedAgentsConsumptionProps> = ({
145131
<ul>
146132
<liclassName="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
<divclassName="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-fullbg-highlight-green transition-all duration-300"
186172
style={{width:`${usagePercentage}%`}}
187173
/>
188174

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp