- Added user update modal
- Refactored modal logic
This commit is contained in:
@ -57,4 +57,7 @@ networks:
|
|||||||
volumes:
|
volumes:
|
||||||
rethinkdb_data:
|
rethinkdb_data:
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### Dev notes
|
||||||
|
Fix slow build times: Use Gradle Build and Run settings set to IntelliJ IDEA
|
@ -46,7 +46,7 @@
|
|||||||
|
|
||||||
<!-- Buttons Section -->
|
<!-- Buttons Section -->
|
||||||
<div class="flex justify-center mt-10 space-x-4">
|
<div class="flex justify-center mt-10 space-x-4">
|
||||||
<button class="btn btn-primary">
|
<button class="btn btn-primary" (click)="openEditUserModal()">
|
||||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-person" viewBox="0 0 16 16">
|
||||||
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/>
|
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6m2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0m4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4m-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10s-3.516.68-4.168 1.332c-.678.678-.83 1.418-.832 1.664z"/>
|
||||||
</svg>
|
</svg>
|
||||||
@ -144,3 +144,11 @@
|
|||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Modal -->
|
||||||
|
<dialog #edit_user_modal class="modal">
|
||||||
|
<div class="modal-box">
|
||||||
|
<app-edituser
|
||||||
|
[username]="username"
|
||||||
|
></app-edituser>
|
||||||
|
</div>
|
||||||
|
</dialog>
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Component } from '@angular/core';
|
import {Component, ElementRef, ViewChild} from '@angular/core';
|
||||||
import {DatePipe, DecimalPipe, NgForOf} from "@angular/common";
|
import {DatePipe, DecimalPipe, NgForOf} from "@angular/common";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {firstValueFrom} from "rxjs";
|
import {firstValueFrom} from "rxjs";
|
||||||
@ -8,6 +8,8 @@ import {Router} from "@angular/router";
|
|||||||
import {FormatFileSizePipePipe} from "../format-file-size-pipe.pipe";
|
import {FormatFileSizePipePipe} from "../format-file-size-pipe.pipe";
|
||||||
import {DurationPipe} from "../duration.pipe";
|
import {DurationPipe} from "../duration.pipe";
|
||||||
import {RelativeTimePipe} from "../relative-time.pipe";
|
import {RelativeTimePipe} from "../relative-time.pipe";
|
||||||
|
import {FormsModule} from "@angular/forms";
|
||||||
|
import {EdituserComponent} from "./edituser/edituser.component";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-adminui',
|
selector: 'app-adminui',
|
||||||
@ -18,20 +20,30 @@ import {RelativeTimePipe} from "../relative-time.pipe";
|
|||||||
NgForOf,
|
NgForOf,
|
||||||
FormatFileSizePipePipe,
|
FormatFileSizePipePipe,
|
||||||
DurationPipe,
|
DurationPipe,
|
||||||
RelativeTimePipe
|
RelativeTimePipe,
|
||||||
|
FormsModule,
|
||||||
|
EdituserComponent
|
||||||
],
|
],
|
||||||
templateUrl: './adminui.component.html',
|
templateUrl: './adminui.component.html',
|
||||||
styleUrl: './adminui.component.scss'
|
styleUrl: './adminui.component.scss'
|
||||||
})
|
})
|
||||||
export class AdminuiComponent {
|
export class AdminuiComponent {
|
||||||
|
|
||||||
|
@ViewChild('edit_user_modal') edit_user_modal: ElementRef<HTMLDialogElement> | undefined;
|
||||||
|
|
||||||
fileUploads: any[] = [];
|
fileUploads: any[] = [];
|
||||||
expiredFileUploads: any[] = [];
|
expiredFileUploads: any[] = [];
|
||||||
totalFileSizeOnDisk: number = 0;
|
totalFileSizeOnDisk: number = 0;
|
||||||
totalFileDownloads = 0;
|
totalFileDownloads = 0;
|
||||||
statistics: any = {};
|
statistics: any = {};
|
||||||
|
username: string = "";
|
||||||
|
|
||||||
constructor(private developmentStore: DevelopmentStore, private authStore: AuthStore, private router: Router) {
|
constructor(private developmentStore: DevelopmentStore, private authStore: AuthStore, private router: Router) {
|
||||||
|
this.init();
|
||||||
|
}
|
||||||
|
|
||||||
|
async init() {
|
||||||
|
this.username = await firstValueFrom(this.authStore.username$);
|
||||||
setInterval(() => {
|
setInterval(() => {
|
||||||
this.verifyToken();
|
this.verifyToken();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
@ -65,6 +77,10 @@ export class AdminuiComponent {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
openEditUserModal() {
|
||||||
|
this.edit_user_modal?.nativeElement.showModal();
|
||||||
|
}
|
||||||
|
|
||||||
async fetchFileUploads() {
|
async fetchFileUploads() {
|
||||||
try {
|
try {
|
||||||
const response = await axios({
|
const response = await axios({
|
||||||
|
Reference in New Issue
Block a user