1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-21 10:43:35 +00:00

password history

This commit is contained in:
Kyle Spearrin
2018-02-17 22:37:43 -05:00
parent 22d5b23e5b
commit 8dafca3706
8 changed files with 119 additions and 29 deletions

View File

@@ -0,0 +1,38 @@
import * as template from './password-generator-history.component.html';
import { Angulartics2 } from 'angulartics2';
import {
Component,
OnInit,
} from '@angular/core';
import { PasswordGenerationService } from 'jslib/abstractions/passwordGeneration.service';
import { PlatformUtilsService } from 'jslib/abstractions/platformUtils.service';
import { PasswordHistory } from 'jslib/models/domain/passwordHistory';
@Component({
selector: 'app-password-generator-history',
template: template,
})
export class PasswordGeneratorHistoryComponent implements OnInit {
history: PasswordHistory[];
constructor(private passwordGenerationService: PasswordGenerationService, private analytics: Angulartics2,
private platformUtilsService: PlatformUtilsService) { }
async ngOnInit() {
this.history = await this.passwordGenerationService.getHistory();
}
clear() {
this.history = [];
this.passwordGenerationService.clear();
}
copy(password: string) {
this.analytics.eventTrack.next({ action: 'Copied Historical Password' });
this.platformUtilsService.copyToClipboard(password);
}
}