mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-23 21:35:36 +08:00
feat: truncate proxy node name
This commit is contained in:
parent
8e377e8282
commit
6db7ceddac
8
.vscode/settings.json
vendored
Normal file
8
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"tailwindCSS.classAttributes": [
|
||||||
|
"class",
|
||||||
|
"className",
|
||||||
|
"ngClass",
|
||||||
|
".*ClassName*"
|
||||||
|
]
|
||||||
|
}
|
@ -12,17 +12,22 @@ const Collapse: ParentComponent<Props> = (props) => {
|
|||||||
const { title, content, onCollapse } = props
|
const { title, content, onCollapse } = props
|
||||||
|
|
||||||
const getCollapseClassName = () => {
|
const getCollapseClassName = () => {
|
||||||
return props.isOpen ? 'collapse-open' : 'collapse-close'
|
const openedClassName = 'collapse-open'
|
||||||
|
const closedClassName = 'collapse-close'
|
||||||
|
return props.isOpen ? openedClassName : closedClassName
|
||||||
}
|
}
|
||||||
|
|
||||||
const getCollapseContentClassName = () => {
|
const getCollapseContentClassName = () => {
|
||||||
return props.isOpen ? 'opacity-100' : 'opacity-0 scale-y-0'
|
const openedClassName = 'opacity-100'
|
||||||
|
const closedClassName = 'opacity-0 scale-y-0'
|
||||||
|
return props.isOpen ? openedClassName : closedClassName
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
class={twMerge(
|
class={twMerge(
|
||||||
getCollapseClassName(),
|
getCollapseClassName(),
|
||||||
'collapse collapse-arrow border-secondary bg-base-200 p-1',
|
'collapse collapse-arrow overflow-visible border-secondary bg-base-200 p-1',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
@ -34,7 +39,7 @@ const Collapse: ParentComponent<Props> = (props) => {
|
|||||||
<div
|
<div
|
||||||
class={twMerge(
|
class={twMerge(
|
||||||
getCollapseContentClassName(),
|
getCollapseContentClassName(),
|
||||||
'collapse-content grid grid-cols-1 gap-2 overflow-hidden transition-opacity duration-1000 sm:grid-cols-3 lg:grid-cols-5',
|
'collapse-content grid grid-cols-1 gap-2 transition-opacity duration-1000 sm:grid-cols-3 lg:grid-cols-5',
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
{content}
|
{content}
|
||||||
|
@ -17,6 +17,7 @@ export default (props: {
|
|||||||
|
|
||||||
return <span>{delay}ms</span>
|
return <span>{delay}ms</span>
|
||||||
}
|
}
|
||||||
|
console.log(proxyName)
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
@ -24,12 +25,13 @@ export default (props: {
|
|||||||
isSelected
|
isSelected
|
||||||
? 'border-primary bg-success-content text-success'
|
? 'border-primary bg-success-content text-success'
|
||||||
: 'border-secondary',
|
: 'border-secondary',
|
||||||
onClick ? 'cursor-pointer' : '',
|
onClick && 'cursor-pointer',
|
||||||
'card card-bordered card-compact m-1 flex-row justify-between border-secondary p-4',
|
'card card-bordered tooltip tooltip-bottom card-compact flex flex-row justify-between gap-2 p-4',
|
||||||
)}
|
)}
|
||||||
onClick={() => onClick?.()}
|
onClick={() => onClick?.()}
|
||||||
|
data-tip={proxyName}
|
||||||
>
|
>
|
||||||
<span class="mr-2 overflow-hidden whitespace-nowrap">{proxyName}</span>
|
<span class="truncate">{proxyName}</span>
|
||||||
<span>{Delay(proxyName)}</span>
|
<span>{Delay(proxyName)}</span>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
@ -41,8 +41,9 @@ export default () => {
|
|||||||
{(proxy) => {
|
{(proxy) => {
|
||||||
const title = (
|
const title = (
|
||||||
<>
|
<>
|
||||||
<div class="flex items-center">
|
<div class="flex items-center gap-2">
|
||||||
<span class="mr-3">{proxy.name}</span>
|
<span>{proxy.name}</span>
|
||||||
|
|
||||||
<IconBrandSpeedtest
|
<IconBrandSpeedtest
|
||||||
class="cursor-pointer"
|
class="cursor-pointer"
|
||||||
onClick={(e) => onSpeedTestClick(e, proxy.name)}
|
onClick={(e) => onSpeedTestClick(e, proxy.name)}
|
||||||
|
Loading…
Reference in New Issue
Block a user