File tree Expand file tree Collapse file tree
OpenFlowNodeRED/src/nodered/nodes Expand file tree Collapse file tree Original file line number Diff line number Diff line change 833833
834834 $ . getJSON ( 'api_roles' , function ( data ) {
835835 $ ( '#node-input-targetid-select' ) . empty ( ) ;
836+ $ ( '#node-input-targetid-select' ) . append ( $ ( '<option>' , {
837+ value : "from msg.targetid" ,
838+ text : "from msg.targetid"
839+ } ) ) ;
836840 $ . each ( data , function ( i , ele ) {
837841 $ ( '#node-input-targetid-select' ) . append ( $ ( '<option>' , {
838842 value : ele . _id ,
918922
919923 $ . getJSON ( 'api_roles' , function ( data ) {
920924 $ ( '#node-input-targetid-select' ) . empty ( ) ;
925+ $ ( '#node-input-targetid-select' ) . append ( $ ( '<option>' , {
926+ value : "from msg.targetid" ,
927+ text : "from msg.targetid"
928+ } ) ) ;
921929 $ . each ( data , function ( i , ele ) {
922930 $ ( '#node-input-targetid-select' ) . append ( $ ( '<option>' , {
923931 value : ele . _id ,
Original file line number Diff line number Diff line change @@ -1006,7 +1006,9 @@ export class grant_permission {
10061006 // if (NoderedUtil.IsNullEmpty(msg.jwt)) { return NoderedUtil.HandleError(this, "Missing jwt token"); }
10071007 let priority : number = 1 ;
10081008 if ( ! NoderedUtil . IsNullEmpty ( msg . priority ) ) { priority = msg . priority ; }
1009- if ( ! NoderedUtil . IsNullEmpty ( msg . targetid ) ) { this . config . targetid = msg . targetid ; }
1009+ if ( ! NoderedUtil . IsNullEmpty ( msg . targetid ) && ( NoderedUtil . IsNullEmpty ( this . config . targetid ) || this . config . targetid == "from msg.targetid" ) ) {
1010+ this . config . targetid = msg . targetid ;
1011+ }
10101012 if ( ! NoderedUtil . IsNullUndefinded ( msg . bits ) ) { this . config . bits = msg . bits ; }
10111013
10121014
@@ -1081,7 +1083,9 @@ export class revoke_permission {
10811083 this . node . status ( { } ) ;
10821084
10831085 // if (NoderedUtil.IsNullEmpty(msg.jwt)) { return NoderedUtil.HandleError(this, "Missing jwt token"); }
1084- if ( ! NoderedUtil . IsNullEmpty ( msg . targetid ) ) { this . config . targetid = msg . targetid ; }
1086+ if ( ! NoderedUtil . IsNullEmpty ( msg . targetid ) && ( NoderedUtil . IsNullEmpty ( this . config . targetid ) || this . config . targetid == "from msg.targetid" ) ) {
1087+ this . config . targetid = msg . targetid ;
1088+ }
10851089 if ( ! NoderedUtil . IsNullUndefinded ( msg . bits ) ) { this . config . bits = msg . bits ; }
10861090
10871091
You can’t perform that action at this time.
0 commit comments