Added some details to manage-users and preped for adding libraries.
This commit is contained in:
parent
ee7787c3c7
commit
ac72795971
6 changed files with 35 additions and 6 deletions
3
src/app/_models/library.ts
Normal file
3
src/app/_models/library.ts
Normal file
|
|
@ -0,0 +1,3 @@
|
||||||
|
export interface Library {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -1,6 +1,9 @@
|
||||||
|
import { Library } from './library';
|
||||||
|
|
||||||
export interface Member {
|
export interface Member {
|
||||||
username: string;
|
username: string;
|
||||||
lastActive: string; // datetime
|
lastActive: string; // datetime
|
||||||
created: string; // datetime
|
created: string; // datetime
|
||||||
isAdmin: boolean;
|
isAdmin: boolean;
|
||||||
|
libraries?: Library[];
|
||||||
}
|
}
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
import { HttpClient } from '@angular/common/http';
|
import { HttpClient } from '@angular/common/http';
|
||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { environment } from 'src/environments/environment';
|
import { environment } from 'src/environments/environment';
|
||||||
|
import { Library } from '../_models/library';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
|
|
@ -20,4 +21,8 @@ export class LibraryService {
|
||||||
return this.httpClient.get<string[]>(this.baseUrl + 'library/list' + query);
|
return this.httpClient.get<string[]>(this.baseUrl + 'library/list' + query);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getLibraries() {
|
||||||
|
return this.httpClient.get<Library[]>(this.baseUrl + 'library');
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,6 @@ export class DashboardComponent implements OnInit {
|
||||||
constructor(private router: Router) {
|
constructor(private router: Router) {
|
||||||
// TODO: Depending on active route, set the tab else default to first tab.
|
// TODO: Depending on active route, set the tab else default to first tab.
|
||||||
console.log('current route: ', this.router.url);
|
console.log('current route: ', this.router.url);
|
||||||
//this.router.url === '/login'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,8 @@
|
||||||
import { Component, OnInit } from '@angular/core';
|
import { Component, OnInit } from '@angular/core';
|
||||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||||
import { DirectoryPickerComponent, DirectoryPickerResult } from 'src/app/directory-picker/directory-picker.component';
|
import { DirectoryPickerComponent, DirectoryPickerResult } from 'src/app/directory-picker/directory-picker.component';
|
||||||
|
import { Library } from 'src/app/_models/library';
|
||||||
|
import { LibraryService } from 'src/app/_services/library.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-manage-library',
|
selector: 'app-manage-library',
|
||||||
|
|
@ -9,9 +11,16 @@ import { DirectoryPickerComponent, DirectoryPickerResult } from 'src/app/directo
|
||||||
})
|
})
|
||||||
export class ManageLibraryComponent implements OnInit {
|
export class ManageLibraryComponent implements OnInit {
|
||||||
|
|
||||||
constructor(private modalService: NgbModal) { }
|
libraries: Library[] = [];
|
||||||
|
|
||||||
|
constructor(private modalService: NgbModal, private libraryService: LibraryService) { }
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
|
||||||
|
this.libraryService.getLibraries().subscribe(libraries => {
|
||||||
|
this.libraries = libraries;
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
addFolder(library: string) {
|
addFolder(library: string) {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,20 @@
|
||||||
|
|
||||||
|
|
||||||
<h2>Members:</h2>
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<ul>
|
<div class="row mb-2">
|
||||||
<li *ngFor="let member of members">
|
<div class="col-8"><h3>Members</h3></div>
|
||||||
{{member.username}}
|
<div class="col-4"><button class="btn btn-primary pull-right">New User</button></div>
|
||||||
|
</div>
|
||||||
|
<ul class="list-group">
|
||||||
|
<li *ngFor="let member of members" class="list-group-item">
|
||||||
|
<div>
|
||||||
|
<div>Name: {{member.username | titlecase}}</div>
|
||||||
|
<div>Sharing: {{member?.libraries ? member?.libraries : 'None'}}</div>
|
||||||
|
<div>Last Active: {{member.lastActive | date}}</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button class="btn btn-primary pull-right">Edit</button>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue