fix: Обновление фильтрации и валидации в компонентах ASNsNewManager, AutoUrlManager, DomainsNewManager, IPRangesManager и FilterManager. Добавлена проверка на null для предотвращения ошибок и улучшения стабильности приложения.
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m40s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 1m40s
This commit is contained in:
@@ -365,9 +365,10 @@ function ASNsNewManager() {
|
||||
|
||||
// Локальная фильтрация и пагинация
|
||||
const filtered = sortedItems.filter(i => {
|
||||
if (!i) return false;
|
||||
const byCommunity = !filterCommunity || i.community === filterCommunity;
|
||||
const term = String(searchTerm || '').toLowerCase();
|
||||
const bySearch = !term || String(i.asn).toLowerCase().includes(term);
|
||||
const bySearch = !term || String(i.asn || '').toLowerCase().includes(term);
|
||||
return byCommunity && bySearch;
|
||||
});
|
||||
const totalPages = Math.max(1, Math.ceil(filtered.length / pageSize));
|
||||
@@ -375,7 +376,7 @@ function ASNsNewManager() {
|
||||
|
||||
// Подгружаем имена ASN из кэша/внешних API (после вычисления paginatedItems)
|
||||
useEffect(() => {
|
||||
const visible = paginatedItems.map(i => i.asn);
|
||||
const visible = paginatedItems.filter(i => i != null).map(i => i.asn).filter(asn => asn != null);
|
||||
visible.forEach(async (asn) => {
|
||||
const cached = getAsnNameSync(asn);
|
||||
if (cached !== null && typeof cached !== 'undefined') {
|
||||
@@ -388,7 +389,7 @@ function ASNsNewManager() {
|
||||
}, [JSON.stringify(paginatedItems)]);
|
||||
|
||||
// Для фильтра - список всех уникальных community
|
||||
const allCommunities = Array.from(new Set(items.map(i => String(i.community))));
|
||||
const allCommunities = Array.from(new Set(items.filter(i => i != null).map(i => String(i.community || '')).filter(c => c !== '')));
|
||||
|
||||
// Сортировка по клику
|
||||
const handleSort = (field) => {
|
||||
|
||||
Reference in New Issue
Block a user