feat: Enhance backend API with pagination and validation for ASNs, Domains, and IP Ranges, and update frontend managers to support new API structure for improved data handling and user experience
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 2m14s
Publish Fast Tabler Docker image / build-and-push-fast (push) Failing after 2m14s
This commit is contained in:
1 parent
1fb53c3467
commit
d25e8fc810
5 files changed
+253
-45
No files matched your search
@@ -95,8 +95,9 @@ function ASNsNewManager() {
|
||||
const fetchItems = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/asns`);
|
||||
const mapped = response.data.map(item => ({ asn: item.domain, community: item.type }));
|
||||
const response = await axios.get(`${API_URL}/asns`, { params: { offset: 0, limit: 0 } });
|
||||
const payload = Array.isArray(response.data?.items) ? response.data.items : (Array.isArray(response.data) ? response.data : []);
|
||||
const mapped = payload.map(item => ({ asn: item.domain, community: item.type }));
|
||||
setItems(mapped);
|
||||
setOriginalItems(mapped);
|
||||
setEtag(response.headers?.etag || '');
|
||||
|
||||
@@ -100,9 +100,10 @@ function DomainsNewManager() {
|
||||
const fetchItems = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/domains-new`);
|
||||
setItems(response.data);
|
||||
setOriginalItems(response.data);
|
||||
const response = await axios.get(`${API_URL}/domains-new`, { params: { offset: 0, limit: 0 } });
|
||||
const payload = Array.isArray(response.data?.items) ? response.data.items : (Array.isArray(response.data) ? response.data : []);
|
||||
setItems(payload);
|
||||
setOriginalItems(payload);
|
||||
setEtag(response.headers?.etag || '');
|
||||
setLastModified(response.headers?.['last-modified'] || '');
|
||||
const lengthHeader = response.headers?.['content-length-source'];
|
||||
|
||||
@@ -111,9 +111,10 @@ function IPRangesManager() {
|
||||
const fetchItems = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const response = await axios.get(`${API_URL}/ip-ranges`);
|
||||
setItems(response.data);
|
||||
setOriginalItems(response.data);
|
||||
const response = await axios.get(`${API_URL}/ip-ranges`, { params: { offset: 0, limit: 0 } });
|
||||
const payload = Array.isArray(response.data?.items) ? response.data.items : (Array.isArray(response.data) ? response.data : []);
|
||||
setItems(payload);
|
||||
setOriginalItems(payload);
|
||||
setEtag(response.headers?.etag || '');
|
||||
setLastModified(response.headers?.['last-modified'] || '');
|
||||
const lengthHeader = response.headers?.['content-length-source'];
|
||||
|
||||
Reference in new issue
Block a user