mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-06 03:03:44 +08:00
fix: usage percent style
This commit is contained in:
parent
689a1f739f
commit
9278e74e9e
@ -73,7 +73,10 @@ export const ProfileItem = (props: Props) => {
|
|||||||
const from = parseUrl(itemData.url);
|
const from = parseUrl(itemData.url);
|
||||||
const description = itemData.desc;
|
const description = itemData.desc;
|
||||||
const expire = parseExpire(extra?.expire);
|
const expire = parseExpire(extra?.expire);
|
||||||
const progress = Math.round(((download + upload) * 100) / (total + 0.01) + 1);
|
const progress = Math.min(
|
||||||
|
Math.round(((download + upload) * 100) / (total + 0.01)) + 1,
|
||||||
|
100
|
||||||
|
);
|
||||||
|
|
||||||
const loading = loadingCache[itemData.uid] ?? false;
|
const loading = loadingCache[itemData.uid] ?? false;
|
||||||
|
|
||||||
|
@ -105,8 +105,9 @@ export const ProviderButton = () => {
|
|||||||
const download = sub?.Download || 0;
|
const download = sub?.Download || 0;
|
||||||
const total = sub?.Total || 0;
|
const total = sub?.Total || 0;
|
||||||
const expire = sub?.Expire || 0;
|
const expire = sub?.Expire || 0;
|
||||||
const progress = Math.round(
|
const progress = Math.min(
|
||||||
((download + upload) * 100) / (total + 0.1)
|
Math.round(((download + upload) * 100) / (total + 0.01)) + 1,
|
||||||
|
100
|
||||||
);
|
);
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
@ -159,6 +160,7 @@ export const ProviderButton = () => {
|
|||||||
<LinearProgress
|
<LinearProgress
|
||||||
variant="determinate"
|
variant="determinate"
|
||||||
value={progress}
|
value={progress}
|
||||||
|
style={{ opacity: total > 0 ? 1 : 0 }}
|
||||||
/>
|
/>
|
||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user