|
|
|
@ -83,7 +83,7 @@ export class EdgeComponent extends EntityComponent<EdgeInfo> { |
|
|
|
) |
|
|
|
} |
|
|
|
); |
|
|
|
this.checkIsNewEdge(entity, form); |
|
|
|
this.generateRoutingKeyAndSecret(entity, form); |
|
|
|
return form; |
|
|
|
} |
|
|
|
|
|
|
|
@ -100,7 +100,7 @@ export class EdgeComponent extends EntityComponent<EdgeInfo> { |
|
|
|
description: entity.additionalInfo ? entity.additionalInfo.description : '' |
|
|
|
} |
|
|
|
}); |
|
|
|
this.checkIsNewEdge(entity, this.entityForm); |
|
|
|
this.generateRoutingKeyAndSecret(entity, this.entityForm); |
|
|
|
} |
|
|
|
|
|
|
|
updateFormState() { |
|
|
|
@ -109,13 +109,6 @@ export class EdgeComponent extends EntityComponent<EdgeInfo> { |
|
|
|
this.entityForm.get('secret').disable({emitEvent: false}); |
|
|
|
} |
|
|
|
|
|
|
|
private checkIsNewEdge(entity: EdgeInfo, form: FormGroup) { |
|
|
|
if (entity && !entity.id) { |
|
|
|
form.get('routingKey').patchValue(guid(), {emitEvent: false}); |
|
|
|
form.get('secret').patchValue(generateSecret(20), {emitEvent: false}); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
onEdgeIdCopied($event) { |
|
|
|
this.store.dispatch(new ActionNotificationShow( |
|
|
|
{ |
|
|
|
@ -139,4 +132,11 @@ export class EdgeComponent extends EntityComponent<EdgeInfo> { |
|
|
|
horizontalPosition: 'right' |
|
|
|
})); |
|
|
|
} |
|
|
|
|
|
|
|
private generateRoutingKeyAndSecret(entity: EdgeInfo, form: FormGroup) { |
|
|
|
if (entity && !entity.id) { |
|
|
|
form.get('routingKey').patchValue(guid(), {emitEvent: false}); |
|
|
|
form.get('secret').patchValue(generateSecret(20), {emitEvent: false}); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|