ARTEMIS-2987 improve message body display

This commit is contained in:
Justin Bertram 2020-11-18 12:20:51 -06:00 committed by Clebert Suconic
parent bfca1c59de
commit bfc07062a9
2 changed files with 15 additions and 7 deletions

View File

@ -80,15 +80,19 @@ var Artemis;
</div>
<div class="form-group" ng-show="$ctrl.showMessageDetails">
<button class="btn btn-primary" ng-click="$ctrl.showMessageDetails = false">Back</button>
<h2>MessageID: {{$ctrl.currentMessage.messageID}}</h2>
<h2>Headers</h2>
<h4>Message ID: {{$ctrl.currentMessage.messageID}}</h4>
<h4>Displaying body as <span ng-bind="$ctrl.currentMessage.textMode"></span></h4>
<div hawtio-editor="$ctrl.currentMessage.bodyText" read-only="true" mode='mode'></div>
<h4>Headers</h4>
<pf-toolbar config="$ctrl.messageToolbarConfig"></pf-toolbar>
<pf-table-view config="$ctrl.messageTableConfig"
columns="$ctrl.messageTableColumns"
items="$ctrl.currentMessage.headers">
</pf-table-view>
<h2>Properties</h2>
<h4>Properties</h4>
<div ng-show="$ctrl.showMessageDetails">
<pf-toolbar config="$ctrl.messagePToolbarConfig"></pf-toolbar>
<pf-table-view config="$ctrl.messagePTableConfig"
@ -96,9 +100,6 @@ var Artemis;
items="$ctrl.currentMessage.properties">
</pf-table-view>
</div>
<h3>Displaying body as <span ng-bind="$ctrl.currentMessage.textMode"></span></h3>
<div hawtio-editor="$ctrl.currentMessage.bodyText" read-only="true" mode='mode'></div>
</div>
<div hawtio-confirm-dialog="$ctrl.deleteDialog" title="Delete messages?"
@ -597,7 +598,7 @@ var Artemis;
var bytesArr = [];
var textArr = [];
message.BodyPreview.forEach(function(b) {
if (code === 1 || code === 2) {
if (code === 1 || code === 2 || code === 16) {
// text
textArr.push(String.fromCharCode(b));
}
@ -622,6 +623,12 @@ var Artemis;
var lenTxt = "" + textArr.length;
body = "bytes:\n" + bytesData + "\n\ntext:\n" + textData;
message.textMode = "bytes (" + len + " bytes) and text (" + lenTxt + " chars)";
} else if (code === 16) {
// text only
var len = message.BodyPreview.length;
var lenTxt = "" + textArr.length;
body = "text:\n" + textData;
message.textMode = "text (" + lenTxt + " chars)";
} else {
// bytes only
var len = message.BodyPreview.length;

View File

@ -97,6 +97,7 @@ var Artemis;
<div class="col-md-6">
<select id="ArtemisBrowseBytesMessages" class="form-control" ng-model="ArtemisBrowseBytesMessages">
<option value="99">Off</option>
<option value="16">Text</option>
<option value="8">Decimal</option>
<option value="4">Hex</option>
<option value="2">Decimal and Text</option>