-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
314 additions
and
4 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { ByteSizePipe } from './byte-size.pipe'; | ||
|
||
describe('ByteSizePipe', () => { | ||
it('create an instance', () => { | ||
const pipe = new ByteSizePipe(); | ||
expect(pipe).toBeTruthy(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import { Pipe, PipeTransform } from '@angular/core'; | ||
import byteSize, { ByteSizeOptions } from 'byte-size' | ||
|
||
@Pipe({ | ||
name: 'byteSize' | ||
}) | ||
export class ByteSizePipe implements PipeTransform { | ||
|
||
transform(value: number, options: ByteSizeOptions = {}): unknown { | ||
return byteSize(value, options); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export interface HydrusBonedStats { | ||
num_inbox: number; | ||
num_archive: number; | ||
num_deleted: number; | ||
size_inbox: number; | ||
size_archive: number; | ||
size_deleted: number; | ||
earliest_import_time: number; | ||
total_viewtime: number[]; | ||
total_alternate_files: number; | ||
total_duplicate_files: number; | ||
total_potential_pairs: number; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
<h1 mat-dialog-title>Review your fate</h1> | ||
<div mat-dialog-content> | ||
<div *ngIf="bones$ | async as bones; else loading"> | ||
<div *ngIf="bones.stats as stats; else nothing"> | ||
<div *ngIf="stats.boned; else notBoned"> | ||
<img src="/assets/boned.jpg" width="350" height="230"> | ||
</div> | ||
<ng-template #notBoned> | ||
<p class="centered-text">CONGRATULATIONS. YOU APPEAR TO BE UNBONED, BUT REMAIN EVER VIGILANT</p> | ||
</ng-template> | ||
<div class="table-container"> | ||
<table mat-table [dataSource]="stats.table"> | ||
|
||
<ng-container matColumnDef="label"> | ||
<th mat-header-cell *matHeaderCellDef></th> | ||
<td mat-cell *matCellDef="let element">{{element.label}}:</td> | ||
</ng-container> | ||
|
||
|
||
<ng-container matColumnDef="num"> | ||
<th mat-header-cell *matHeaderCellDef>Files</th> | ||
<td mat-cell *matCellDef="let element">{{element.num | number}}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="numPercent"> | ||
<th mat-header-cell *matHeaderCellDef>%</th> | ||
<td mat-cell *matCellDef="let element">{{element.numPercent | percent:'1.0-2'}}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="size"> | ||
<th mat-header-cell *matHeaderCellDef>Size</th> | ||
<td mat-cell *matCellDef="let element">{{element.size | byteSize: {units: 'iec', precision: 2} }}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="sizePercent"> | ||
<th mat-header-cell *matHeaderCellDef>%</th> | ||
<td mat-cell *matCellDef="let element">{{element.sizePercent | percent:'1.0-2'}}</td> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="averageFilesize"> | ||
<th mat-header-cell *matHeaderCellDef>Average</th> | ||
<td mat-cell *matCellDef="let element">{{element.averageFilesize | byteSize: {units: 'iec', precision: 2} }}</td> | ||
</ng-container> | ||
|
||
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | ||
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> | ||
</table> | ||
</div> | ||
<p class="centered-text">Earliest file import: {{stats.earliestImport | date:'yyyy-MM-dd HH:mm:ss'}} ({{stats.earliestImport | timeAgo}})</p> | ||
</div> | ||
<ng-template #nothing> | ||
<p>You have yet to board the ride.</p> | ||
</ng-template> | ||
</div> | ||
<ng-template #loading> | ||
<mat-spinner></mat-spinner> | ||
</ng-template> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
.mat-spinner { | ||
margin-left: auto; | ||
margin-right: auto; | ||
} | ||
|
||
table { | ||
width: 100%; | ||
} | ||
|
||
.mat-column-num.mat-cell, | ||
.mat-column-numPercent.mat-cell, | ||
.mat-column-size.mat-cell, | ||
.mat-column-sizePercent.mat-cell, | ||
.mat-column-averageFilesize.mat-cell { | ||
text-align: end; | ||
} | ||
|
||
img { | ||
max-width: 100%; | ||
height: auto; | ||
margin-left: auto; | ||
margin-right: auto; | ||
display: block; | ||
} | ||
|
||
.mat-cell, .mat-header-cell { | ||
padding-left: 8px; | ||
padding-right: 8px; | ||
} | ||
|
||
.mat-header-cell { | ||
text-align: center; | ||
} | ||
|
||
.table-container { | ||
overflow-x: auto; | ||
} | ||
|
||
.centered-text { | ||
text-align: center; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { MrBonesDialogComponent } from './mr-bones-dialog.component'; | ||
|
||
describe('MrBonesDialogComponent', () => { | ||
let component: MrBonesDialogComponent; | ||
let fixture: ComponentFixture<MrBonesDialogComponent>; | ||
|
||
beforeEach(async () => { | ||
await TestBed.configureTestingModule({ | ||
declarations: [ MrBonesDialogComponent ] | ||
}) | ||
.compileComponents(); | ||
|
||
fixture = TestBed.createComponent(MrBonesDialogComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
Oops, something went wrong.