refactor: Update EasySwitchManager layout for improved community and gateway display, enhancing visual structure and user interaction with better card organization and positioning.
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m55s

This commit is contained in:
2025-12-07 12:56:41 +07:00
parent 7204c4045f
commit 4a3426e04f
+35 -16
View File
@@ -432,14 +432,16 @@ function EasySwitchManager() {
</div>
<div className="card-body p-3">
{/* ВСЕ Communities для этого сервера */}
{/* Сетка Communities для этого сервера */}
<div className="row g-3">
{filteredCommunitiesForServer.map((comm) => {
const activeKey = `${server.id}:${comm.value}`;
const activeGw = activeGateways[activeKey];
const hasFilterForComm = server.filtersMap.has(comm.value);
return (
<div key={comm.value} className="mb-3">
<div key={comm.value} className="col-12 col-xl-6">
<div className="mb-2">
{/* Заголовок community */}
<div className="mb-2">
<span className="badge bg-blue-lt text-blue me-2" style={{ fontSize: '0.8rem' }}>
@@ -456,7 +458,7 @@ function EasySwitchManager() {
</span>
</div>
{/* Сетка карточек ВСЕх шлюзов сервера */}
{/* Сетка карточек шлюзов для этого community */}
<div className="row g-3">
{server.gateways.map((gw, idx) => {
const isActive = activeGw === gw.name;
@@ -472,7 +474,8 @@ function EasySwitchManager() {
transition: 'all 0.15s ease',
border: isActive ? '2px solid var(--tblr-primary)' : '1px solid rgba(0,0,0,0.1)',
borderRadius: '8px',
boxShadow: isActive ? '0 4px 12px rgba(32, 107, 196, 0.3)' : 'none'
boxShadow: isActive ? '0 4px 12px rgba(32, 107, 196, 0.3)' : 'none',
position: 'relative'
}}
onClick={() => handleGatewaySelect(server.id, comm.value, gw.name)}
onMouseEnter={(e) => {
@@ -489,30 +492,44 @@ function EasySwitchManager() {
}}
>
<div className="card-body p-3">
{/* Галочка и метка Fastest */}
<div className="d-flex align-items-start justify-content-between mb-2">
{/* Галочка (абсолютное позиционирование) */}
{isActive && (
<div
className="bg-white text-primary rounded-circle d-flex align-items-center justify-content-center"
style={{
width: '24px',
height: '24px',
position: 'absolute',
top: '12px',
right: '12px'
}}
>
<IconCheck size={16} />
</div>
)}
{/* Метка Fastest */}
<div className="mb-2" style={{ minHeight: '24px' }}>
{isFastest && !isActive && (
<span className="badge bg-yellow-lt text-yellow d-inline-flex align-items-center" style={{ fontSize: '0.75rem', padding: '4px 8px' }}>
<IconBolt size={14} className="me-1" />
Fast
</span>
)}
{!isFastest && <span></span>}
{isActive && (
<div
className="bg-white text-primary rounded-circle d-flex align-items-center justify-content-center"
style={{ width: '24px', height: '24px' }}
>
<IconCheck size={16} />
</div>
)}
</div>
{/* Название шлюза */}
<div className={`fw-bold mb-2 ${isActive ? 'text-white' : ''}`} style={{ fontSize: '1rem' }}>
<div className={`fw-bold mb-1 ${isActive ? 'text-white' : ''}`} style={{ fontSize: '1rem' }}>
{gw.name}
</div>
{/* Описание шлюза */}
{gw.comment && (
<div className={`small mb-2 ${isActive ? 'text-white' : 'text-muted'}`} style={{ fontSize: '0.8rem', opacity: isActive ? 0.8 : 1 }}>
{gw.comment}
</div>
)}
{/* Протокол */}
<div className={`small mb-2 ${isActive ? 'text-white' : 'text-muted'}`} style={{ fontSize: '0.85rem', opacity: isActive ? 0.85 : 1 }}>
{serverMeta?.provider || 'vless / xudp'}
@@ -529,10 +546,12 @@ function EasySwitchManager() {
})}
</div>
</div>
</div>
);
})}
</div>
</div>
</div>
);
})}
</div>