public BackupAjaxHandler( BackupService backupService, TenantManager tenantManager, MessageService messageService, CoreBaseSettings coreBaseSettings, CoreConfiguration coreConfiguration, PermissionContext permissionContext, SecurityContext securityContext, UserManager userManager, TenantExtra tenantExtra, ConsumerFactory consumerFactory, BackupFileUploadHandler backupFileUploadHandler) { TenantManager = tenantManager; MessageService = messageService; CoreBaseSettings = coreBaseSettings; CoreConfiguration = coreConfiguration; PermissionContext = permissionContext; SecurityContext = securityContext; UserManager = userManager; TenantExtra = tenantExtra; ConsumerFactory = consumerFactory; BackupFileUploadHandler = backupFileUploadHandler; BackupService = backupService; }
public void StartRestore(string backupId, BackupStorageType storageType, Dictionary <string, string> storageParams, bool notify) { DemandPermissionsRestore(); var restoreRequest = new StartRestoreRequest { TenantId = GetCurrentTenantId(), NotifyAfterCompletion = notify, StorageParams = storageParams }; if (Guid.TryParse(backupId, out var guidBackupId)) { restoreRequest.BackupId = guidBackupId; } else { restoreRequest.StorageType = storageType; restoreRequest.FilePathOrId = storageParams["filePath"]; if (restoreRequest.StorageType == BackupStorageType.Local && !CoreBaseSettings.Standalone) { restoreRequest.FilePathOrId = BackupFileUploadHandler.GetFilePath(); } } BackupService.StartRestore(restoreRequest); }