public-gateway-cacher/src/app/pages/pages.component.html

85 lines
3.0 KiB
HTML

<div fxLayout="column" fxLayoutAlign="space-evenly center" fxLayoutGap="1em" class="container">
<h1>Public IPFS Cacher</h1>
<!-- IPFS -->
<form fxLayout="row" fxLayoutAlign="space-evenly center" fxLayoutGap="1em">
<!-- Hash -->
<mat-form-field>
<mat-label>IPFS</mat-label>
<input matInput [(ngModel)]="ipfs" name="ipfs">
</mat-form-field>
<!-- Cache -->
<button mat-flat-button color="primary" type="button" (click)="cacheIPFS()">Cache</button>
</form>
<!-- IPNS -->
<form fxLayout="row" fxLayoutAlign="space-evenly center" fxLayoutGap="1em">
<!-- Hash -->
<mat-form-field>
<mat-label>IPNS</mat-label>
<input matInput [(ngModel)]="ipns" name="ipns">
</mat-form-field>
<!-- Cache -->
<button mat-flat-button color="primary" type="button" (click)="cacheIPNS()">Cache</button>
</form>
<mat-progress-bar *ngIf="subscriptions.length" mode="determinate" [value]="dataSource.data.length / gateways.length * 100">
</mat-progress-bar>
<table mat-table [dataSource]="dataSource" class="mat-elevation-z8">
<!-- Result Column -->
<ng-container matColumnDef="error">
<th mat-header-cell *matHeaderCellDef> Status </th>
<td mat-cell *matCellDef="let element">
<div [ngSwitch]="element.error">
<div *ngSwitchCase="null"></div>
<div *ngSwitchDefault [matTooltip]="element.error.statusText"></div>
</div>
</td>
</ng-container>
<!-- Gateway Column -->
<ng-container matColumnDef="gateway">
<th mat-header-cell *matHeaderCellDef> Gateway </th>
<td mat-cell *matCellDef="let element">
<div [ngSwitch]="element.error">
<div *ngSwitchCase="null">
<strong><a href="{{ element.gateway }}#x-ipfs-companion-no-redirect" class="aqua"> {{ element.gateway }} </a></strong>
</div>
<div *ngSwitchDefault>
<a href="{{ element.gateway }}#x-ipfs-companion-no-redirect" class="aqua-muted"> {{ element.gateway }} </a>
</div>
</div>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
<!-- About -->
<div fxLayout="column" fxLayoutAlign="space-evenly start" fxLayoutGap="1em">
<h3>About</h3>
<p>
This allows you to cache a specific IPFS hash to a bunch of public gateways.
It's inspired from <a href="https://github.com/ipfs/public-gateway-checker">github.com/ipfs/public-gateway-checker</a>.
The source code is available at <a
href="https://gitlab.com/NatoBoram/public-gateway-cacher">gitlab.com/NatoBoram/public-gateway-cacher</a>.
</p>
<p>
If you'd like to add a new public gateway,
please go to <a href="https://github.com/ipfs/public-gateway-checker">github.com/ipfs/public-gateway-checker</a>,
submit a pull request then open an issue <a href="https://gitlab.com/NatoBoram/public-gateway-cacher/issues/new">here</a>.
</p>
</div>
</div>