Skip to content

Commit 2f0ca2e

Browse files
authored
update: provider
update: provider
2 parents c48a98b + add5f18 commit 2f0ca2e

File tree

1 file changed

+19
-21
lines changed
  • src/components/ecosystem-pages/providers-page

1 file changed

+19
-21
lines changed

src/components/ecosystem-pages/providers-page/card.tsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@ export default function ProvidersCard({ provider }: any) {
1414
const activeStats = provider.activeStats || { cpu: 0, memory: 0, gpu: 0, storage: 0 };
1515
const pendingStats = provider.pendingStats || { cpu: 0, memory: 0, gpu: 0, storage: 0 };
1616
const availableStats = provider.availableStats || { cpu: 0, memory: 0, gpu: 0, storage: 0 };
17-
17+
1818
const isOnline = provider.isOnline ?? false;
19-
19+
2020
const activeCPU = isOnline ? (activeStats.cpu || 0) / 1000 : 0;
2121
const pendingCPU = isOnline ? (pendingStats.cpu || 0) / 1000 : 0;
2222
const totalCPU = isOnline
2323
? ((availableStats.cpu || 0) +
24-
(pendingStats.cpu || 0) +
25-
(activeStats.cpu || 0)) /
26-
1000
24+
(pendingStats.cpu || 0) +
25+
(activeStats.cpu || 0)) /
26+
1000
2727
: 0;
2828

2929
const gpuModels = (provider.hardwareGpuModels || []).map((gpu: any) =>
@@ -35,10 +35,10 @@ export default function ProvidersCard({ provider }: any) {
3535
: null;
3636
const _totalMemory = isOnline && (availableStats.memory || pendingStats.memory || activeStats.memory)
3737
? bytesToShrink(
38-
(availableStats.memory || 0) +
39-
(pendingStats.memory || 0) +
40-
(activeStats.memory || 0),
41-
)
38+
(availableStats.memory || 0) +
39+
(pendingStats.memory || 0) +
40+
(activeStats.memory || 0),
41+
)
4242
: null;
4343

4444
const intl = useIntl();
@@ -73,11 +73,10 @@ export default function ProvidersCard({ provider }: any) {
7373

7474
<div className=" mt-[10px] border-b pb-3">
7575
<p
76-
className={`inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ${
77-
provider.isAudited
78-
? "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-600/20 dark:text-green-500 "
79-
: "bg-yellow-50 text-yellow-800 ring-1 ring-inset ring-yellow-600/20 dark:bg-yellow-600/20 dark:text-yellow-500"
80-
}`}
76+
className={`inline-flex items-center rounded-full px-2 py-1 text-xs font-medium ${provider.isAudited
77+
? "bg-green-50 text-green-700 ring-1 ring-inset ring-green-600/20 dark:bg-green-600/20 dark:text-green-500 "
78+
: "bg-yellow-50 text-yellow-800 ring-1 ring-inset ring-yellow-600/20 dark:bg-yellow-600/20 dark:text-yellow-500"
79+
}`}
8180
>
8281
{provider.isAudited ? "Audited" : "Pending"}
8382
</p>
@@ -166,9 +165,9 @@ export default function ProvidersCard({ provider }: any) {
166165
)} ${_totalMemory?.unit} `}
167166
isOver60Percent={
168167
((activeStats.memory || 0) + (pendingStats.memory || 0)) /
169-
((availableStats.memory || 0) +
170-
(pendingStats.memory || 0) +
171-
(activeStats.memory || 0)) >
168+
((availableStats.memory || 0) +
169+
(pendingStats.memory || 0) +
170+
(activeStats.memory || 0)) >
172171
0.64
173172
}
174173
/>
@@ -185,7 +184,7 @@ export default function ProvidersCard({ provider }: any) {
185184
)}
186185
</div>
187186

188-
<div className="mt-3">
187+
<div className="mt-auto pt-3">
189188
<a
190189
target="_blank"
191190
href={`https://console.akash.network/providers/${provider.owner}`}
@@ -204,9 +203,8 @@ function Stats({ componentName, value, isOver60Percent }: any) {
204203
<div className="flex w-full items-center justify-between rounded-sm border border-[#E6E8EB] p-[9px] text-cardGray">
205204
<p className=" text-xs font-medium">{componentName}</p>
206205
<p
207-
className={` text-xs font-medium text-foreground ${
208-
isOver60Percent ? "text-primary" : ""
209-
}`}
206+
className={` text-xs font-medium text-foreground ${isOver60Percent ? "text-primary" : ""
207+
}`}
210208
>
211209
{value}
212210
</p>

0 commit comments

Comments
 (0)