Refine subscription panel layout and feedback
Build and Deploy Gateway / build-and-push (push) Successful in 19s
Build and Deploy Gateway / deploy (push) Successful in 7s

This commit is contained in:
2026-08-11 07:47:28 +03:00
parent 5cad3e9061
commit 9a8191dc91
7 changed files with 56 additions and 134 deletions
@@ -46,18 +46,6 @@ interface SubscriptionFeatureOptions {
onDismissError: () => void;
}
function operationText(key: OperationKey) {
return ({
profileAdd: 'Добавляем подписку…',
profileRename: 'Переименовываем подписку…',
profileSelect: 'Сохраняем выбор сервера…',
profileActivate: 'Переключаем подписку…',
profileRefresh: 'Обновляем подписку…',
profileDelete: 'Удаляем подписку…',
serverApply: 'Применяем сервер…',
} as Partial<Record<OperationKey, string>>)[key] || '';
}
function profileServer(profile: ProfileSnapshot | undefined, serverId: string) {
return profile?.servers.find((server) => server.id === serverId) || null;
}
@@ -99,11 +87,6 @@ export function useSubscriptionFeature({
: isSubscriptionUrlValid(normalizedUrl) ? 'valid' : 'invalid';
const deleteProfile = profiles.find((profile) => profile.id === deleteId) || null;
const deleteStopsVpn = connected && selection.appliedProfileId === deleteId;
const activeOperation = (Object.entries(operations) as Array<[
OperationKey,
OperationRegistrySnapshot[OperationKey],
]>).find(([, operation]) => operation?.status === 'running');
useEffect(() => {
const ids = new Set(profiles.map((profile) => profile.id));
setExpanded((current) => current.filter((id) => ids.has(id)));
@@ -220,7 +203,6 @@ export function useSubscriptionFeature({
addError,
deleteProfile,
deleteStopsVpn,
activeOperation,
refreshingIds,
revealVersions,
panelRef,
@@ -301,9 +283,7 @@ function AddProfileForm({ feature }: { feature: SubscriptionFeatureController })
onChange={(event) => feature.setUrl(event.target.value)}
/>
</label>
<div className="client-profile-form-status" role="status">
{message || '\u00a0'}
</div>
{message && <div className="client-profile-form-status" role="status">{message}</div>}
<div className="client-profile-form-actions">
{feature.profiles.length > 0 && <button type="button" onClick={feature.cancelAdd}>Отмена</button>}
<button
@@ -482,9 +462,6 @@ export function SubscriptionPanel({
onClick={feature.close}
>×</button>
</header>
<div className={`client-profiles-operation${feature.activeOperation ? ' is-active' : ''}`} role="status">
{feature.activeOperation ? operationText(feature.activeOperation[0]) : '\u00a0'}
</div>
{statusSlot}
<div className="client-profile-list">
{feature.profiles.map((profile) => <ProfileGroup