2018-01-16 22:12:26 +01:00
|
|
|
import * as template from './vault.component.html';
|
|
|
|
|
|
|
|
import {
|
|
|
|
Component,
|
|
|
|
OnInit,
|
|
|
|
} from '@angular/core';
|
|
|
|
|
2018-01-23 22:58:32 +01:00
|
|
|
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-23 22:58:32 +01:00
|
|
|
|
2018-01-24 04:21:14 +01:00
|
|
|
constructor(private cipherService: CipherService) {
|
2018-01-23 22:58:32 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|