Skip to content

Commit

Permalink
UI - small fixes and improvements
Browse files Browse the repository at this point in the history
- send message with timeout 0 showed incorrect error
- added category column on connection logs
- connections js editors had wron read-only behaviour
- connection log details ace editor now with word wrap
- Bug: filter on incoming messages

Signed-off-by: thfries <thomas.fries0@gmail.com>
  • Loading branch information
thfries committed Feb 4, 2024
1 parent 8077e73 commit 22ae37e
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion ui/modules/api.ts
Expand Up @@ -370,7 +370,7 @@ export async function callDittoREST(method,
throw new Error('An error occurred: ' + response.status);
}
}
if (response.status !== 204) {
if (response.status !== 204 && response.status !== 202) {
if (returnHeaders) {
return response;
} else {
Expand Down
3 changes: 2 additions & 1 deletion ui/modules/connections/connections.html
Expand Up @@ -168,10 +168,11 @@ <h6>Connection Logs <span class="badge rounded-pill bg-info" id="badgeConnection
</div>
<table-filter id="tableFilterConnectionLogs"></table-filter>
<div class="table-wrap">
<table class="table table-striped table-hover table-sm">
<table class="table table-striped table-hover table-sm" style="table-layout: fixed;">
<thead>
<tr>
<th>Timestamp</th>
<th>Category</th>
<th>Type</th>
<th>Level</th>
</tr>
Expand Down
2 changes: 0 additions & 2 deletions ui/modules/connections/connectionsCRUD.ts
Expand Up @@ -96,8 +96,6 @@ function onConnectionEditorInput() {

function onConnectionEditorChangeAnnotation() {
hasErrors = connectionEditor.getSession().getAnnotations().filter((a) => a.type === 'error').length > 0;
incomingEditor.setReadOnly(hasErrors);
outgoingEditor.setReadOnly(hasErrors);
}

function onUpdateConnectionClick() {
Expand Down
2 changes: 2 additions & 0 deletions ui/modules/connections/connectionsMonitor.ts
Expand Up @@ -65,6 +65,7 @@ export async function ready() {
Utils.getAllElementsById(dom);

connectionLogDetail = Utils.createAceEditor('connectionLogDetail', 'ace/mode/json', true);
connectionLogDetail.session.setUseWrapMode(true);
connectionStatusDetail = Utils.createAceEditor('connectionStatusDetail', 'ace/mode/json', true);

// Status --------------
Expand Down Expand Up @@ -162,6 +163,7 @@ function fillConnectionLogsTable() {
Utils.addTableRow(
dom.tbodyConnectionLogs,
Utils.formatDate(entry.timestamp, true), false, null,
entry.category,
entry.type,
entry.level
);
Expand Down
2 changes: 1 addition & 1 deletion ui/modules/things/messagesIncoming.ts
Expand Up @@ -125,7 +125,7 @@ function onSelectThingUpdateMessageContentSelect() {
function onMessage(messageData) {
messages.push(messageData);

const filteredMessage = dom.tableFilterMessagesIncoming.filterItems([messageData]);
const filteredMessage = dom.tableFilterMessagesIncoming.filterItems(messages);

if (filteredMessage.length > 0) {
filteredMessages.push(filteredMessage[0]);
Expand Down

0 comments on commit 22ae37e

Please sign in to comment.