Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-2987 improve message body display #3350

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -80,25 +80,26 @@ 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>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

did you test this on both AMQP and Core?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did a quick test for this with core, but this change is really just superficial. There's no semantic change here. The same information is being displayed as always, just in a slightly different way.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. I haven't fully read the whole PR at the time I posted this.. I thought you implemented some visutalzation of the body, in which case you would have needed to change some java code..

it's fine then.. thanks

<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"
columns="$ctrl.messageTableColumns"
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?"
Expand Down Expand Up @@ -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));
}
Expand All @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down