You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by jb...@apache.org on 2022/12/19 13:54:02 UTC

[activemq-artemis] branch main updated (47bcf5b73c -> 6a9e8afbec)

This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git


    from 47bcf5b73c This closes #4060
     new 97bc2ee6ed ARTEMIS-4120 start using a generic function instead
     new 6a9e8afbec ARTEMIS-4120 format mqtt.qos.level

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../src/main/webapp/plugin/js/components/browse.js | 75 ++++++++--------------
 1 file changed, 25 insertions(+), 50 deletions(-)


[activemq-artemis] 01/02: ARTEMIS-4120 start using a generic function instead

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 97bc2ee6ed50fcff1e929fdb45e80e3826ea60ee
Author: Erwin Dondorp <er...@cgi.com>
AuthorDate: Mon Dec 19 01:36:36 2022 +0100

    ARTEMIS-4120 start using a generic function instead
---
 .../src/main/webapp/plugin/js/components/browse.js | 71 +++++++---------------
 1 file changed, 21 insertions(+), 50 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 4249973cc5..941e42629d 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
@@ -280,7 +280,7 @@ var Artemis;
                 itemField: 'type',
                 header: 'Type',
                 templateFn: function(value) {
-                    return formatType(value);
+                    return formatWithList(value, typeLabels);
                 }
             },
             {
@@ -507,37 +507,26 @@ var Artemis;
              return d.getFullYear() + "-" + pad2(d.getMonth() + 1) + "-" + pad2(d.getDate()) + " " + pad2(d.getHours()) + ":" + pad2(d.getMinutes()) + ":" + pad2(d.getSeconds());
           }
 
-        var typeLabels = ["default", "1", "object", "text", "bytes", "map", "stream", "embedded"];
-        function formatType(type) {
-            if (isNaN(type) || typeof type !== "number") {
-                return type;
+        function formatWithList(value, valueLabels) {
+            if (isNaN(value) || typeof value !== "number") {
+                return value;
             }
-            return type > -1 && type < typeLabels.length ? typeLabels[type] : type
+            return value > -1 && value < valueLabels.length ? valueLabels[value] : value
         }
 
+        var typeLabels = ["default", "1", "object", "text", "bytes", "map", "stream", "embedded"];
+
         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"];
-        function formatBindingType(type) {
-            if (isNaN(type) || typeof type !== "number") {
-                return 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
-        }
+
+        var amqpEncodingLabels = [
+            "amqp-unknown", "amqp-null", "amqp-data", "amqp-sequence", "amqp-value-null",
+            "amqp-value-string", "amqp-value-binary", "amqp-value-map", "amqp-value-list"];
+
+        var routingTypes = ["multicast", "anycast"];
 
         ctrl.refresh = function() {
             Artemis.log.debug(ctrl.filter)
@@ -833,7 +822,7 @@ var Artemis;
                     } else if(key === "timestamp") {
                         value += " (" + formatTimestamp(value) + ")";
                     } else if(key === "type") {
-                        value += " (" + formatType(value) + ")";
+                        value += " (" + formatWithList(value, typeLabels) + ")";
                     }
                     headers.push({key: key, value: value});
                 }
@@ -842,24 +831,6 @@ var Artemis;
         }
 
 
-        var amqpEncodingLabels = [
-            "amqp-unknown", "amqp-null", "amqp-data", "amqp-sequence", "amqp-value-null",
-            "amqp-value-string", "amqp-value-binary", "amqp-value-map", "amqp-value-list"];
-        function formatAmqpEncoding(enc) {
-            if (isNaN(enc) || typeof enc !== "number") {
-                return enc;
-            }
-            return enc > -1 && enc < amqpEncodingLabels.length ? amqpEncodingLabels[enc] : enc;
-        }
-
-        var routingTypes = ["multicast", "anycast"];
-        function formatRoutingType(rt) {
-            if (isNaN(rt) || typeof rt !== "number") {
-                return enc;
-            }
-            return rt > -1 && rt < routingTypes.length ? routingTypes[rt] : rt;
-        }
-
         function createProperties(message) {
             var properties = [];
             angular.forEach(message, function (value, key) {
@@ -868,25 +839,25 @@ var Artemis;
                     angular.forEach(value, function (v2, k2) {
                     Artemis.log.debug("key=" + k2 + " value=" + v2);
                         if(k2 === "_AMQ_Binding_Type") {
-                            v2 += " (" + formatBindingType(v2) + ")";
+                            v2 += " (" + formatWithList(v2, bindingTypeLabels) + ")";
                         } else if(k2 === "JMS_AMQP_ORIGINAL_ENCODING") {
-                            v2 += " (" + formatAmqpEncoding(v2) + ")";
+                            v2 += " (" + formatWithList(v2, amqpEncodingLabels) + ")";
                         } else if(k2 === "_AMQ_ACTUAL_EXPIRY") {
                             v2 += " (" + formatTimestamp(v2) + ")";
                         } else if(k2 === "_AMQ_NotifTimestamp") {
                             v2 += " (" + formatTimestamp(v2) + ")";
                         } else if(k2 === "_AMQ_ROUTING_TYPE") {
-                            v2 += " (" + formatRoutingType(v2) + ")";
+                            v2 += " (" + formatWithList(v2, routingTypes) + ")";
                         } else if(k2 === "_AMQ_ORIG_ROUTING_TYPE") {
-                            v2 += " (" + formatRoutingType(v2) + ")";
+                            v2 += " (" + formatWithList(v2, routingTypes) + ")";
                         } else if(k2 === "extraProperties._AMQ_ACTUAL_EXPIRY") {
                             v2 += " (" + formatTimestamp(v2) + ")";
                         } else if(k2 === "messageAnnotations.x-opt-jms-dest") {
-                            v2 += " (" + formatDestType(v2) + ")";
+                            v2 += " (" + formatWithList(v2, destTypeLabels) + ")";
                         } else if(k2 === "messageAnnotations.x-opt-jms-reply-to") {
-                            v2 += " (" + formatDestType(v2) + ")";
+                            v2 += " (" + formatWithList(v2, destTypeLabels) + ")";
                         } else if(k2 === "messageAnnotations.x-opt-jms-msg-type") {
-                            v2 += " (" + formatJmsType(v2) + ")";
+                            v2 += " (" + formatWithList(v2, jmsTypeLabels) + ")";
                         } else if(k2 === "messageAnnotations.x-opt-ACTUAL-EXPIRY") {
                             v2 += " (" + formatTimestamp(v2) + ")";
                         } else if(k2 === "properties.absoluteExpiryTime") {


[activemq-artemis] 02/02: ARTEMIS-4120 format mqtt.qos.level

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbertram pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git

commit 6a9e8afbeccfab18e4e8ca937b6e54129e284ad4
Author: Erwin Dondorp <er...@cgi.com>
AuthorDate: Mon Dec 19 01:36:57 2022 +0100

    ARTEMIS-4120 format mqtt.qos.level
---
 .../artemis-plugin/src/main/webapp/plugin/js/components/browse.js     | 4 ++++
 1 file changed, 4 insertions(+)

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 941e42629d..9ac1f19faf 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
@@ -528,6 +528,8 @@ var Artemis;
 
         var routingTypes = ["multicast", "anycast"];
 
+        var mqttQosTypes = ["at most once", "at least once", "exactly once"];
+
         ctrl.refresh = function() {
             Artemis.log.debug(ctrl.filter)
             //if refreshing always return to the first page
@@ -866,6 +868,8 @@ var Artemis;
                             v2 += " (" + formatTimestamp(v2) + ")";
                         } else if(k2 === "__HDR_BROKER_IN_TIME") {
                             v2 += " (" + formatTimestamp(v2) + ")";
+                        } else if(k2 === "mqtt.qos.level") {
+                            v2 += " (" + formatWithList(v2, mqttQosTypes) + ")";
                         }
                         properties.push({key: k2, value: v2});
                     });