feat: Add server availability check API and integrate it into the Dashboard and ServerManager components for enhanced server monitoring and user experience
Publish Fast Tabler Docker image / build-and-push-fast (push) Has been cancelled
Publish Fast Tabler Docker image / build-and-push-fast (push) Has been cancelled
This commit is contained in:
@@ -84,6 +84,7 @@ function Dashboard() {
|
||||
axios.get('/api/ip-ranges'),
|
||||
axios.get('/api/asns'),
|
||||
axios.get('/api/servers'),
|
||||
axios.get('/api/servers/availability'),
|
||||
axios.get('/api/s3/last-modified')
|
||||
]);
|
||||
|
||||
@@ -92,7 +93,8 @@ function Dashboard() {
|
||||
const ipRangesRes = results[1];
|
||||
const asnsRes = results[2];
|
||||
const serversRes = results[3];
|
||||
const s3Res = results[4];
|
||||
const availabilityRes = results[4];
|
||||
const s3Res = results[5];
|
||||
|
||||
// Получаем данные серверов для подсчета дополнительной статистики
|
||||
const domains = domainsRes.status === 'fulfilled' ? domainsRes.value.data : [];
|
||||
@@ -102,7 +104,7 @@ function Dashboard() {
|
||||
setRaw({ domains, ipRanges, asns, servers });
|
||||
const countries = new Set(servers.map(server => server.country).filter(Boolean));
|
||||
const providers = new Set(servers.map(server => server.provider).filter(Boolean));
|
||||
const onlineServers = servers.filter(server => server.status === 'Онлайн').length;
|
||||
const onlineServers = availabilityRes.status === 'fulfilled' ? (availabilityRes.value.data?.online || 0) : (servers.filter(server => server.status === 'Онлайн').length);
|
||||
|
||||
// Получаем дату последнего обновления
|
||||
// Новый формат: объект с ключами { domainsNew, asns, servers, filters, ipRanges }
|
||||
|
||||
Reference in New Issue
Block a user