feat(network-map): add force option to speed request for manual refresh and improved testing
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m13s
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m13s
This commit is contained in:
@@ -300,9 +300,10 @@ export default function NetworkMapDashboard() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Запросить скорость для всех соединений или подмножества.
|
* Запросить скорость для всех соединений или подмножества.
|
||||||
|
* Если передать force=true, принудительно выполняет новый speed-test (игнорируя кеш на бэкенде).
|
||||||
*/
|
*/
|
||||||
const requestSpeeds = useCallback(async (options = {}) => {
|
const requestSpeeds = useCallback(async (options = {}) => {
|
||||||
const { connections: targetConnections } = options;
|
const { connections: targetConnections, force = false } = options;
|
||||||
const sourceConnections =
|
const sourceConnections =
|
||||||
Array.isArray(targetConnections) && targetConnections.length > 0 ? targetConnections : connections;
|
Array.isArray(targetConnections) && targetConnections.length > 0 ? targetConnections : connections;
|
||||||
const withSpeed = sourceConnections.filter(
|
const withSpeed = sourceConnections.filter(
|
||||||
@@ -320,6 +321,7 @@ export default function NetworkMapDashboard() {
|
|||||||
{
|
{
|
||||||
serverId: c.speedTestServerId,
|
serverId: c.speedTestServerId,
|
||||||
interfaceName: c.interfaceName,
|
interfaceName: c.interfaceName,
|
||||||
|
forceRefresh: true, // ручной запуск со страницы карты сети всегда должен делать новый замер
|
||||||
},
|
},
|
||||||
{ timeout: 120000 }
|
{ timeout: 120000 }
|
||||||
);
|
);
|
||||||
@@ -367,7 +369,7 @@ export default function NetworkMapDashboard() {
|
|||||||
const handleRefreshSpeedForConnection = useCallback(
|
const handleRefreshSpeedForConnection = useCallback(
|
||||||
(connection) => {
|
(connection) => {
|
||||||
if (!connection) return;
|
if (!connection) return;
|
||||||
requestSpeeds({ connections: [connection] });
|
requestSpeeds({ connections: [connection], force: true });
|
||||||
},
|
},
|
||||||
[requestSpeeds]
|
[requestSpeeds]
|
||||||
);
|
);
|
||||||
@@ -386,7 +388,7 @@ export default function NetworkMapDashboard() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const handleRefreshSpeeds = () => {
|
const handleRefreshSpeeds = () => {
|
||||||
requestSpeeds();
|
requestSpeeds({ force: true });
|
||||||
};
|
};
|
||||||
|
|
||||||
if (loading) {
|
if (loading) {
|
||||||
|
|||||||
Reference in New Issue
Block a user