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


The following commit(s) were added to refs/heads/main by this push:
     new 4179de9  ARTEMIS-3632 add absolute timestamp for expiry times (after 
the relative timestamp, only in the details panel)
     new 47b2d4a  This closes #3903
4179de9 is described below

commit 4179de9e36abe56fbc0092304e54c2994a29ad26
Author: Erwin Dondorp <[email protected]>
AuthorDate: Thu Dec 23 17:41:04 2021 +0100

    ARTEMIS-3632 add absolute timestamp for expiry times (after the relative 
timestamp, only in the details panel)
---
 .../src/main/webapp/plugin/js/components/browse.js     | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 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 919a375..1131008 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
@@ -303,7 +303,7 @@ var Artemis;
                 itemField: 'expiration',
                 header: 'Expires',
                 templateFn: function(value) {
-                    return formatExpires(value);
+                    return formatExpires(value, false);
                 }
             },
             {
@@ -464,7 +464,7 @@ var Artemis;
             return (value < 10 ? '0' : '') + value;
         }
 
-        function formatExpires(timestamp) {
+        function formatExpires(timestamp, addTimestamp) {
              if (isNaN(timestamp) || typeof timestamp !== "number") {
                 return timestamp;
              }
@@ -477,12 +477,18 @@ var Artemis;
                 var hours = pad2(Math.floor((duration / MS_PER_HOUR) % 24));
                 var mins  = pad2(Math.floor((duration / MS_PER_MIN) % 60));
                 var secs  = pad2(Math.floor((duration / MS_PER_SEC) % 60));
+                var ret;
                 if (expiresIn < 0) {
                    // "HH:mm:ss ago"
-                   return hours + ":" + mins + ":" + secs + " ago";
+                   ret = hours + ":" + mins + ":" + secs + " ago";
+                } else {
+                   // "in HH:mm:ss"
+                   ret = "in " + hours + ":" + mins + ":" + secs;
+                }
+                if (addTimestamp) {
+                   ret += ", at " + formatTimestamp(timestamp);
                 }
-                // "in HH:mm:ss"
-                return "in " + hours + ":" + mins + ":" + secs;
+                return ret;
              }
              return formatTimestamp(timestamp);
           }
@@ -804,7 +810,7 @@ var Artemis;
             angular.forEach(message, function (value, key) {
                 if (!_.some(ignoreColumns, function (k) { return k === key; }) 
&& !_.some(flattenColumns, function (k) { return k === key; })) {
                     if(key === "expiration") {
-                        value += " (" + formatExpires(value) + ")";
+                        value += " (" + formatExpires(value, true) + ")";
                     } else if(key === "persistentSize") {
                         value += " (" + formatPersistentSize(value) + ")";
                     } else if(key === "timestamp") {

Reply via email to