bitwarden-estensione-browser/src/app/vault/vault.component.ts

42 lines
834 B
TypeScript
Raw Normal View History

2018-01-16 22:12:26 +01:00
import * as template from './vault.component.html';
import {
Component,
OnInit,
} from '@angular/core';
import { CipherService } from 'jslib/abstractions/cipher.service';
2018-01-24 18:20:01 +01:00
import { CipherView } from 'jslib/models/view/cipherView';
2018-01-16 22:12:26 +01:00
@Component({
selector: 'app-vault',
template: template,
})
export class VaultComponent implements OnInit {
2018-01-24 18:20:01 +01:00
ciphers: CipherView[];
2018-01-24 23:41:57 +01:00
cipherId: string;
2018-01-24 06:06:05 +01:00
details: string;
2018-01-24 04:21:14 +01:00
constructor(private cipherService: CipherService) {
}
async ngOnInit() {
2018-01-24 05:05:23 +01:00
this.ciphers = await this.cipherService.getAllDecrypted();
2018-01-16 22:12:26 +01:00
}
2018-01-24 06:06:05 +01:00
2018-01-24 23:41:57 +01:00
viewCipher(id: string) {
this.cipherId = id;
2018-01-24 06:06:05 +01:00
this.details = 'view';
}
2018-01-24 23:41:57 +01:00
editCipher(id: string) {
this.cipherId = id;
this.details = 'edit';
}
addCipher() {
this.details = 'add';
}
2018-01-16 22:12:26 +01:00
}