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 {
|
||||
username: string;
|
||||
lastActive: string; // datetime
|
||||
created: string; // datetime
|
||||
isAdmin: boolean;
|
||||
libraries?: Library[];
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { Library } from '../_models/library';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
|
|
@ -20,4 +21,8 @@ export class LibraryService {
|
|||
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) {
|
||||
// TODO: Depending on active route, set the tab else default to first tab.
|
||||
console.log('current route: ', this.router.url);
|
||||
//this.router.url === '/login'
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
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({
|
||||
selector: 'app-manage-library',
|
||||
|
|
@ -9,9 +11,16 @@ import { DirectoryPickerComponent, DirectoryPickerResult } from 'src/app/directo
|
|||
})
|
||||
export class ManageLibraryComponent implements OnInit {
|
||||
|
||||
constructor(private modalService: NgbModal) { }
|
||||
libraries: Library[] = [];
|
||||
|
||||
constructor(private modalService: NgbModal, private libraryService: LibraryService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
this.libraryService.getLibraries().subscribe(libraries => {
|
||||
this.libraries = libraries;
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
addFolder(library: string) {
|
||||
|
|
|
|||
|
|
@ -1,10 +1,20 @@
|
|||
|
||||
|
||||
<h2>Members:</h2>
|
||||
<div class="container">
|
||||
<ul>
|
||||
<li *ngFor="let member of members">
|
||||
{{member.username}}
|
||||
<div class="row mb-2">
|
||||
<div class="col-8"><h3>Members</h3></div>
|
||||
<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>
|
||||
</ul>
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue