feat: detect legacy tantivy data layout and abort startup with migration hint

This commit is contained in:
rustmailer
2026-05-08 16:28:11 +08:00
parent 174d56e7b4
commit 66b595908c
26 changed files with 189 additions and 29 deletions
+2
View File
@@ -44,6 +44,7 @@ export const get_notifications = async () => {
export interface DashboardStats {
account_count: number; // Number of accounts
email_count: number; // Total number of emails
attachment_count: number; // Total number of attachments
total_size_bytes: number; // Total size of all emails (in bytes)
storage_usage_bytes: number; // Actual storage used (in bytes)
index_usage_bytes: number; // Index storage size (in bytes)
@@ -60,6 +61,7 @@ export interface DashboardStats {
export const INITIAL_DASHBOARD_STATS: DashboardStats = {
account_count: 0,
email_count: 0,
attachment_count: 0,
total_size_bytes: 0,
storage_usage_bytes: 0,
index_usage_bytes: 0,
+1 -2
View File
@@ -28,7 +28,7 @@ import { AccountTable } from './components/table'
import AccountProvider, {
type AccountDialogType,
} from './context'
import { MoreVertical, Plus } from 'lucide-react'
import { Plus } from 'lucide-react'
import Logo from '@/assets/logo.svg'
import { AccountDetailDrawer } from './components/account-detail'
import { AccountModel, list_accounts } from '@/api/account/api'
@@ -39,7 +39,6 @@ import { RunningStateDialog } from './components/running-state-dialog'
import { FixedHeader } from '@/components/layout/fixed-header'
import { DownloadFoldersDialog } from './components/download-folders'
import { NoSyncAccountDialog } from './components/nosync-dialog'
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from '@/components/ui/dropdown-menu'
import { useTranslation } from 'react-i18next'
import { AccountAccessAssignmentDialog } from './components/access-assignment-dialog'
import { useCurrentUser } from '@/hooks/use-current-user'
+29 -12
View File
@@ -219,21 +219,15 @@ export default function MailArchiveDashboard() {
<p className="text-xs text-muted-foreground">{t('dashboard.syncedLocally')}</p>
</CardContent>
</Card>
<Card className="md:col-span-2 lg:col-span-2">
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
<CardTitle className="text-xs font-bold uppercase tracking-wider">{t('dashboard.systemVersion')}</CardTitle>
<CardTitle className="text-xs font-bold uppercase tracking-wider">{t('dashboard.totalAttachments')}</CardTitle>
<Mail className="h-4 w-4 text-muted-foreground" />
</CardHeader>
<CardContent>
<div className='text-xl font-bold truncate text-primary tracking-tighter'>
{stats1.system_version ? (
<a href={`https://github.com/rustmailer/bichon/releases/tag/${stats1.system_version}`} target="_blank" rel="noopener noreferrer" className="hover:underline">
{stats1.system_version}
</a>
) : 'N/A'}
</div>
<div className="flex items-center gap-1.5 mt-1">
<GithubIcon className="h-5 w-5 text-muted-foreground" />
</div>
<div className="text-xl font-bold">{formatNumber(stats1.attachment_count)}</div>
<p className="text-xs text-muted-foreground">{t('dashboard.regularAttachments')}</p>
</CardContent>
</Card>
<Card className="md:col-span-6 lg:col-span-6">
@@ -558,7 +552,30 @@ export default function MailArchiveDashboard() {
</Main>
<div className="mt-auto p-6 text-center text-xs text-muted-foreground border-t">
© 2025-2026 <a href="https://rustmailer.com" target="_blank" rel="noopener noreferrer" className="hover:underline">rustmailer.com</a> - Bichon Email Archiving Project
<p>
© 2025-2026{" "}
<a
href="https://github.com/rustmailer/bichon"
target="_blank"
rel="noopener noreferrer"
className="hover:underline font-medium"
>
Bichon Email Archiving Project
</a>
{stats1.system_version && (
<>
<span className="mx-2 opacity-50"></span>
<a
href={`https://github.com/rustmailer/bichon/releases/tag/${stats1.system_version}`}
target="_blank"
rel="noopener noreferrer"
className="hover:underline font-mono"
>
v{stats1.system_version}
</a>
</>
)}
</p>
</div>
</>
);
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "لا يوجد نشاط حديث",
"noSendersData": "لا توجد بيانات للمرسلين",
"noSubject": "(لا يوجد موضوع)",
"regularAttachments": "المرفقات العادية",
"saved": "الموفرة",
"sender": "المرسل",
"size": "الحجم",
@@ -497,6 +498,7 @@
"top10LargestEmails": "أكبر 10 رسائل بريد إلكتروني",
"top10Senders": "أفضل 10 مرسلين",
"topLists": "القوائم الأعلى",
"totalAttachments": "إجمالي المرفقات",
"totalEmailSize": "الحجم الإجمالي لرسائل البريد الإلكتروني",
"totalEmails": "إجمالي رسائل البريد الإلكتروني",
"withAttachments": "مع مرفقات"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Ingen nylig aktivitet",
"noSendersData": "Ingen afsenderdata",
"noSubject": "(Intet emne)",
"regularAttachments": "Almindelige vedhæftede filer",
"saved": "Sparet",
"sender": "Afender",
"size": "Størrelse",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 Største E-mails",
"top10Senders": "Top 10 Afsendere",
"topLists": "Toplister",
"totalAttachments": "Samlet antal vedhæftede filer",
"totalEmailSize": "Samlet e-mailstørrelse",
"totalEmails": "Samlet antal e-mails",
"withAttachments": "Med vedhæftninger"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Keine kürzliche Aktivität",
"noSendersData": "Keine Absenderdaten",
"noSubject": "(Kein Betreff)",
"regularAttachments": "Reguläre Anhänge",
"saved": "Eingespart",
"sender": "Absender",
"size": "Größe",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 größte E-Mails",
"top10Senders": "Top 10 Absender",
"topLists": "Top-Listen",
"totalAttachments": "Anhänge insgesamt",
"totalEmailSize": "Gesamtgröße der E-Mails",
"totalEmails": "Gesamt-E-Mails",
"withAttachments": "Mit Anhängen"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "No recent activity",
"noSendersData": "No senders data",
"noSubject": "(No Subject)",
"regularAttachments": "Regular attachments",
"saved": "Saved",
"sender": "Sender",
"size": "Size",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 Largest Emails",
"top10Senders": "Top 10 Senders",
"topLists": "Top Lists",
"totalAttachments": "Total attachments",
"totalEmailSize": "Total Email Size",
"totalEmails": "Total Emails",
"withAttachments": "With Attachments"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Sin actividad reciente",
"noSendersData": "Sin datos de remitentes",
"noSubject": "(Sin asunto)",
"regularAttachments": "Adjuntos regulares",
"saved": "Ahorrado",
"sender": "Remitente",
"size": "Tamaño",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Los 10 correos más grandes",
"top10Senders": "Los 10 principales remitentes",
"topLists": "Listas principales",
"totalAttachments": "Total de adjuntos",
"totalEmailSize": "Tamaño total de correos",
"totalEmails": "Total de correos",
"withAttachments": "Con adjuntos"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Ei viimeaikaisia tapahtumia",
"noSendersData": "Ei lähettäjätietoja",
"noSubject": "(Ei aihetta)",
"regularAttachments": "Tavalliset liitteet",
"saved": "Säästetty",
"sender": "Lähettäjä",
"size": "Koko",
@@ -497,6 +498,7 @@
"top10LargestEmails": "10 suurinta sähköpostia",
"top10Senders": "10 parasta lähettäjää",
"topLists": "Parhaat listat",
"totalAttachments": "Liitteitä yhteensä",
"totalEmailSize": "Sähköpostien kokonaiskoko",
"totalEmails": "Sähköpostien kokonaismäärä",
"withAttachments": "Liitteillä"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Aucune activité récente",
"noSendersData": "Aucune donnée d'expéditeurs",
"noSubject": "(Aucun Objet)",
"regularAttachments": "Pièces jointes standard",
"saved": "Économisé",
"sender": "Expéditeur",
"size": "Taille",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 des E-mails les Plus Volumineux",
"top10Senders": "Top 10 des Expéditeurs",
"topLists": "Top Listes",
"totalAttachments": "Total des pièces jointes",
"totalEmailSize": "Taille totale des e-mails",
"totalEmails": "Total des e-mails",
"withAttachments": "Avec Pièces Jointes"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Nessuna attività recente",
"noSendersData": "Nessun dato sui mittenti",
"noSubject": "(Nessun Oggetto)",
"regularAttachments": "Allegati regolari",
"saved": "Risparmiato",
"sender": "Mittente",
"size": "Dimensione",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Le 10 Email più Grandi",
"top10Senders": "I 10 Mittenti Principali",
"topLists": "Liste Top",
"totalAttachments": "Allegati totali",
"totalEmailSize": "Dimensione totale email",
"totalEmails": "Email totali",
"withAttachments": "Con Allegati"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "最近のアクティビティなし",
"noSendersData": "送信者データなし",
"noSubject": "(件名なし)",
"regularAttachments": "通常の添付ファイル",
"saved": "節約済み",
"sender": "送信者",
"size": "サイズ",
@@ -497,6 +498,7 @@
"top10LargestEmails": "容量の大きいメールトップ10",
"top10Senders": "送信者トップ10",
"topLists": "トップリスト",
"totalAttachments": "添付ファイル総数",
"totalEmailSize": "メール総容量",
"totalEmails": "合計メール数",
"withAttachments": "添付ファイルあり"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "최근 활동 없음",
"noSendersData": "발신자 데이터 없음",
"noSubject": "(제목 없음)",
"regularAttachments": "일반 첨부 파일",
"saved": "절약됨",
"sender": "발신자",
"size": "크기",
@@ -497,6 +498,7 @@
"top10LargestEmails": "상위 10개 최대 크기 이메일",
"top10Senders": "상위 10명 발신자",
"topLists": "상위 목록",
"totalAttachments": "총 첨부 파일",
"totalEmailSize": "총 이메일 크기",
"totalEmails": "총 이메일 수",
"withAttachments": "첨부 파일 포함"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Geen recente activiteit",
"noSendersData": "Geen afzendersgegevens",
"noSubject": "(Geen Onderwerp)",
"regularAttachments": "Reguliere bijlagen",
"saved": "Bespaard",
"sender": "Afzender",
"size": "Grootte",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 Grootste e-mails",
"top10Senders": "Top 10 Afzenders",
"topLists": "Toplijsten",
"totalAttachments": "Totaal aantal bijlagen",
"totalEmailSize": "Totale e-mailgrootte",
"totalEmails": "Totaal aantal e-mails",
"withAttachments": "Met Bijlagen"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Ingen nylig aktivitet",
"noSendersData": "Ingen avsenderdata",
"noSubject": "(Uten emne)",
"regularAttachments": "Vanlige vedlegg",
"saved": "Spart",
"sender": "Avsender",
"size": "Størrelse",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Topp 10 største e-poster",
"top10Senders": "Topp 10 avsendere",
"topLists": "Topplister",
"totalAttachments": "Totalt antall vedlegg",
"totalEmailSize": "Total e-poststørrelse",
"totalEmails": "Totalt antall e-poster",
"withAttachments": "Med vedlegg"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Brak aktywności",
"noSendersData": "Brak danych od Nadawcy",
"noSubject": "(brak tematu)",
"regularAttachments": "Zwykłe załączniki",
"saved": "Zaoszczędzone",
"sender": "Nadawca",
"size": "Rozmiar",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 największych wiadomości",
"top10Senders": "Top 10 Nadawców",
"topLists": "Lista TOP",
"totalAttachments": "Łączna liczba załączników",
"totalEmailSize": "Wielkość wszystkich wiadomości",
"totalEmails": "Wszystkie wiadomości",
"withAttachments": "Z załącznikami"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Nenhuma Atividade Recente",
"noSendersData": "Sem Dados de Remetentes",
"noSubject": "(Sem Assunto)",
"regularAttachments": "Anexos regulares",
"saved": "Economizado",
"sender": "Remetente",
"size": "Tamanho",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Top 10 Maiores Emails",
"top10Senders": "Top 10 Remetentes",
"topLists": "Principais Listas",
"totalAttachments": "Total de anexos",
"totalEmailSize": "Tamanho Total do Email",
"totalEmails": "Total de Emails",
"withAttachments": "Com Anexos"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Нет недавней активности",
"noSendersData": "Нет данных об отправителях",
"noSubject": "(Без темы)",
"regularAttachments": "Обычные вложения",
"saved": "Сэкономлено",
"sender": "Отправитель",
"size": "Размер",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Топ 10 самых больших писем",
"top10Senders": "Топ 10 отправителей",
"topLists": "Топ списки",
"totalAttachments": "Всего вложений",
"totalEmailSize": "Общий размер писем",
"totalEmails": "Всего писем",
"withAttachments": "С вложениями"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "Ingen nylig aktivitet",
"noSendersData": "Inga avsändardata",
"noSubject": "(Inget ämne)",
"regularAttachments": "Vanliga bilagor",
"saved": "Sparat",
"sender": "Avsändare",
"size": "Storlek",
@@ -497,6 +498,7 @@
"top10LargestEmails": "Topp 10 största e-postmeddelanden",
"top10Senders": "Topp 10 avsändare",
"topLists": "Topplistor",
"totalAttachments": "Totalt antal bilagor",
"totalEmailSize": "Total e-poststorlek",
"totalEmails": "Totalt antal e-postmeddelanden",
"withAttachments": "Med bilagor"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "無近期活動",
"noSendersData": "無寄件人資料",
"noSubject": "(無主旨)",
"regularAttachments": "普通附件",
"saved": "節省空間",
"sender": "寄件人",
"size": "大小",
@@ -497,6 +498,7 @@
"top10LargestEmails": "前 10 封最大郵件",
"top10Senders": "前 10 名寄件人",
"topLists": "排行榜",
"totalAttachments": "附件總數",
"totalEmailSize": "郵件總容量",
"totalEmails": "郵件總數",
"withAttachments": "包含附件"
+2
View File
@@ -484,6 +484,7 @@
"noRecentActivity": "无最近活动",
"noSendersData": "无发件人数据",
"noSubject": "(无主题)",
"regularAttachments": "普通附件",
"saved": "节省空间",
"sender": "发件人",
"size": "大小",
@@ -497,6 +498,7 @@
"top10LargestEmails": "前10大邮件",
"top10Senders": "前10名发件人",
"topLists": "排行榜",
"totalAttachments": "附件总数",
"totalEmailSize": "邮件总大小",
"totalEmails": "邮件总数",
"withAttachments": "包含附件"