From c670d9d6746a86f57b371794a223ad2d0167fe85 Mon Sep 17 00:00:00 2001 From: Ulrich Schulte Date: Fri, 15 Jan 2021 14:56:29 +0100 Subject: [PATCH 1/2] #1287: show content-type and content-length for requests in http traces --- .../views/instances/httptrace/i18n.de.json | 6 +++-- .../views/instances/httptrace/i18n.en.json | 6 +++-- .../views/instances/httptrace/i18n.fr.json | 6 +++-- .../views/instances/httptrace/i18n.is.json | 6 +++-- .../views/instances/httptrace/i18n.ko.json | 6 +++-- .../views/instances/httptrace/i18n.pt-BR.json | 6 +++-- .../views/instances/httptrace/i18n.ru.json | 6 +++-- .../views/instances/httptrace/i18n.zh-CN.json | 6 +++-- .../views/instances/httptrace/i18n.zh-TW.json | 6 +++-- .../views/instances/httptrace/index.vue | 24 +++++++++++++++---- .../views/instances/httptrace/traces-list.vue | 14 +++++++---- 11 files changed, 66 insertions(+), 26 deletions(-) diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.de.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.de.json index 0aabcc4cf2c..8638ffce6b6 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.de.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.de.json @@ -10,7 +10,8 @@ "successful_requests": "Erfolgreiche Anfragen", "total_requests": "Anfragen insgesamt" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", "fetching_failed": "Das Laden der Tracing-Informationen ist fehlgeschlagen.", "limit": "Limit", "filter": { @@ -19,7 +20,8 @@ "server_errors": "Server-Fehler", "success": "erfolgreich" }, - "length": "Größe", + "length_response": "Response Größe", + "length_request": "Request Größe", "method": "Methode", "no_traces_found": "Keine Traces gefunden.", "status": "Status", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.en.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.en.json index d37a782a8ad..0c0e6d5de05 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.en.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.en.json @@ -10,7 +10,9 @@ "successful_requests": "successful requests", "total_requests": "total requests" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", + "length_request": "Request Length", "fetching_failed": "Fetching traces failed.", "limit": "limit", "filter": { @@ -19,7 +21,7 @@ "server_errors": "server errors", "success": "success" }, - "length": "Length", + "length_response": "Response Length", "method": "Method", "no_traces_found": "No traces found.", "status": "Status", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json index 36d4d73b510..4ae7ed59da1 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json @@ -10,7 +10,9 @@ "successful_requests": "requêtes en succès", "total_requests": "requêtes au total" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", + "length_request": "Request Longueur", "fetching_failed": "Echec de la récupération des traces HTTP.", "limit": "limite", "filter": { @@ -19,7 +21,7 @@ "server_errors": "Erreurs serveurs", "success": "succès" }, - "length": "Longueur", + "length_response": "Longueur", "method": "Methodes", "no_traces_found": "Aucune traces trouvées.", "status": "Statut", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.is.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.is.json index 21e6c59a9ee..501b64ac299 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.is.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.is.json @@ -10,7 +10,9 @@ "successful_requests": "Farsælar fyrirspurnir", "total_requests": "Samtals fyrirspurnir" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", + "length_request": "Request Length", "fetching_failed": "Mistókst að sækja upplýsingar um HTTP spor.", "limit": "Takmörkun", "filter": { @@ -19,7 +21,7 @@ "server_errors": "Vandamál þjóns", "success": "farsælt" }, - "length": "Stærð", + "length_response": "Response Stærð", "method": "Aðferð", "no_traces_found": "Fundið engin spor.", "status": "Staða", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ko.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ko.json index 43baf33955a..6a74c655ec5 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ko.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ko.json @@ -10,7 +10,9 @@ "successful_requests": "성공적인 요청", "total_requests": "전체 요청" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", + "length_request": "Request 길이", "fetching_failed": "트레이스 정보를 가져오는데 실패했습니다.", "limit": "제한", "filter": { @@ -19,7 +21,7 @@ "server_errors": "서버 에러", "success": "성공" }, - "length": "길이", + "length_response": "Response 길이", "method": "Method", "no_traces_found": "트레이스 정보가 없습니다.", "status": "상태", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.pt-BR.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.pt-BR.json index 4d7dc1ac5ce..a96677f4279 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.pt-BR.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.pt-BR.json @@ -10,7 +10,9 @@ "successful_requests": "Requisições sucedidas", "total_requests": "total de requisições" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", + "length_request": "Request Length", "fetching_failed": "Falha na busca de traces.", "limit": "limite", "filter": { @@ -19,7 +21,7 @@ "server_errors": "erros do servidor", "success": "sucesso" }, - "length": "Tamanho", + "length_response": "Response Tamanho", "method": "Metodo", "no_traces_found": "Nenhum trace encontrado.", "status": "Status", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ru.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ru.json index 9630332cad4..e48347fea50 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ru.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.ru.json @@ -10,7 +10,9 @@ "successful_requests": "успешные запросы", "total_requests": "всего запросов" }, - "content_type": "Content-Type", + "content_type_response": "Response Content-Type", + "content_type_request": "Request Content-Type", + "length_request": "Request Длина", "fetching_failed": "Ошибка трассировки.", "limit": "ограничение", "filter": { @@ -19,7 +21,7 @@ "server_errors": "ошибки сервера", "success": "успех" }, - "length": "Длина", + "length_response": "Response Длина", "method": "Метод", "no_traces_found": "Трассировка не найдена.", "status": "Статус", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-CN.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-CN.json index 2ae53eea0cf..d8f61f121c5 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-CN.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-CN.json @@ -10,7 +10,9 @@ "successful_requests": "请求成功", "total_requests": "请求总数" }, - "content_type": "内容类型", + "content_type_response": "Response 内容类型", + "content_type_request": "Request 内容类型", + "length_request": "Request 长度", "fetching_failed": "获取跟踪信息失败。", "limit": "limit", "filter": { @@ -19,7 +21,7 @@ "server_errors": "服务器错误", "success": "请求成功" }, - "length": "长度", + "length_response": "Response 长度", "method": "方法", "no_traces_found": "没有跟踪信息。", "status": "状态", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-TW.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-TW.json index 40e17265243..50ad7aef785 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-TW.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.zh-TW.json @@ -10,7 +10,9 @@ "successful_requests": "請求成功", "total_requests": "請求總數" }, - "content_type": "內容類型", + "content_type_response": "Response 內容類型", + "content_type_request": "Request 內容類型", + "length_request": "Request 長度", "fetching_failed": "抓取追蹤信息失敗。", "limit": "limit", "filter": { @@ -19,7 +21,7 @@ "server_errors": "伺服器錯誤", "success": "請求成功" }, - "length": "長度", + "length_response": "Response 長度", "method": "方法", "no_traces_found": "沒有追蹤信息。", "status": "狀態", diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/index.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/index.vue index 47d873f2f35..ab29482ee74 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/index.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/index.vue @@ -134,16 +134,32 @@ const addToFilter = (oldFilter, addedFilter) => return `${this.timestamp.valueOf()}-${this.request.method}-${this.request.uri}`; } - get contentLength() { - const contentLength = this.response && this.response.headers['content-length'] && this.response.headers['content-length'][0]; + get contentLengthResponse() { + return this.extractContentLength(this.response); + } + + get contentLengthRequest() { + return this.extractContentLength(this.request); + } + + extractContentLength(origin) { + const contentLength = origin && origin.headers['content-length'] && origin.headers['content-length'][0]; if (contentLength && /^\d+$/.test(contentLength)) { return parseInt(contentLength); } return null; } - get contentType() { - const contentType = this.response && this.response.headers['content-type'] && this.response.headers['content-type'][0]; + get contentTypeResponse() { + return this.extractContentType(this.response); + } + + get contentTypeRequest() { + return this.extractContentType(this.request); + } + + extractContentType(origin) { + const contentType = origin && origin.headers['content-type'] && origin.headers['content-type'][0]; if (contentType) { const idx = contentType.indexOf(';'); return idx >= 0 ? contentType.substring(0, idx) : contentType; diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/traces-list.vue b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/traces-list.vue index e589cbade52..eb4e6a518c1 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/traces-list.vue +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/traces-list.vue @@ -22,8 +22,10 @@ - - + + + + @@ -50,9 +52,13 @@ :class="{ 'is-muted' : trace.isPending(), 'is-success' : trace.isSuccess(), 'is-warning' : trace.isClientError(), 'is-danger' : trace.isServerError() }" /> - + + + Date: Fri, 15 Jan 2021 15:08:53 +0100 Subject: [PATCH 2/2] #1287: show content-type and content-length for requests in http traces --- .../src/main/frontend/views/instances/httptrace/i18n.fr.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json index 4ae7ed59da1..a1d09e70df3 100644 --- a/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json +++ b/spring-boot-admin-server-ui/src/main/frontend/views/instances/httptrace/i18n.fr.json @@ -21,7 +21,7 @@ "server_errors": "Erreurs serveurs", "success": "succès" }, - "length_response": "Longueur", + "length_response": "Response Longueur", "method": "Methodes", "no_traces_found": "Aucune traces trouvées.", "status": "Statut",