some changes

This commit is contained in:
jonaswinkler
2021-01-04 23:05:16 +01:00
parent 179b53d373
commit 21df7b39cb
6 changed files with 356 additions and 76 deletions

View File

@@ -31,7 +31,7 @@ export class AppComponent implements OnInit, OnDestroy {
this.consumerStatusService.connect()
this.successSubscription = this.consumerStatusService.onDocumentConsumptionFinished().subscribe(status => {
this.toastService.showToast({title: "Document added", content: `Document ${status.filename} was added to paperless.`, actionName: "Open document", action: () => {
this.toastService.show({title: "Document added", delay: 10000, content: `Document ${status.filename} was added to paperless.`, actionName: "Open document", action: () => {
this.router.navigate(['documents', status.document_id])
}})
})

View File

@@ -1,8 +1,8 @@
<ngb-toast
*ngFor="let toast of toasts"
[header]="toast.title" [autohide]="true" [delay]="toast.delay || 5000"
[header]="toast.title" [autohide]="true" [delay]="toast.delay"
[class]="toast.classname"
(hide)="toastService.closeToast(toast)">
<p>{{toast.content}}</p>
<p *ngIf="toast.action"><button class="btn btn-sm btn-outline-secondary" (click)="toastService.closeToast(toast); toast.action()">{{toast.actionName}}</button></p>
</ngb-toast>
</ngb-toast>

View File

@@ -6,7 +6,7 @@ export const environment = {
production: false,
apiBaseUrl: "http://localhost:8000/api/",
appTitle: "Paperless-ng",
version: "DEVELOPMENT"
version: "DEVELOPMENT",
wsBaseUrl: "ws://localhost:8000/ws/"
};