Implemented ad-hoc scan library support.
This commit is contained in:
parent
1d54eaa862
commit
c37dba4034
2 changed files with 9 additions and 5 deletions
|
|
@ -5,18 +5,15 @@
|
|||
</div>
|
||||
<ul class="list-group" *ngIf="!createLibraryToggle; else createLibrary">
|
||||
<li *ngFor="let library of libraries" class="list-group-item">
|
||||
<!-- We can move this into a view-member component -->
|
||||
<div>
|
||||
<h4>
|
||||
{{library.name | titlecase}}
|
||||
<div class="pull-right">
|
||||
<button class="btn btn-secondary mr-2 btn-sm" (click)="scanLibrary(library)"><i class="fa fa-sync-alt" title="Scan"></i></button>
|
||||
<button class="btn btn-danger mr-2 btn-sm" (click)="deleteLibrary(library)"><i class="fa fa-trash" title="Delete {{library.name | titlecase}}"></i></button>
|
||||
<button class="btn btn-primary btn-sm" (click)="editLibrary(library)"><i class="fa fa-pencil" title="Edit {{library.name | titlecase}}"></i></button>
|
||||
</div>
|
||||
</h4>
|
||||
<!-- <div>Last Active: {{member.lastActive | date}}</div>
|
||||
<div *ngIf="!member.isAdmin">Sharing: {{member?.libraries ? member?.libraries : 'None'}}</div> -->
|
||||
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap';
|
||||
import { ToastrService } from 'ngx-toastr';
|
||||
import { Library } from 'src/app/_models/library';
|
||||
import { LibraryService } from 'src/app/_services/library.service';
|
||||
import { DirectoryPickerComponent, DirectoryPickerResult } from '../_modals/directory-picker/directory-picker.component';
|
||||
|
|
@ -15,7 +16,7 @@ export class ManageLibraryComponent implements OnInit {
|
|||
libraries: Library[] = [];
|
||||
createLibraryToggle = false;
|
||||
|
||||
constructor(private modalService: NgbModal, private libraryService: LibraryService) { }
|
||||
constructor(private modalService: NgbModal, private libraryService: LibraryService, private toastr: ToastrService) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
|
||||
|
|
@ -57,4 +58,10 @@ export class ManageLibraryComponent implements OnInit {
|
|||
}
|
||||
}
|
||||
|
||||
scanLibrary(library: Library) {
|
||||
this.libraryService.scan(library.id).subscribe(() => {
|
||||
this.toastr.success('A scan has been queued for ' + library.name);
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue