mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-11 17:17:26 +01:00
better toasts, better dashboard, first implementation of consumer status
This commit is contained in:
parent
572e40ca27
commit
036f11acaa
28 changed files with 450 additions and 134 deletions
|
|
@ -0,0 +1,41 @@
|
|||
import { Component, Input, OnDestroy, OnInit } from '@angular/core';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { PaperlessDocument } from 'src/app/data/paperless-document';
|
||||
import { SavedViewConfig } from 'src/app/data/saved-view-config';
|
||||
import { ConsumerStatusService } from 'src/app/services/consumer-status.service';
|
||||
import { DocumentService } from 'src/app/services/rest/document.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-saved-view-widget',
|
||||
templateUrl: './saved-view-widget.component.html',
|
||||
styleUrls: ['./saved-view-widget.component.css']
|
||||
})
|
||||
export class SavedViewWidgetComponent implements OnInit, OnDestroy {
|
||||
|
||||
constructor(private documentService: DocumentService, private consumerStatusService: ConsumerStatusService) { }
|
||||
|
||||
@Input()
|
||||
viewConfig: SavedViewConfig
|
||||
|
||||
documents: PaperlessDocument[]
|
||||
|
||||
subscription: Subscription
|
||||
|
||||
ngOnInit(): void {
|
||||
this.reload()
|
||||
this.subscription = this.consumerStatusService.onDocumentConsumptionFinished().subscribe(status => {
|
||||
this.reload()
|
||||
})
|
||||
}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.subscription.unsubscribe()
|
||||
}
|
||||
|
||||
reload() {
|
||||
this.documentService.list(1,10,this.viewConfig.sortField,this.viewConfig.sortDirection,this.viewConfig.filterRules).subscribe(result => {
|
||||
this.documents = result.results
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue