@using AIStudio.Tools.ChatArchive @inherits MSGComponentBase @T("Back up all your data into one file: your settings, chats, plugins, and the indexes of your data sources. Your API keys and passwords stay out of it. AI Studio keeps them in the secure storage of your OS.") @if (this.DataBackupService.IsRunning) { @this.BackupProgressText @T("Cancel") @T("The backup goes on when you leave this page.") } else { @if (this.DataBackupService.LastResult is { } backupResult) { @if (backupResult.Success) { @string.Format(T("Backed up {0} files into: {1}"), backupResult.FileCount, backupResult.ArchivePath) @if (!backupResult.IncludesDataSourceIndexes) { @T("The indexes of your data sources are not part of this backup, because they were not available. After a restore, AI Studio indexes your data sources anew.") } } else if (backupResult.Cancelled) { @T("The backup was stopped. No file was left behind.") } else { @backupResult.Issue } } } @T("Restore a backup: replace all your data with those of the backup, e.g., on a new computer, or add only its chats to the chats you have.") @if (this.DataRestoreService.IsRestoreUnfinished) { @T("AI Studio has not finished restoring an earlier backup yet. Please restart AI Studio first.") } @if (!string.IsNullOrWhiteSpace(this.selectedArchivePath)) { @this.selectedArchivePath } @if (this.preview is { } backupPreview) { @if (!backupPreview.Success) { @backupPreview.Issue } else { @string.Format(T("Created on {0} with AI Studio {1}"), CommonTools.FormatTimestampToGeneral(backupPreview.Manifest.CreatedAt.ToLocalTime().DateTime, this.currentCultureInfo), backupPreview.Manifest.AppVersion) @foreach (var workspace in backupPreview.Manifest.Workspaces) { @($"{workspace.Name} ({this.ChatCount(workspace.Chats.Count)})") } @if (backupPreview.Manifest.TemporaryChats.Count > 0) { @($"{T("Temporary chats")} ({this.ChatCount(backupPreview.Manifest.TemporaryChats.Count)})") } @T("Replace all data") @T("Replaces your settings, chats, plugins, and the indexes of your data sources with those of the backup. AI Studio restarts to do so. The plugins and settings of your organization stay as they are.") @if (this.DataRestoreService.IsPreparing) { @this.RestoreProgressText @T("Cancel") } else { @T("Replace all data") } @if (this.DataRestoreService.LastResult is { Success: false } restoreResult) { @(restoreResult.Cancelled ? T("The restore was stopped. All your data stay as they are.") : restoreResult.Issue) } @T("Add chats only") @T("Adds the chats of the backup to the chats you have. Nothing else changes.") @T("Keep the existing chat") @T("Add it as an additional chat") @if (this.isImporting) { @string.Format(T("Chat {0} of {1}"), this.importProgress.ProcessedChats + 1, this.importProgress.TotalChats) @T("Cancel") @T("Please stay on this page until this is done. Leaving the page stops adding the chats.") } else { @this.AddChatsText(backupPreview.Manifest.TotalChatCount) } } } @if (this.importResult is { } importOutcome) { @if (importOutcome.Success) { @string.Format(T("Chats added: {0}. Workspaces they went into: {1}."), importOutcome.ImportedChats, importOutcome.ImportedWorkspaces) @if (importOutcome.Cancelled) { @T("Adding the chats was stopped. The chats added until then were kept.") } @if (importOutcome.SkippedChats > 0) { @string.Format(T("Chats which already existed and stayed as they are: {0}."), importOutcome.SkippedChats) } @if (importOutcome.FailedChats > 0) { @string.Format(T("Chats which could not be added: {0}."), importOutcome.FailedChats) } } else { @importOutcome.Issue } }