remake init data

json dump

Small bug fix
This commit is contained in:
liosha84
2025-08-18 12:26:34 +03:00
parent 0885a460c4
commit a05e9a31fc
9 changed files with 120 additions and 56 deletions
@@ -2,7 +2,7 @@
<h2>JSON Dump Management</h2>
<!-- Entity-specific Export/Import -->
<div class="entity-actions" *ngFor="let entity of entityTypes">
<!-- <div class="entity-actions" *ngFor="let entity of entityTypes">
<h3>{{ entity | titlecase }}</h3>
<button mat-raised-button color="primary" (click)="exportEntity(entity)">
<mat-icon>download</mat-icon> Export {{ entity }}
@@ -11,8 +11,37 @@
<mat-icon>upload</mat-icon> Import {{ entity }}
<input type="file" hidden accept=".json" (change)="onFileSelected($event, entity)">
</label>
</div>
<button mat-icon-button (click)="restore(entity)" matTooltip="Restore from latest file">
<mat-icon>restore_from_trash</mat-icon>
</button>
<label mat-i color="accent">
<mat-icon>upload</mat-icon> Import {{ entity }}
<input type="file" hidden accept=".json" (change)="onFileSelected($event, entity)">
</label>
</div>-->
<mat-toolbar>
@for (entity of entityTypes; track entity) {
<mat-toolbar-row>
<mat-label>{{ entity | titlecase }}</mat-label>
<button mat-icon-button (click)="exportEntity(entity)" matTooltip="Export {{ entity }}">
<mat-icon>download</mat-icon>
</button>
<button mat-icon-button (click)="fileInput.click()" matTooltip=" Import {{ entity }}">
<mat-icon>restore_from_trash</mat-icon>
</button>
<button mat-icon-button (click)="restore(entity)" matTooltip="Restore from latest file">
<mat-icon>upload</mat-icon>
</button>
<input
type="file"
#fileInput
accept=".json"
(change)="onFileSelected($event, entity)"
hidden
/>
</mat-toolbar-row>
}
</mat-toolbar>
<!-- Files Table -->
<h3>Available JSON Files</h3>
<mat-table [dataSource]="files">