From a8ee88a660c2bdbd7c60844b288cca0de32b0707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Sun, 18 May 2025 14:18:36 +0200 Subject: [PATCH 1/4] fix: refactor SbaKeyValueTable to use Composition API and add filtering for null values --- .../components/sba-key-value-table.vue | 57 ++++++++++++------- 1 file changed, 36 insertions(+), 21 deletions(-) diff --git a/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue b/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue index ceeb0de01cc..4a44de095b5 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue @@ -1,6 +1,6 @@ - From 98efd485537de82bb125047e9a6f241bc4e39f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Sun, 18 May 2025 14:18:46 +0200 Subject: [PATCH 2/4] fix: enhance details display by adding table styles and skipping null values in key-value table --- .../main/frontend/views/instances/details/details-info.vue | 4 ++-- .../main/frontend/views/instances/details/details-process.vue | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-info.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-info.vue index fc8cc7477bc..d5615083e3e 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-info.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-info.vue @@ -22,8 +22,8 @@ class="border-l-4" :title="$t('term.fetch_failed')" /> -
- +
+
diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue index 0dd658b36af..08e3a5cf0b4 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue @@ -19,7 +19,7 @@
- + From 5b068201bbbdde8ff9d19a2a9c53e58ad134c12a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Sat, 24 May 2025 11:49:50 +0200 Subject: [PATCH 3/4] feat(#4242): gather process information from different locations, when available --- .../instances/details/details-process.vue | 322 +++++++++++------- .../views/instances/details/i18n.de.json | 8 +- .../views/instances/details/i18n.en.json | 2 + .../views/instances/details/i18n.es.json | 9 +- .../views/instances/details/i18n.fr.json | 9 +- .../views/instances/details/i18n.is.json | 8 +- .../views/instances/details/i18n.ko.json | 9 +- .../views/instances/details/i18n.pt-BR.json | 9 +- .../views/instances/details/i18n.ru.json | 9 +- .../views/instances/details/i18n.zh-CN.json | 9 +- .../views/instances/details/i18n.zh-TW.json | 9 +- 11 files changed, 265 insertions(+), 138 deletions(-) diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue index 08e3a5cf0b4..6f1a5300f86 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue @@ -29,148 +29,214 @@ - diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.de.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.de.json index e9303599675..c2d128b492f 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.de.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.de.json @@ -24,6 +24,9 @@ "health": { "title": "Zustand" }, + "health_group": { + "title": "Zustandsgruppe" + }, "info": { "no_info_provided": "Keine Informationen verfügbar.", "title": "Info" @@ -33,7 +36,8 @@ "metaspace": "Metaspace", "size": "Größe", "title": "Speicher", - "used": "In Verwendung" + "used": "In Verwendung", + "committed": "Zugesichert" }, "metadata": { "no_data_provided": "Keine Metadaten vorhanden", @@ -42,6 +46,8 @@ "process": { "cpus": "CPUs", "pid": "PID", + "parent_pid": "Eltern-PID", + "owner": "Besitzer", "process_cpu_usage": "CPU-Auslastung (%)", "system_cpu_usage": "System-Auslastung (%)", "title": "Prozess", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.en.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.en.json index 706c4f3623e..4e1854479d2 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.en.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.en.json @@ -46,6 +46,8 @@ "process": { "cpus": "CPUs", "pid": "PID", + "parent_pid": "Parent PID", + "owner": "Owner", "process_cpu_usage": "Process CPU Usage", "system_cpu_usage": "System CPU Usage", "title": "Process", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.es.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.es.json index 37059a4d3cb..b304981e3d3 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.es.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.es.json @@ -25,6 +25,9 @@ "health": { "title": "Salud" }, + "health_group": { + "title": "Grupo de Salud" + }, "info": { "no_info_provided": "No hay información provista.", "title": "Info" @@ -34,7 +37,8 @@ "metaspace": "Metaspace", "size": "Tamaño", "title": "Memoria", - "used": "Usada" + "used": "Usada", + "committed": "Comprometida" }, "metadata": { "no_data_provided": "No hay metadatos provistos.", @@ -42,8 +46,9 @@ }, "process": { "cpus": "CPUs", - "pid": "PID", + "parent_pid": "PID Padre", + "owner": "Propietario", "process_cpu_usage": "Uso CPU proceso", "system_cpu_usage": "Uso CPU sistema", "title": "Proceso", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.fr.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.fr.json index bd779f4520f..e290b3dc3ca 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.fr.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.fr.json @@ -5,6 +5,7 @@ "cache": { "hit_ratio": "Hit ratio", "hits": "Hits", + "misses": "Échecs", "size": "Taille" }, "datasource": { @@ -23,6 +24,9 @@ "health": { "title": "État" }, + "health_group": { + "title": "Groupe d'État" + }, "info": { "no_info_provided": "Aucune infos fournies.", "title": "Info" @@ -32,7 +36,8 @@ "metaspace": "Métaspace", "size": "Taille", "title": "Memoire", - "used": "Utilisé" + "used": "Utilisé", + "committed": "Engagé" }, "metadata": { "no_data_provided": "Aucune métadonnées fournies.", @@ -41,6 +46,8 @@ "process": { "cpus": "CPUs", "pid": "PID", + "parent_pid": "PID Parent", + "owner": "Propriétaire", "process_cpu_usage": "Usage processus du CPU", "system_cpu_usage": "Usage Système du CPU", "title": "Processus", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.is.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.is.json index 0c01987c85a..0bb4caf4001 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.is.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.is.json @@ -24,6 +24,9 @@ "health": { "title": "Staða" }, + "health_group": { + "title": "Stöðuhópur" + }, "info": { "no_info_provided": "Engar upplýsingar eru í boði.", "title": "Upplýsingar" @@ -33,7 +36,8 @@ "metaspace": "Metaspace", "size": "Stærð", "title": "Geymir", - "used": "I notkun" + "used": "I notkun", + "committed": "Skuldbundið" }, "metadata": { "no_data_provided": "Engin lysigögn i boði.", @@ -42,6 +46,8 @@ "process": { "cpus": "CPUs", "pid": "PID", + "parent_pid": "Foreldri PID", + "owner": "Eigandi", "process_cpu_usage": "CPU notkun (%)", "system_cpu_usage": "Kerfi notkun (%)", "title": "Ferli", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ko.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ko.json index 01e448bff7b..002fad0fe7d 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ko.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ko.json @@ -5,6 +5,7 @@ "cache": { "hit_ratio": "히트율", "hits": "히트", + "misses": "미스", "size": "사이즈" }, "datasource": { @@ -23,6 +24,9 @@ "health": { "title": "상태" }, + "health_group": { + "title": "상태 그룹" + }, "info": { "no_info_provided": "정보가 제공되지 않습니다.", "title": "정보" @@ -32,7 +36,8 @@ "metaspace": "메타스페이스", "size": "사이즈", "title": "메모리", - "used": "사용됨" + "used": "사용됨", + "committed": "커밋됨" }, "metadata": { "no_data_provided": "메타데이터가 제공되지 않습니다.", @@ -41,6 +46,8 @@ "process": { "cpus": "CPU", "pid": "PID", + "parent_pid": "부모 PID", + "owner": "소유자", "process_cpu_usage": "프로세스 CPU 사용량", "system_cpu_usage": "시스템 CPU 사용량", "title": "프로세스", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.pt-BR.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.pt-BR.json index 67e8fa5cc33..0af76433684 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.pt-BR.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.pt-BR.json @@ -5,6 +5,7 @@ "cache": { "hit_ratio": "Hit ratio", "hits": "Hits", + "misses": "Falhas", "size": "Tamanho" }, "datasource": { @@ -23,6 +24,9 @@ "health": { "title": "Integridade" }, + "health_group": { + "title": "Grupo de Integridade" + }, "info": { "no_info_provided": "Nenhuma informação fornecida.", "title": "Info" @@ -32,7 +36,8 @@ "metaspace": "Metaspace", "size": "Tamanho", "title": "Memoria", - "used": "Usado" + "used": "Usado", + "committed": "Comprometido" }, "metadata": { "no_data_provided": "Nenhum metadado fornecido.", @@ -41,6 +46,8 @@ "process": { "cpus": "CPUs", "pid": "PID", + "parent_pid": "PID Pai", + "owner": "Proprietário", "process_cpu_usage": "Uso de Process CPU", "system_cpu_usage": "Uso de System CPU", "title": "Processo", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ru.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ru.json index 4028b0c078c..b5ac9898860 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ru.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.ru.json @@ -5,6 +5,7 @@ "cache": { "hit_ratio": "Коэффициент попадания", "hits": "Попадания", + "misses": "Промахи", "size": "Размер" }, "datasource": { @@ -23,6 +24,9 @@ "health": { "title": "Здоровье" }, + "health_group": { + "title": "Группа здоровья" + }, "info": { "no_info_provided": "Информация не предоставлена.", "title": "Информация" @@ -32,7 +36,8 @@ "metaspace": "Metaspace", "size": "Размер", "title": "Память", - "used": "Используется" + "used": "Используется", + "committed": "Зарезервировано" }, "metadata": { "no_data_provided": "Метаданные не предоставлены.", @@ -41,6 +46,8 @@ "process": { "cpus": "Процессоры", "pid": "PID", + "parent_pid": "Родительский PID", + "owner": "Владелец", "process_cpu_usage": "Использование процессами", "system_cpu_usage": "Использование системой", "title": "Процесс", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-CN.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-CN.json index d461dde01bc..2c780d48a53 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-CN.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-CN.json @@ -5,6 +5,7 @@ "cache": { "hit_ratio": "命中率", "hits": "命中次数", + "misses": "未命中", "size": "粒度" }, "datasource": { @@ -23,6 +24,9 @@ "health": { "title": "健康" }, + "health_group": { + "title": "健康组" + }, "info": { "no_info_provided": "未提供任何信息。", "title": "信息" @@ -32,7 +36,8 @@ "metaspace": "初始空间", "size": "当前可用", "title": "内存", - "used": "已用" + "used": "已用", + "committed": "已提交" }, "metadata": { "no_data_provided": "未提供元数据。", @@ -41,6 +46,8 @@ "process": { "cpus": "CPU核心数", "pid": "进程ID", + "parent_pid": "父进程ID", + "owner": "所有者", "process_cpu_usage": "进程CPU使用率", "system_cpu_usage": "系统CPU使用率", "title": "进程", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-TW.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-TW.json index 41de9555dd8..a04701646b1 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-TW.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/i18n.zh-TW.json @@ -5,6 +5,7 @@ "cache": { "hit_ratio": "命中率", "hits": "命中次數", + "misses": "未命中", "size": "粒度" }, "datasource": { @@ -23,6 +24,9 @@ "health": { "title": "健康" }, + "health_group": { + "title": "健康組" + }, "info": { "no_info_provided": "未提供任何訊息。", "title": "訊息" @@ -32,7 +36,8 @@ "metaspace": "初始空間", "size": "當前可用", "title": "記憶體", - "used": "已用" + "used": "已用", + "committed": "已提交" }, "metadata": { "no_data_provided": "未提供Metadata。", @@ -41,6 +46,8 @@ "process": { "cpus": "CPU核心數", "pid": "Process ID", + "parent_pid": "父程序ID", + "owner": "擁有者", "process_cpu_usage": "ProcessCPU使用率", "system_cpu_usage": "係統CPU使用率", "title": "Process", From 1fe4bebd2b64e62fa6f9beb7491b098a80585638 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Ko=CC=88ninger?= Date: Mon, 26 May 2025 21:15:00 +0200 Subject: [PATCH 4/4] fix: update key-value table to use kebab-case for skipNullValues prop and improve code formatting --- spring-boot-admin-server-ui/package.json | 2 +- .../components/sba-key-value-table.vue | 2 +- .../main/frontend/public/mockServiceWorker.js | 150 +++++++++--------- .../instances/details/details-process.vue | 2 +- 4 files changed, 78 insertions(+), 78 deletions(-) diff --git a/spring-boot-admin-server-ui/package.json b/spring-boot-admin-server-ui/package.json index aecc7bb0b64..cb6fdcccc0e 100644 --- a/spring-boot-admin-server-ui/package.json +++ b/spring-boot-admin-server-ui/package.json @@ -13,7 +13,7 @@ "build-storybook": "storybook build", "lint": "eslint --ext .js,.ts,.vue src/main/frontend", "lint:fix": "eslint --ext .js,.ts,.vue --fix src/main/frontend", - "format": "prettier src/main/frontend", + "format": "prettier src/main/frontend --check", "format:fix": "prettier src/main/frontend --write" }, "dependencies": { diff --git a/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue b/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue index 4a44de095b5..2a551125c85 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/components/sba-key-value-table.vue @@ -27,7 +27,7 @@ const { map, skipNullValues = false } = defineProps<{ const filteredMap = computed(() => { return Object.entries(map) - .filter(([_, value]) => { + .filter(([, value]) => { if (skipNullValues) { return value && value.value !== null; } diff --git a/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js b/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js index 34057e898f7..760cdeb57b3 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js +++ b/spring-boot-admin-server-ui/src/main/frontend/public/mockServiceWorker.js @@ -8,42 +8,42 @@ * - Please do NOT serve this file on production. */ -const PACKAGE_VERSION = '2.7.3' -const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f' -const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') -const activeClientIds = new Set() +const PACKAGE_VERSION = '2.7.3'; +const INTEGRITY_CHECKSUM = '00729d72e3b82faf54ca8b9621dbb96f'; +const IS_MOCKED_RESPONSE = Symbol('isMockedResponse'); +const activeClientIds = new Set(); self.addEventListener('install', function () { - self.skipWaiting() -}) + self.skipWaiting(); +}); self.addEventListener('activate', function (event) { - event.waitUntil(self.clients.claim()) -}) + event.waitUntil(self.clients.claim()); +}); self.addEventListener('message', async function (event) { - const clientId = event.source.id + const clientId = event.source.id; if (!clientId || !self.clients) { - return + return; } - const client = await self.clients.get(clientId) + const client = await self.clients.get(clientId); if (!client) { - return + return; } const allClients = await self.clients.matchAll({ type: 'window', - }) + }); switch (event.data) { case 'KEEPALIVE_REQUEST': { sendToClient(client, { type: 'KEEPALIVE_RESPONSE', - }) - break + }); + break; } case 'INTEGRITY_CHECK_REQUEST': { @@ -53,12 +53,12 @@ self.addEventListener('message', async function (event) { packageVersion: PACKAGE_VERSION, checksum: INTEGRITY_CHECKSUM, }, - }) - break + }); + break; } case 'MOCK_ACTIVATE': { - activeClientIds.add(clientId) + activeClientIds.add(clientId); sendToClient(client, { type: 'MOCKING_ENABLED', @@ -68,68 +68,68 @@ self.addEventListener('message', async function (event) { frameType: client.frameType, }, }, - }) - break + }); + break; } case 'MOCK_DEACTIVATE': { - activeClientIds.delete(clientId) - break + activeClientIds.delete(clientId); + break; } case 'CLIENT_CLOSED': { - activeClientIds.delete(clientId) + activeClientIds.delete(clientId); const remainingClients = allClients.filter((client) => { - return client.id !== clientId - }) + return client.id !== clientId; + }); // Unregister itself when there are no more clients if (remainingClients.length === 0) { - self.registration.unregister() + self.registration.unregister(); } - break + break; } } -}) +}); self.addEventListener('fetch', function (event) { - const { request } = event + const { request } = event; // Bypass navigation requests. if (request.mode === 'navigate') { - return + return; } // Opening the DevTools triggers the "only-if-cached" request // that cannot be handled by the worker. Bypass such requests. if (request.cache === 'only-if-cached' && request.mode !== 'same-origin') { - return + return; } // Bypass all requests when there are no active clients. // Prevents the self-unregistered worked from handling requests // after it's been deleted (still remains active until the next reload). if (activeClientIds.size === 0) { - return + return; } // Generate unique request ID. - const requestId = crypto.randomUUID() - event.respondWith(handleRequest(event, requestId)) -}) + const requestId = crypto.randomUUID(); + event.respondWith(handleRequest(event, requestId)); +}); async function handleRequest(event, requestId) { - const client = await resolveMainClient(event) - const response = await getResponse(event, client, requestId) + const client = await resolveMainClient(event); + const response = await getResponse(event, client, requestId); // Send back the response clone for the "response:*" life-cycle events. // Ensure MSW is active and ready to handle the message, otherwise // this message will pend indefinitely. if (client && activeClientIds.has(client.id)) { - ;(async function () { - const responseClone = response.clone() + (async function () { + const responseClone = response.clone(); sendToClient( client, @@ -146,11 +146,11 @@ async function handleRequest(event, requestId) { }, }, [responseClone.body], - ) - })() + ); + })(); } - return response + return response; } // Resolve the main client for the given event. @@ -158,67 +158,67 @@ async function handleRequest(event, requestId) { // that registered the worker. It's with the latter the worker should // communicate with during the response resolving phase. async function resolveMainClient(event) { - const client = await self.clients.get(event.clientId) + const client = await self.clients.get(event.clientId); if (activeClientIds.has(event.clientId)) { - return client + return client; } if (client?.frameType === 'top-level') { - return client + return client; } const allClients = await self.clients.matchAll({ type: 'window', - }) + }); return allClients .filter((client) => { // Get only those clients that are currently visible. - return client.visibilityState === 'visible' + return client.visibilityState === 'visible'; }) .find((client) => { // Find the client ID that's recorded in the // set of clients that have registered the worker. - return activeClientIds.has(client.id) - }) + return activeClientIds.has(client.id); + }); } async function getResponse(event, client, requestId) { - const { request } = event + const { request } = event; // Clone the request because it might've been already used // (i.e. its body has been read and sent to the client). - const requestClone = request.clone() + const requestClone = request.clone(); function passthrough() { // Cast the request headers to a new Headers instance // so the headers can be manipulated with. - const headers = new Headers(requestClone.headers) + const headers = new Headers(requestClone.headers); // Remove the "accept" header value that marked this request as passthrough. // This prevents request alteration and also keeps it compliant with the // user-defined CORS policies. - const acceptHeader = headers.get('accept') + const acceptHeader = headers.get('accept'); if (acceptHeader) { - const values = acceptHeader.split(',').map((value) => value.trim()) + const values = acceptHeader.split(',').map((value) => value.trim()); const filteredValues = values.filter( (value) => value !== 'msw/passthrough', - ) + ); if (filteredValues.length > 0) { - headers.set('accept', filteredValues.join(', ')) + headers.set('accept', filteredValues.join(', ')); } else { - headers.delete('accept') + headers.delete('accept'); } } - return fetch(requestClone, { headers }) + return fetch(requestClone, { headers }); } // Bypass mocking when the client is not active. if (!client) { - return passthrough() + return passthrough(); } // Bypass initial page load requests (i.e. static assets). @@ -226,11 +226,11 @@ async function getResponse(event, client, requestId) { // means that MSW hasn't dispatched the "MOCK_ACTIVATE" event yet // and is not ready to handle requests. if (!activeClientIds.has(client.id)) { - return passthrough() + return passthrough(); } // Notify the client that a request has been intercepted. - const requestBuffer = await request.arrayBuffer() + const requestBuffer = await request.arrayBuffer(); const clientMessage = await sendToClient( client, { @@ -253,38 +253,38 @@ async function getResponse(event, client, requestId) { }, }, [requestBuffer], - ) + ); switch (clientMessage.type) { case 'MOCK_RESPONSE': { - return respondWithMock(clientMessage.data) + return respondWithMock(clientMessage.data); } case 'PASSTHROUGH': { - return passthrough() + return passthrough(); } } - return passthrough() + return passthrough(); } function sendToClient(client, message, transferrables = []) { return new Promise((resolve, reject) => { - const channel = new MessageChannel() + const channel = new MessageChannel(); channel.port1.onmessage = (event) => { if (event.data && event.data.error) { - return reject(event.data.error) + return reject(event.data.error); } - resolve(event.data) - } + resolve(event.data); + }; client.postMessage( message, [channel.port2].concat(transferrables.filter(Boolean)), - ) - }) + ); + }); } async function respondWithMock(response) { @@ -293,15 +293,15 @@ async function respondWithMock(response) { // instance will have status code set to 0. Since it's not possible to create // a Response instance with status code 0, handle that use-case separately. if (response.status === 0) { - return Response.error() + return Response.error(); } - const mockedResponse = new Response(response.body, response) + const mockedResponse = new Response(response.body, response); Reflect.defineProperty(mockedResponse, IS_MOCKED_RESPONSE, { value: true, enumerable: true, - }) + }); - return mockedResponse + return mockedResponse; } diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue index 6f1a5300f86..7c2081f5e7e 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/details/details-process.vue @@ -19,7 +19,7 @@
- +