File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -473,16 +473,31 @@ module.exports = function (RED) {
473
473
if ( ! handshakeEditKey || ! meta ?. wysiwyg ?. editKey || handshakeEditKey !== meta . wysiwyg . editKey ) {
474
474
delete meta . wysiwyg
475
475
}
476
- // pass the connected UI the UI config
477
- socket . emit ( 'ui-config' , node . id , {
476
+
477
+ // Prepare the UI configuration
478
+ const uiConfig = {
478
479
meta,
479
480
dashboards : Object . fromEntries ( node . ui . dashboards ) ,
480
481
heads : Object . fromEntries ( node . ui . heads ) ,
481
482
pages : Object . fromEntries ( node . ui . pages ) ,
482
483
themes : Object . fromEntries ( node . ui . themes ) ,
483
484
groups : Object . fromEntries ( node . ui . groups ) ,
484
485
widgets : Object . fromEntries ( node . ui . widgets )
486
+ }
487
+
488
+ // Apply plugin modifications
489
+ let finalConfig = uiConfig
490
+ RED . plugins . getByType ( 'node-red-dashboard-2' ) . forEach ( plugin => {
491
+ if ( plugin . hooks ?. onEmitConfig ) {
492
+ const modifiedConfig = plugin . hooks . onEmitConfig ( socket , finalConfig )
493
+ if ( modifiedConfig ) {
494
+ finalConfig = modifiedConfig
495
+ }
496
+ }
485
497
} )
498
+
499
+ // Pass the connected UI the UI config
500
+ socket . emit ( 'ui-config' , node . id , finalConfig )
486
501
}
487
502
488
503
// remove event handler socket listeners for a given socket connection
You can’t perform that action at this time.
0 commit comments