upgrade and migrate

This commit is contained in:
_Bastler
2022-12-09 22:04:35 +01:00
parent edecc344e7
commit 92a74e72f9
74 changed files with 4624 additions and 4917 deletions
@@ -1,17 +1,20 @@
<h3>{{'urlshortener' | i18n}}</h3>
<div *ngIf="shortenedUrls">
<mat-form-field>
<input matInput [formControl]="searchFormControl" placeholder="{{'urlshortener.search' | i18n}}">
</mat-form-field>
<div class="flex">
<mat-form-field>
<mat-label>{{'urlshortener.search' | i18n}}</mat-label>
<input matInput [formControl]="searchFormControl">
</mat-form-field>
</div>
<table mat-table matSort [dataSource]="shortenedUrls.content" (matSortChange)="updateSort($event)">
<ng-container matColumnDef="share">
<th mat-header-cell *matHeaderCellDef> {{'urlshortener.share' | i18n}} </th>
<td mat-cell *matCellDef="let shortenedUrl">
<button mat-icon-button (click)="share(shortenedUrl)">
<a mat-icon-button (click)="share(shortenedUrl)">
<mat-icon>share</mat-icon>
</button>
</a>
</td>
</ng-container>
@@ -52,8 +55,8 @@
<ng-container matColumnDef="edit">
<th mat-header-cell *matHeaderCellDef> {{'urlshortener.edit' | i18n}} </th>
<td mat-cell *matCellDef="let shortenedUrl" class="text-right">
<a mat-icon-button>
<mat-icon (click)="edit(shortenedUrl)">edit</mat-icon>
<a mat-icon-button (click)="edit(shortenedUrl)">
<mat-icon>edit</mat-icon>
</a>
</td>
</ng-container>
@@ -61,8 +64,8 @@
<ng-container matColumnDef="delete">
<th mat-header-cell *matHeaderCellDef class="align-right"> {{'urlshortener.delete' | i18n}} </th>
<td mat-cell *matCellDef="let shortenedUrl" class="text-right">
<a mat-icon-button>
<mat-icon (click)="confirmDelete(shortenedUrl)">delete</mat-icon>
<a mat-icon-button (click)="confirmDelete(shortenedUrl)">
<mat-icon>delete</mat-icon>
</a>
</td>
</ng-container>
@@ -84,16 +87,16 @@
<p>{{'urlshortener.left' | i18n:shortenedUrlQuota}}</p>
<mat-form-field>
<input matInput placeholder="{{'urlshortener.url' | i18n}}" formControlName="url"
[(ngModel)]="shortenedUrl.url" type="url">
<mat-label>{{'urlshortener.url' | i18n}}</mat-label>
<input matInput formControlName="url" [(ngModel)]="shortenedUrl.url" type="url">
<mat-error>
{{'urlshortener.error.url' | i18n}}
</mat-error>
</mat-form-field>
<mat-form-field>
<textarea matInput type="note" placeholder="{{'urlshortener.note' | i18n}}" formControlName="note"
[(ngModel)]="shortenedUrl.note"></textarea>
<mat-label>{{'urlshortener.note' | i18n}}</mat-label>
<textarea matInput type="note" formControlName="note" [(ngModel)]="shortenedUrl.note"></textarea>
<mat-error>
{{'urlshortener.error.note' | i18n}}
</mat-error>
@@ -106,8 +109,8 @@
</mat-panel-title>
</mat-expansion-panel-header>
<mat-form-field>
<input matInput type="password" placeholder="{{'password' | i18n}}" formControlName="password"
[(ngModel)]="shortenedUrl.password">
<mat-label>{{'password' | i18n}}</mat-label>
<input matInput type="password" formControlName="password" [(ngModel)]="shortenedUrl.password">
<mat-error>
<div *ngFor="let error of form.get('password').errors | keyvalue">
{{'password.error.' + error.key | i18n}}<br>
@@ -116,16 +119,17 @@
</mat-form-field>
<mat-form-field>
<input matInput type="password" placeholder="{{'password.confirm' | i18n}}" formControlName="password2"
[(ngModel)]="shortenedUrl.password2">
<mat-label>{{'password.confirm' | i18n}}</mat-label>
<input matInput type="password" formControlName="password2" [(ngModel)]="shortenedUrl.password2">
<mat-error>
{{'password.not-match' | i18n}}
</mat-error>
</mat-form-field>
<mat-form-field>
<mat-label>{{'urlshortener.expires' | i18n}}</mat-label>
<input matInput [ngxMatDatetimePicker]="expiresPicker" [(ngModel)]="shortenedUrl.expires"
formControlName="expires" placeholder="{{'urlshortener.expires' | i18n}}">
formControlName="expires">
<mat-datepicker-toggle matSuffix [for]="expiresPicker"></mat-datepicker-toggle>
<ngx-mat-datetime-picker #expiresPicker></ngx-mat-datetime-picker>
<mat-error>
@@ -139,8 +143,8 @@
</mat-slide-toggle>
<mat-form-field>
<input matInput placeholder="{{'urlshortener.code' | i18n}}" formControlName="code"
[(ngModel)]="shortenedUrl.code">
<mat-label>{{'urlshortener.code' | i18n}}</mat-label>
<input matInput formControlName="code" [(ngModel)]="shortenedUrl.code">
<mat-error>
{{'urlshortener.error.code' | i18n}}
</mat-error>
@@ -149,15 +153,16 @@
</div>
</mat-card-content>
<mat-card-actions>
<button *ngIf="shortenedUrlQuota && !working" mat-raised-button color="primary" [disabled]="form.invalid">
<button type="submit" *ngIf="shortenedUrlQuota && !working" mat-raised-button color="primary"
[disabled]="form.invalid">
{{'urlshortener.create' | i18n}}
</button>
</mat-card-actions>
<mat-card-footer>
<a href="https://wiki.bstly.de/services/urlshortener" class="help-button" matTooltip="{{'help-button' | i18n}}"
matTooltipPosition="above" target="_blank" mat-fab color="accent">
<mat-icon>contact_support</mat-icon>
</a>
<a href="https://wiki.bstly.de/services/urlshortener" class="help-button" matTooltip="{{'help-button' | i18n}}"
matTooltipPosition="above" target="_blank" mat-fab color="accent">
<mat-icon>contact_support</mat-icon>
</a>
</mat-card-footer>
</mat-card>