Added delete all files
This commit is contained in:
@ -52,7 +52,7 @@
|
||||
</svg>
|
||||
Change Administrator Login
|
||||
</button>
|
||||
<button class="btn btn-secondary">Delete All Uploaded Files</button>
|
||||
<button class="btn btn-secondary" (click)="confirm('Are you sure?') && deleteAllFileUploads()">Delete All Uploaded Files</button>
|
||||
<button class="btn btn-accent">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-people" viewBox="0 0 16 16">
|
||||
<path d="M15 14s1 0 1-1-1-4-5-4-5 3-5 4 1 1 1 1zm-7.978-1L7 12.996c.001-.264.167-1.03.76-1.72C8.312 10.629 9.282 10 11 10c1.717 0 2.687.63 3.24 1.276.593.69.758 1.457.76 1.72l-.008.002-.014.002zM11 7a2 2 0 1 0 0-4 2 2 0 0 0 0 4m3-2a3 3 0 1 1-6 0 3 3 0 0 1 6 0M6.936 9.28a6 6 0 0 0-1.23-.247A7 7 0 0 0 5 9c-4 0-5 3-5 4q0 1 1 1h4.216A2.24 2.24 0 0 1 5 13c0-1.01.377-2.042 1.09-2.904.243-.294.526-.569.846-.816M4.92 10A5.5 5.5 0 0 0 4 13H1c0-.26.164-1.03.76-1.724.545-.636 1.492-1.256 3.16-1.275ZM1.5 5.5a3 3 0 1 1 6 0 3 3 0 0 1-6 0m3-2a2 2 0 1 0 0 4 2 2 0 0 0 0-4"/>
|
||||
@ -131,7 +131,7 @@
|
||||
<td>{{ file.id }}</td>
|
||||
<td>{{ file.fileId }}</td>
|
||||
<td>{{ file.fileName }}</td>
|
||||
<td>{{ file.fileSize | number }}</td>
|
||||
<td>{{ file.fileSize | formatFileSizePipe }}</td>
|
||||
<td>{{ file.singleDownload ? 'true' : 'false' }}</td>
|
||||
<td>{{ file.disabled ? 'true' : 'false' }}</td>
|
||||
<td>{{ file.uploadDate | date: 'medium' }}</td>
|
||||
|
@ -111,4 +111,21 @@ export class AdminuiComponent {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
async deleteAllFileUploads() {
|
||||
try {
|
||||
const response = await axios({
|
||||
method: 'delete',
|
||||
url: this.developmentStore.getBaseUrl() + 'api/v1/secure/files',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + await firstValueFrom(this.authStore.token$)
|
||||
}
|
||||
});
|
||||
console.log(this.statistics)
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
}
|
||||
|
||||
protected readonly confirm = confirm;
|
||||
}
|
||||
|
Reference in New Issue
Block a user