feat: icon success color when updating

This commit is contained in:
Zephyruso 2023-09-05 20:25:49 +08:00
parent e6facf1175
commit 6575e73439
3 changed files with 19 additions and 16 deletions

View File

@ -64,7 +64,8 @@ export default () => {
> >
<IconBrandSpeedtest <IconBrandSpeedtest
class={twMerge( class={twMerge(
speedTestingMap()[proxy.name] && 'animate-pulse', speedTestingMap()[proxy.name] &&
'animate-pulse text-success',
)} )}
/> />
</Button> </Button>
@ -72,7 +73,7 @@ export default () => {
<div class="text-sm text-slate-500"> <div class="text-sm text-slate-500">
{proxy.type} {proxy.now?.length > 0 && ` :: ${proxy.now}`} {proxy.type} {proxy.now?.length > 0 && ` :: ${proxy.now}`}
</div> </div>
<Show when={!collapsedMap()[`group-${proxy.name}`]}> <Show when={!collapsedMap()[proxy.name]}>
<ProxyNodePreview <ProxyNodePreview
proxyNameList={sortedProxyNames} proxyNameList={sortedProxyNames}
now={proxy.now} now={proxy.now}
@ -93,12 +94,10 @@ export default () => {
return ( return (
<Collapse <Collapse
isOpen={collapsedMap()[`group-${proxy.name}`]} isOpen={collapsedMap()[proxy.name]}
title={title} title={title}
content={content} content={content}
onCollapse={(val) => onCollapse={(val) => setCollapsedMap(proxy.name, val)}
setCollapsedMap(`group-${proxy.name}`, val)
}
/> />
) )
})} })}

View File

@ -63,7 +63,9 @@ export default () => {
onClick={(e) => onUpdateAllProviderClick(e)} onClick={(e) => onUpdateAllProviderClick(e)}
> >
<IconReload <IconReload
class={twMerge(allProviderIsUpdating() && 'animate-spin')} class={twMerge(
allProviderIsUpdating() && 'animate-spin text-success',
)}
/> />
</Button> </Button>
</h1> </h1>
@ -88,7 +90,8 @@ export default () => {
> >
<IconReload <IconReload
class={twMerge( class={twMerge(
updateingMap()[proxyProvider.name] && 'animate-spin', updateingMap()[proxyProvider.name] &&
'animate-spin text-success',
)} )}
/> />
</Button> </Button>
@ -100,7 +103,7 @@ export default () => {
<IconBrandSpeedtest <IconBrandSpeedtest
class={twMerge( class={twMerge(
healthCheckingMap()[proxyProvider.name] && healthCheckingMap()[proxyProvider.name] &&
'animate-pulse', 'animate-pulse text-success',
)} )}
/> />
</Button> </Button>
@ -113,7 +116,7 @@ export default () => {
{proxyProvider.vehicleType} :: {t('updated')}{' '} {proxyProvider.vehicleType} :: {t('updated')}{' '}
{formatTimeFromNow(proxyProvider.updatedAt)} {formatTimeFromNow(proxyProvider.updatedAt)}
</div> </div>
<Show when={!collapsedMap()[`provider-${proxyProvider.name}`]}> <Show when={!collapsedMap()[proxyProvider.name]}>
<ProxyNodePreview proxyNameList={sortedProxyNames} /> <ProxyNodePreview proxyNameList={sortedProxyNames} />
</Show> </Show>
</> </>
@ -123,12 +126,10 @@ export default () => {
return ( return (
<Collapse <Collapse
isOpen={collapsedMap()[`provider-${proxyProvider.name}`]} isOpen={collapsedMap()[proxyProvider.name]}
title={title} title={title}
content={content} content={content}
onCollapse={(val) => onCollapse={(val) => setCollapsedMap(proxyProvider.name, val)}
setCollapsedMap(`provider-${proxyProvider.name}`, val)
}
/> />
) )
})} })}

View File

@ -74,7 +74,9 @@ export default () => {
onClick={(e) => onUpdateAllProviderClick(e)} onClick={(e) => onUpdateAllProviderClick(e)}
> >
<IconReload <IconReload
class={twMerge(allProviderIsUpdating() && 'animate-spin')} class={twMerge(
allProviderIsUpdating() && 'animate-spin text-success',
)}
/> />
</Button> </Button>
</h1> </h1>
@ -95,7 +97,8 @@ export default () => {
> >
<IconReload <IconReload
class={twMerge( class={twMerge(
updatingMap()[rulesProvider.name] && 'animate-spin', updatingMap()[rulesProvider.name] &&
'animate-spin text-success',
)} )}
/> />
</Button> </Button>