Skip to content

Commit 4afd102

Browse files
Enhance message management and filtering functionality
- Introduced a new method `loadConfigCategoryMap` in `message.js` to load configuration category mappings for improved message detail display. - Updated the message list widget to support collapsible action rows, enhancing user interaction with message filters. - Refined filter dialog to clarify inclusion/exclusion logic, updating button labels and checkbox behaviors accordingly. - Improved CSS styles for filter dialogs and action expanders to enhance usability and visual clarity. - Adjusted virtual list behavior to maintain consistent header and body alignment during scrolling.
1 parent a565b0d commit 4afd102

6 files changed

Lines changed: 407 additions & 135 deletions

File tree

scripts/messages/message.js

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
var msgManager = {
44
constants: {},
55
keyBytes: {},
6+
configCategoryMap: null,
67
init: function () {
78
this.loadConstants();
89
this.loadKeyBytes();
10+
this.loadConfigCategoryMap();
911
console.log('Messages loaded');
1012
console.log(this);
1113
},
@@ -24,6 +26,32 @@ var msgManager = {
2426
if (typeof cb === 'function') cb(data);
2527
});
2628
},
29+
loadConfigCategoryMap: function (cb) {
30+
var self = this;
31+
if (self.configCategoryMap && typeof self.configCategoryMap === 'object') {
32+
if (typeof cb === 'function') cb(self.configCategoryMap);
33+
return;
34+
}
35+
// This doc contains payload[0].values mapping config category byte -> label
36+
$.getLocalService('/messages/docs/165_P_BC_CP_222', undefined, function (docs, status, xhr) {
37+
try {
38+
let map = {};
39+
if (docs && Array.isArray(docs.payload) && docs.payload.length > 0) {
40+
// Prefer "Config Category" entry, otherwise assume first payload descriptor
41+
let cat = docs.payload.find(p => (p && (p.name === 'Config Category' || p.start === 0))) || docs.payload[0];
42+
if (cat && typeof cat.values === 'object' && !Array.isArray(cat.values)) {
43+
map = cat.values;
44+
}
45+
}
46+
self.configCategoryMap = map;
47+
if (typeof cb === 'function') cb(map);
48+
} catch (err) {
49+
console.log(err);
50+
self.configCategoryMap = {};
51+
if (typeof cb === 'function') cb(self.configCategoryMap);
52+
}
53+
});
54+
},
2755
createKeyContext: function(msg) {
2856
var proto = this.constants.protocols.find(elem => elem.name === msg.protocol) || { name: 'undefined' };
2957
var key = proto.keyFormat || 'XXX_<controller>_<dest>_<source>_<action>';

0 commit comments

Comments
 (0)