Skip to content

Commit 989f176

Browse files
authored
Merge pull request #446 from kac89/dev
add bugbounty-list
2 parents 2305c8e + 4d261d9 commit 989f176

7 files changed

+422
-313
lines changed

src/app/app-routing.module.ts

+8
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ import { TbhmComponent } from './tbhm/tbhm.component';
1515
import { Pcidss4Component } from './pcidss4/pcidss4.component';
1616
import { CveSearchComponent } from './cve-search/cve-search.component';
1717

18+
import { BbListComponent } from './bb-list/bb-list.component';
19+
20+
1821
const routes: Routes = [{
1922
path: 'home',
2023
pathMatch: 'full',
@@ -85,6 +88,11 @@ const routes: Routes = [{
8588
pathMatch: 'full',
8689
component: TemplatesListComponent
8790
},
91+
{
92+
path: 'bugbounty-list',
93+
pathMatch: 'full',
94+
component: BbListComponent
95+
},
8896
{
8997
path: '**',
9098
component: HomeComponent

src/app/app.component.html

+11
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,11 @@
5858
Checklists
5959
</a>
6060

61+
<a routerLink="/bugbounty-list" routerLinkActive="active-link" href="/bugbounty-list" mat-menu-item>
62+
<mat-icon class="vertical-align-middle padding-bottom-3">library_books</mat-icon>
63+
Bug Bounty List
64+
</a>
65+
6166
<a routerLink="/settings" routerLinkActive="active-link" href="/settings" mat-menu-item>
6267
<mat-icon class="vertical-align-middle padding-bottom-3">settings</mat-icon>
6368
Settings
@@ -148,6 +153,12 @@
148153
<mat-icon class="vertical-align-middle padding-bottom-3">library_books</mat-icon>
149154
Checklists
150155
</a>
156+
157+
<a routerLink="/bugbounty-list" routerLinkActive="active-link" href="/bugbounty-list" mat-menu-item>
158+
<mat-icon class="vertical-align-middle padding-bottom-3">library_books</mat-icon>
159+
Bug Bounty List
160+
</a>
161+
151162
<a routerLink="/settings" routerLinkActive="active-link" href="/settings" mat-menu-item>
152163
<mat-icon class="vertical-align-middle padding-bottom-3">settings</mat-icon>
153164
Settings
+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<div>
2+
3+
<h1 class="mat-headline-3">
4+
<mat-icon class="vertical-align-middle padding-bottom-3 size-45">library_books</mat-icon> Bug Bounty List ({{this.dataSource.data.length}})
5+
</h1>
6+
7+
<mat-card appearance="outlined" class="mdc-card my-card-content mdc-typography--body1">
8+
9+
<mat-form-field color="accent">
10+
<mat-label>Filter</mat-label>
11+
<input matInput (keyup)="applyFilter($event)" placeholder="Ex. google" #input>
12+
</mat-form-field>
13+
14+
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
15+
16+
<ng-container matColumnDef="name">
17+
<th mat-header-cell *matHeaderCellDef> Name </th>
18+
<td mat-cell *matCellDef="let element"> <a class="active-link" target="_blank"
19+
href="{{element.url}}">{{element.name}}</a> </td>
20+
</ng-container>
21+
22+
<ng-container matColumnDef="bounty">
23+
<th mat-header-cell *matHeaderCellDef> Bounty? </th>
24+
<td mat-cell *matCellDef="let element"> <span [hidden]="!element.bounty"><mat-icon title="Money bounty">attach_money</mat-icon></span> <span [hidden]="!element.swag"><mat-icon title="SWAG">redeem</mat-icon></span> </td>
25+
</ng-container>
26+
27+
<ng-container matColumnDef="domains">
28+
<th mat-header-cell *matHeaderCellDef> Domains </th>
29+
<td mat-cell *matCellDef="let element"> {{element.domains}} </td>
30+
</ng-container>
31+
32+
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
33+
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
34+
35+
<!-- Row shown when there is no matching data. -->
36+
<tr class="mat-row" *matNoDataRow>
37+
<td class="mat-cell" colspan="4">No data matching the filter "{{input.value}}"</td>
38+
</tr>
39+
</table>
40+
41+
<p>List provided and maintain by <a class="active-link" target="_blank" href="https://github.com/projectdiscovery/public-bugbounty-programs">projectdiscovery</a>.</p>
42+
43+
44+
45+
</mat-card>
46+
<br>
47+
<br>
48+
<br>
49+
</div>
+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
2+
table {
3+
width: 100%;
4+
}
5+
6+
tr.example-detail-row {
7+
height: 0;
8+
}
9+
10+
.example-element-row td {
11+
border-bottom-width: 0;
12+
}
13+
14+
td , th {
15+
white-space: normal;
16+
word-wrap: break-word;
17+
max-width: 200px;
18+
}
+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import { ComponentFixture, TestBed } from '@angular/core/testing';
2+
3+
import { BbListComponent } from './bb-list.component';
4+
5+
describe('BbListComponent', () => {
6+
let component: BbListComponent;
7+
let fixture: ComponentFixture<BbListComponent>;
8+
9+
beforeEach(async () => {
10+
await TestBed.configureTestingModule({
11+
imports: [BbListComponent]
12+
})
13+
.compileComponents();
14+
15+
fixture = TestBed.createComponent(BbListComponent);
16+
component = fixture.componentInstance;
17+
fixture.detectChanges();
18+
});
19+
20+
it('should create', () => {
21+
expect(component).toBeTruthy();
22+
});
23+
});

src/app/bb-list/bb-list.component.ts

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import { Component, OnInit, ViewChild } from '@angular/core';
2+
import { MatIconModule } from '@angular/material/icon'
3+
import { MatCardModule } from '@angular/material/card';
4+
import {MatTableDataSource, MatTableModule} from '@angular/material/table';
5+
import {MatInputModule} from '@angular/material/input';
6+
import {MatFormFieldModule} from '@angular/material/form-field';
7+
import { HttpClient } from '@angular/common/http';
8+
9+
@Component({
10+
selector: 'app-bb-list',
11+
imports: [MatIconModule, MatCardModule, MatFormFieldModule, MatInputModule, MatTableModule],
12+
templateUrl: './bb-list.component.html',
13+
styleUrl: './bb-list.component.scss'
14+
})
15+
export class BbListComponent implements OnInit {
16+
17+
18+
ELEMENT_DATA:any = [];
19+
20+
displayedColumns: string[] = ['name', 'bounty', 'domains'];
21+
dataSource = new MatTableDataSource(this.ELEMENT_DATA);
22+
23+
constructor(private http: HttpClient) {
24+
}
25+
26+
ngOnInit() {
27+
28+
this.http.get<any>('/assets/chaos-bugbounty-list.json?v=' + + new Date()).subscribe(res => {
29+
if (res) {
30+
31+
if(res['programs']) {
32+
this.dataSource = new MatTableDataSource(res['programs']);
33+
}
34+
35+
}
36+
});
37+
38+
}
39+
40+
applyFilter(event: Event) {
41+
const filterValue = (event.target as HTMLInputElement).value;
42+
this.dataSource.filter = filterValue.trim().toLowerCase();
43+
}
44+
}

0 commit comments

Comments
 (0)