Skip to content

Commit 5e4ce10

Browse files
committed
channelNameRoot and appendGroup fixes
1 parent 7819592 commit 5e4ce10

4 files changed

Lines changed: 37 additions & 7 deletions

File tree

src/js/main.js

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2340,14 +2340,14 @@
23402340
var $node = $tabPane.find('.alert.error-summary');
23412341
if (!$node.length) {
23422342
$node = $('<div class="alert alert-error error-summary">' +
2343-
'<h3><i class="fa fa-lg fa-times-circle"></i> Error(s)</h3>' +
2343+
'<h3><i class="fa fa-lg fa-times-circle"></i> Error(s) not consoled</h3>' +
23442344
'<ul class="list-unstyled">' +
23452345
'</ul>' +
23462346
'</div>');
23472347
$tabPane.prepend($node);
23482348
}
23492349
$node = $node.find('ul');
2350-
$node.append($('<li></li>').text(logEntry.args[0]));
2350+
$node.append(buildEntryNode(logEntry));
23512351
if (logEntry.meta.class === 'error') {
23522352
$container
23532353
.addClass('bg-danger')
@@ -2884,6 +2884,9 @@
28842884
$node.addClass(meta.attribs.class);
28852885
delete meta.attribs.class;
28862886
}
2887+
if (meta.attribs.id) {
2888+
meta.attribs.id = buildId(meta);
2889+
}
28872890
$node.attr(meta.attribs);
28882891
}
28892892
if (meta.icon) {
@@ -2916,7 +2919,7 @@
29162919
var $debug;
29172920
var $node;
29182921
var $tabPane;
2919-
var channelNameRoot = $container.find('.debug').data('channelNameRoot') || 'general';
2922+
var channelNameRoot = $container.find('.debug').data('channelNameRoot') || meta.channelNameRoot || 'general';
29202923
var channelName = meta.channel || channelNameRoot;
29212924
var channelSplit = channelName.split('.');
29222925
var info = {
@@ -2931,6 +2934,9 @@
29312934
if ($container.length) {
29322935
$tabPane = getTabPane(info, meta);
29332936
$node = $tabPane.data('nodes').slice(-1)[0] || $tabPane.find('> .debug-log');
2937+
if (meta.appendGroup) {
2938+
$node = $tabPane.find('#' + buildId(meta, meta.appendGroup) + ' > .group-body');
2939+
}
29342940
} else {
29352941
// create
29362942
// header and card are separate so we can sticky the header
@@ -3220,6 +3226,15 @@
32203226
return false
32213227
}
32223228

3229+
function buildId(meta, id) {
3230+
id = id || meta.attribs.id;
3231+
id = id.replace(/\W+/g, '-');
3232+
if (id.indexOf(meta.requestId) !== 0) {
3233+
id = meta.requestId + '_' + id;
3234+
}
3235+
return id
3236+
}
3237+
32233238
function Xdebug(pubSub) {
32243239
var self = this;
32253240
var $root = $('#debug-cards');

src/js/main.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/js_src/Logger/Logger.js

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ export function processEntry (logEntry) {
4444
$node.addClass(meta.attribs.class)
4545
delete meta.attribs.class
4646
}
47+
if (meta.attribs.id) {
48+
meta.attribs.id = buildId(meta)
49+
}
4750
$node.attr(meta.attribs)
4851
}
4952
if (meta.icon) {
@@ -76,7 +79,7 @@ function getNodeInfo (meta) {
7679
var $debug
7780
var $node
7881
var $tabPane
79-
var channelNameRoot = $container.find('.debug').data('channelNameRoot') || 'general'
82+
var channelNameRoot = $container.find('.debug').data('channelNameRoot') || meta.channelNameRoot || 'general'
8083
var channelName = meta.channel || channelNameRoot
8184
var channelSplit = channelName.split('.')
8285
var info = {
@@ -91,6 +94,9 @@ function getNodeInfo (meta) {
9194
if ($container.length) {
9295
$tabPane = getTabPane(info, meta)
9396
$node = $tabPane.data('nodes').slice(-1)[0] || $tabPane.find('> .debug-log')
97+
if (meta.appendGroup) {
98+
$node = $tabPane.find('#' + buildId(meta, meta.appendGroup) + ' > .group-body')
99+
}
94100
} else {
95101
// create
96102
// header and card are separate so we can sticky the header
@@ -379,3 +385,12 @@ function haveChannel (channelName, channels) {
379385
}
380386
return false
381387
}
388+
389+
function buildId(meta, id) {
390+
id = id || meta.attribs.id
391+
id = id.replace(/\W+/g, '-')
392+
if (id.indexOf(meta.requestId) !== 0) {
393+
id = meta.requestId + '_' + id
394+
}
395+
return id
396+
}

src/js_src/Logger/Methods.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ export var methods = {
126126
var $node = $tabPane.find('.alert.error-summary')
127127
if (!$node.length) {
128128
$node = $('<div class="alert alert-error error-summary">' +
129-
'<h3><i class="fa fa-lg fa-times-circle"></i> Error(s)</h3>' +
129+
'<h3><i class="fa fa-lg fa-times-circle"></i> Error(s) not consoled</h3>' +
130130
'<ul class="list-unstyled">' +
131131
'</ul>' +
132132
'</div>')
133133
$tabPane.prepend($node)
134134
}
135135
$node = $node.find('ul')
136-
$node.append($('<li></li>').text(logEntry.args[0]))
136+
$node.append(buildEntryNode(logEntry))
137137
if (logEntry.meta.class === 'error') {
138138
$container
139139
.addClass('bg-danger')

0 commit comments

Comments
 (0)