mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
data breach report
This commit is contained in:
45
src/app/tools/breach-report.component.html
Normal file
45
src/app/tools/breach-report.component.html
Normal file
@@ -0,0 +1,45 @@
|
||||
<div class="page-header">
|
||||
<h1>{{'dataBreachReport' | i18n}}</h1>
|
||||
</div>
|
||||
<p>{{'breachDesc' | i18n}}</p>
|
||||
<i class="fa fa-spinner fa-spin text-muted" *ngIf="loading"></i>
|
||||
<ng-container *ngIf="!loading">
|
||||
<p *ngIf="error">{{'reportError' | i18n}}...</p>
|
||||
<ng-container *ngIf="!error">
|
||||
<app-callout type="success" title="{{'goodNews' | i18n}}" *ngIf="!breachedAccounts.length">
|
||||
{{'breachEmailNotFound' | i18n : email}}
|
||||
</app-callout>
|
||||
<app-callout type="danger" title="{{'breachFound' | i18n}}" *ngIf="breachedAccounts.length">
|
||||
{{'breachEmailFound' | i18n : email : breachedAccounts.length}}
|
||||
</app-callout>
|
||||
<ul class="list-group list-group-breach" *ngIf="breachedAccounts.length">
|
||||
<li *ngFor="let a of breachedAccounts" class="list-group-item d-flex align-items-center">
|
||||
<div class="row">
|
||||
<div class="col-2 text-center">
|
||||
<img [src]="'https://haveibeenpwned.com/Content/Images/PwnedLogos/' + a.name + '.' + a.logoType" alt="" class="img-fluid">
|
||||
</div>
|
||||
<div class="col-7">
|
||||
<h3>{{a.title}}</h3>
|
||||
<p [innerHTML]="a.description"></p>
|
||||
<p class="mb-1">{{'compromisedData' | i18n}}:</p>
|
||||
<ul>
|
||||
<li *ngFor="let d of a.dataClasses">{{d}}</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="col-3">
|
||||
<dl>
|
||||
<dt>{{'website' | i18n}}</dt>
|
||||
<dd>{{a.domain}}</dd>
|
||||
<dt>{{'affectedUsers' | i18n}}</dt>
|
||||
<dd>{{a.pwnCount | number}}</dd>
|
||||
<dt>{{'breachOccurred' | i18n}}</dt>
|
||||
<dd>{{a.breachDate | date: 'mediumDate'}}</dd>
|
||||
<dt>{{'breachReported' | i18n}}</dt>
|
||||
<dd>{{a.addedDate | date: 'mediumDate'}}</dd>
|
||||
</dl>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
32
src/app/tools/breach-report.component.ts
Normal file
32
src/app/tools/breach-report.component.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
import {
|
||||
Component,
|
||||
OnInit,
|
||||
} from '@angular/core';
|
||||
|
||||
import { AuditService } from 'jslib/abstractions/audit.service';
|
||||
import { UserService } from 'jslib/abstractions/user.service';
|
||||
import { BreachAccountResponse } from 'jslib/models/response/breachAccountResponse';
|
||||
|
||||
@Component({
|
||||
selector: 'app-breach-report',
|
||||
templateUrl: 'breach-report.component.html',
|
||||
})
|
||||
export class BreachReportComponent implements OnInit {
|
||||
loading = true;
|
||||
error = false;
|
||||
email: string;
|
||||
breachedAccounts: BreachAccountResponse[] = [];
|
||||
|
||||
constructor(private auditService: AuditService, private userService: UserService) { }
|
||||
|
||||
async ngOnInit() {
|
||||
this.loading = true;
|
||||
try {
|
||||
this.email = await this.userService.getEmail();
|
||||
this.breachedAccounts = await this.auditService.breachedAccounts(this.email);
|
||||
} catch {
|
||||
this.error = true;
|
||||
}
|
||||
this.loading = false;
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,28 @@
|
||||
<div class="container page-content">
|
||||
<div class="row">
|
||||
<div class="col-3">
|
||||
<div class="card">
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">{{'tools' | i18n}}</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a routerLink="generator" class="list-group-item" routerLinkActive="active">
|
||||
{{'passwordGenerator' | i18n}}
|
||||
</a>
|
||||
<a routerLink="import" class="list-group-item" routerLinkActive="active">
|
||||
Import
|
||||
{{'import' | i18n}}
|
||||
</a>
|
||||
<a routerLink="export" class="list-group-item" routerLinkActive="active">
|
||||
{{'exportVault' | i18n}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
<div class="card-header">{{'reports' | i18n}}</div>
|
||||
<div class="list-group list-group-flush">
|
||||
<a routerLink="breach-report" class="list-group-item" routerLinkActive="active">
|
||||
{{'dataBreachReport' | i18n}}
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-9">
|
||||
<router-outlet></router-outlet>
|
||||
|
||||
Reference in New Issue
Block a user