|
|
@ -1,4 +1,4 @@
|
|
|
|
import {Component, EventEmitter, Output} from "@angular/core";
|
|
|
|
import {ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Output} from "@angular/core";
|
|
|
|
import {ImportService} from "../../../../../services/import/import.service";
|
|
|
|
import {ImportService} from "../../../../../services/import/import.service";
|
|
|
|
import {LoggingService} from "../../../../../services/logging/logging.service";
|
|
|
|
import {LoggingService} from "../../../../../services/logging/logging.service";
|
|
|
|
import {AddFileOptions} from "../../../../../models/AddFileOptions";
|
|
|
|
import {AddFileOptions} from "../../../../../models/AddFileOptions";
|
|
|
@ -9,7 +9,8 @@ import {FileOsMetadata} from "../../../../../../api/api-types/files";
|
|
|
|
@Component({
|
|
|
|
@Component({
|
|
|
|
selector: "app-filesystem-import",
|
|
|
|
selector: "app-filesystem-import",
|
|
|
|
templateUrl: "./filesystem-import.component.html",
|
|
|
|
templateUrl: "./filesystem-import.component.html",
|
|
|
|
styleUrls: ["./filesystem-import.component.scss"]
|
|
|
|
styleUrls: ["./filesystem-import.component.scss"],
|
|
|
|
|
|
|
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
|
|
})
|
|
|
|
})
|
|
|
|
export class FilesystemImportComponent {
|
|
|
|
export class FilesystemImportComponent {
|
|
|
|
|
|
|
|
|
|
|
@ -35,11 +36,17 @@ export class FilesystemImportComponent {
|
|
|
|
public resolving = false;
|
|
|
|
public resolving = false;
|
|
|
|
public importing = false;
|
|
|
|
public importing = false;
|
|
|
|
public importingProgress = 0;
|
|
|
|
public importingProgress = 0;
|
|
|
|
|
|
|
|
public importingProgressTotal = 0;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(private errorBroker: LoggingService, private importService: ImportService) {
|
|
|
|
constructor(
|
|
|
|
|
|
|
|
private changeDetector: ChangeDetectorRef,
|
|
|
|
|
|
|
|
private errorBroker: LoggingService,
|
|
|
|
|
|
|
|
private importService: ImportService
|
|
|
|
|
|
|
|
) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async setSelectedPaths(paths: string[]) {
|
|
|
|
public async setSelectedPaths(paths: string[]) {
|
|
|
|
|
|
|
|
this.changeDetector.markForCheck();
|
|
|
|
this.resolving = true;
|
|
|
|
this.resolving = true;
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
this.files = await this.importService.resolvePathsToFiles(paths);
|
|
|
|
this.files = await this.importService.resolvePathsToFiles(paths);
|
|
|
@ -49,6 +56,7 @@ export class FilesystemImportComponent {
|
|
|
|
this.errorBroker.error(err);
|
|
|
|
this.errorBroker.error(err);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.resolving = false;
|
|
|
|
this.resolving = false;
|
|
|
|
|
|
|
|
this.changeDetector.markForCheck();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public async import() {
|
|
|
|
public async import() {
|
|
|
@ -70,6 +78,7 @@ export class FilesystemImportComponent {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
count++;
|
|
|
|
count++;
|
|
|
|
this.importingProgress = (count / this.fileCount) * 100;
|
|
|
|
this.importingProgress = (count / this.fileCount) * 100;
|
|
|
|
|
|
|
|
this.importingProgressTotal = count;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
this.importing = false;
|
|
|
|
this.importing = false;
|
|
|
|