Skip to content

Commit

Permalink
style: adjust the card styles of the proxy group and proxy providers. (
Browse files Browse the repository at this point in the history
  • Loading branch information
Plutonium141 authored Dec 4, 2024
1 parent 61e2958 commit f6aecbc
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 12 deletions.
2 changes: 1 addition & 1 deletion src/components/ProxyPreviewBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export const ProxyPreviewBar = (props: {
)

return (
<div class="flex items-center gap-2 py-2">
<div class="flex items-center gap-2">
<div class="my-1 flex flex-1 items-center justify-center overflow-hidden rounded-2xl [&>*]:h-2">
<div
class="bg-success"
Expand Down
2 changes: 1 addition & 1 deletion src/components/ProxyPreviewDots.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export const ProxyPreviewDots = (props: {
const { getLatencyByName } = useProxies()

return (
<div class="flex items-center gap-2 py-2">
<div class="flex items-center gap-2">
<div class="flex flex-1 flex-wrap items-center gap-1">
<For
each={props.proxyNameList.map((name): [string, number] => [
Expand Down
20 changes: 14 additions & 6 deletions src/components/SubscriptionInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const getSubscriptionsInfo = (subscriptionInfo: ISubscriptionInfo) => {
const used = byteSize(Download + Upload, {
units: 'iec',
})
const percentage = toFinite((((Download + Upload) / Total) * 100).toFixed(2))
const percentage = Math.min(toFinite((((Download + Upload) / Total) * 100).toFixed(1)),999)

const expirePrefix = () => {
const [t] = useI18n()
Expand Down Expand Up @@ -49,14 +49,22 @@ export const SubscriptionInfo = (props: {

return (
<>
<progress class="progress" value={info.percentage} max="100" />
<div class="flex items-center gap-2 pt-1">
<progress class="progress" value={info.percentage} max="100" />

<div class="text-sm text-slate-500">
{`${info.used}`} / {`${info.total}`} ( {info.percentage}% )
<div class="badge badge-secondary badge-sm">
{info.percentage}%
</div>
</div>

<div class="text-sm text-slate-500">
{info.expirePrefix()}: {info.expireStr()}
<div class="flex flex-wrap items-center justify-between">
<div class="text-sm text-slate-500">
{`${info.used}`} / {`${info.total}`}
</div>

<div class="text-sm text-slate-500">
{info.expirePrefix()}: {info.expireStr()}
</div>
</div>
</>
)
Expand Down
13 changes: 9 additions & 4 deletions src/pages/Proxies.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { makePersisted } from '@solid-primitives/storage'
import {
IconBrandSpeedtest,
IconChevronRight,
IconReload,
IconSettings,
} from '@tabler/icons-solidjs'
Expand Down Expand Up @@ -274,8 +275,8 @@ export default () => {
{formatProxyType(proxyGroup.type)}
</span>
<Show when={proxyGroup.now?.length > 0}>
<IconChevronRight size={18}/>
<span class="whitespace-nowrap">
&nbsp;::&nbsp;
{proxyGroup.now}
</span>
</Show>
Expand Down Expand Up @@ -343,12 +344,16 @@ export default () => {
const title = (
<>
<div class="flex items-center justify-between pr-8">
<div class="flex items-center gap-2">
<span>{proxyProvider.name}</span>
<div class="flex flex-wrap items-center gap-1">
<span class="line-clamp-1 break-all">{proxyProvider.name}</span>

<div class="badge badge-sm">
{proxyProvider.proxies.length}
</div>

<div class="badge badge-sm">
{proxyProvider.vehicleType}
</div>
</div>

<div class="flex items-center gap-2">
Expand Down Expand Up @@ -399,7 +404,7 @@ export default () => {
/>

<div class="text-sm text-slate-500">
{proxyProvider.vehicleType} :: {t('updated')}{' '}
{t('updated')}{' '}
{formatTimeFromNow(proxyProvider.updatedAt)}
</div>

Expand Down

0 comments on commit f6aecbc

Please sign in to comment.