From 14d20895ad113aea1ed1372714f908e4727b3060 Mon Sep 17 00:00:00 2001 From: Erwin Dondorp Date: Mon, 9 May 2022 01:10:18 +0200 Subject: [PATCH] ARTEMIS-3821 provide readable version of absoluteExpiryTime (and more) --- .../webapp/plugin/js/components/browse.js | 32 ++++++++++++++++--- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js index f32b2f66a3..3bc8449efd 100644 --- a/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js +++ b/artemis-hawtio/artemis-plugin/src/main/webapp/plugin/js/components/browse.js @@ -511,7 +511,15 @@ var Artemis; if (isNaN(type) || typeof type !== "number") { return type; } - return type > -1 && type < 8 ? typeLabels[type] : type + return type > -1 && type < typeLabels.length ? typeLabels[type] : type + } + + var jmsTypeLabels = ["message", "object", "map", "bytes", "stream", "text"]; + function formatJmsType(type) { + if (isNaN(type) || typeof type !== "number") { + return type; + } + return type > -1 && type < jmsTypeLabels.length ? jmsTypeLabels[type] : type } var bindingTypeLabels = ["local-queue", "remote-queue", "divert"]; @@ -519,7 +527,15 @@ var Artemis; if (isNaN(type) || typeof type !== "number") { return type; } - return type > -1 && type < 3 ? bindingTypeLabels[type] : type + return type > -1 && type < bindingTypeLabels.length ? bindingTypeLabels[type] : type + } + + var destTypeLabels = ["queue", "topic", "temp-queue", "temp-topic"]; + function formatDestType(type) { + if (isNaN(type) || typeof type !== "number") { + return type; + } + return type > -1 && type < destTypeLabels.length ? destTypeLabels[type] : type } ctrl.refresh = function() { @@ -832,7 +848,7 @@ var Artemis; if (isNaN(enc) || typeof enc !== "number") { return enc; } - return enc > -1 && enc < 9 ? amqpEncodingLabels[enc] : enc; + return enc > -1 && enc < amqpEncodingLabels.length ? amqpEncodingLabels[enc] : enc; } var routingTypes = ["multicast", "anycast"]; @@ -840,7 +856,7 @@ var Artemis; if (isNaN(rt) || typeof rt !== "number") { return enc; } - return rt > -1 && rt < 2 ? routingTypes[rt] : rt; + return rt > -1 && rt < routingTypes.length ? routingTypes[rt] : rt; } function createProperties(message) { @@ -864,8 +880,16 @@ var Artemis; v2 += " (" + formatRoutingType(v2) + ")"; } else if(k2 === "extraProperties._AMQ_ACTUAL_EXPIRY") { v2 += " (" + formatTimestamp(v2) + ")"; + } else if(k2 === "messageAnnotations.x-opt-jms-dest") { + v2 += " (" + formatDestType(v2) + ")"; + } else if(k2 === "messageAnnotations.x-opt-jms-reply-to") { + v2 += " (" + formatDestType(v2) + ")"; + } else if(k2 === "messageAnnotations.x-opt-jms-msg-type") { + v2 += " (" + formatJmsType(v2) + ")"; } else if(k2 === "messageAnnotations.x-opt-ACTUAL-EXPIRY") { v2 += " (" + formatTimestamp(v2) + ")"; + } else if(k2 === "properties.absoluteExpiryTime") { + v2 += " (" + formatTimestamp(v2) + ")"; } else if(k2 === "properties.creationTime") { v2 += " (" + formatTimestamp(v2) + ")"; } else if(k2 === "__HDR_BROKER_IN_TIME") {