Unverified Commit 95b667ce authored by 老广's avatar 老广 Committed by GitHub

Merge pull request #90 from jumpserver/manual

Manual
parents 571b5ecc 613e9639
...@@ -286,6 +286,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges { ...@@ -286,6 +286,9 @@ export class ElementAssetTreeComponent implements OnInit, OnChanges {
data: {username: user.username} data: {username: user.username}
}); });
dialogRef.afterClosed().subscribe(result => { dialogRef.afterClosed().subscribe(result => {
if (!result) {
return;
}
user.username = btoa(result.username); user.username = btoa(result.username);
user.password = btoa(result.password); user.password = btoa(result.password);
return this.login(host, user); return this.login(host, user);
...@@ -453,6 +456,10 @@ export class ManualPasswordDialogComponent implements OnInit { ...@@ -453,6 +456,10 @@ export class ManualPasswordDialogComponent implements OnInit {
this.dialogRef.close(); this.dialogRef.close();
} }
onEnter() {
this.dialogRef.close(this.data);
}
ngOnInit(): void { ngOnInit(): void {
} }
} }
...@@ -5,10 +5,13 @@ ...@@ -5,10 +5,13 @@
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 100%"> <mat-form-field style="width: 100%">
<input matInput [type]="'password'" [(ngModel)]="data.password" [formControl]="PasswordControl" placeholder="{{'Password'|trans}}"> <input matInput [type]="'password'" [(ngModel)]="data.password"
[formControl]="PasswordControl" placeholder="{{'Password'|trans}}"
(keyup.enter)="onEnter()" [attr.cdkFocusInitial]="data.username? true : null">
</mat-form-field> </mat-form-field>
<div style="float: right"> <div style="float: right">
<button mat-raised-button (click)="onNoClick()" >{{"Cancel"|trans}}</button> <button mat-raised-button (click)="onNoClick()" >{{"Cancel"|trans}}</button>
<button mat-raised-button color="primary" [type]="'submit'" [mat-dialog-close]="data" >{{"Confirm"|trans}}</button> <button mat-raised-button color="primary" [type]="'submit'" [mat-dialog-close]="data" >{{"Confirm"|trans}}</button>
</div> </div>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment