import * as widgets from "oasi-widgets"; import * as angular from "angular"; import { IFileInfo, IVerifyResult, FileRestService } from 'isogd-file-rest/'; export class VerifyController { static $inject = ['$uibModalInstance', 'fileRestService', 'toastr', 'fileInfo']; private loading: widgets.LoadingStatus = widgets.LoadingStatus.LOADING; private result: IVerifyResult; constructor(private $uibModalInstance: angular.ui.bootstrap.IModalServiceInstance, private fileRestService: FileRestService, private toastr: Toastr, private fileInfo: IFileInfo) { this.fileRestService.verifySign(this.fileInfo.fileId).then((data: IVerifyResult) => { this.result = data; this.loading = widgets.LoadingStatus.SUCCESS; }, (error) => { this.toastr.error("Ошибка при проверке подписи!"); this.loading = widgets.LoadingStatus.ERROR; this.$uibModalInstance.dismiss('cancel'); }); } cancel() { this.$uibModalInstance.dismiss('cancel'); }; }