diff --git a/src/modules/dashboard/mod.rs b/src/modules/dashboard/mod.rs
index f570a13..66b787b 100644
--- a/src/modules/dashboard/mod.rs
+++ b/src/modules/dashboard/mod.rs
@@ -16,12 +16,12 @@
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see .
-
use poem_openapi::Object;
use serde::{Deserialize, Serialize};
use tantivy::{schema::Value, TantivyDocument};
use crate::{
+ bichon_version,
modules::{
account::migration::AccountModel,
error::{code::ErrorCode, BichonResult},
@@ -45,6 +45,8 @@ pub struct DashboardStats {
pub with_attachment_count: u64, // Emails with attachments
pub without_attachment_count: u64, // Emails without attachments
pub top_largest_emails: Vec, // Top 10 largest emails
+ pub system_version: String, // The semantic version string of the currently running backend service
+ pub commit_hash: String, // Git commit hash used to build this system version
}
impl DashboardStats {
@@ -57,6 +59,8 @@ impl DashboardStats {
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InternalError))?;
stat.index_usage_bytes = get_total_size(&DATA_DIR_MANAGER.envelope_dir)
.map_err(|e| raise_error!(format!("{:#?}", e), ErrorCode::InternalError))?;
+ stat.system_version = bichon_version!().to_string();
+ stat.commit_hash = env!("GIT_HASH").to_string();
Ok(stat)
}
}
diff --git a/web/src/api/system/api.ts b/web/src/api/system/api.ts
index 6f14cb5..1360987 100644
--- a/web/src/api/system/api.ts
+++ b/web/src/api/system/api.ts
@@ -54,6 +54,8 @@ export interface DashboardStats {
with_attachment_count: number; // Emails with attachments
without_attachment_count: number; // Emails without attachments
top_largest_emails: LargestEmail[]; // Top 10 largest emails
+ system_version: string, //The semantic version string of the currently running backend service
+ commit_hash: string //Git commit hash used to build this system version
}
export interface TimeBucket {
diff --git a/web/src/features/dashboard/index.tsx b/web/src/features/dashboard/index.tsx
index 3d373ac..99ebd31 100644
--- a/web/src/features/dashboard/index.tsx
+++ b/web/src/features/dashboard/index.tsx
@@ -10,11 +10,11 @@
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
-// along with this program. If not, see .
+// along with this program. If not, see .
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from '@/components/ui/card';
@@ -22,7 +22,7 @@ import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from '@/components/ui/table';
import { Skeleton } from '@/components/ui/skeleton';
import { XAxis, YAxis, CartesianGrid, Tooltip, ResponsiveContainer, PieChart, Pie, Cell, BarChart, Bar } from 'recharts';
-import { Mail, HardDrive, Database, Users, Inbox } from 'lucide-react';
+import { Mail, HardDrive, Database, Users, Inbox, Info } from 'lucide-react';
import { formatBytes, formatNumber } from '@/lib/utils';
import { useQuery } from '@tanstack/react-query';
import { get_dashboard_stats, TimeBucket } from '@/api/system/api';
@@ -94,7 +94,7 @@ export default function MailArchiveDashboard() {
queryFn: get_dashboard_stats,
});
- const { t } = useTranslation();
+ const { t } = useTranslation();
const totalAttachments = (stats?.with_attachment_count ?? 0) + (stats?.without_attachment_count ?? 0);
const attachmentRatio = totalAttachments > 0 ? (stats?.with_attachment_count ?? 0) / totalAttachments : 0;
@@ -123,8 +123,8 @@ export default function MailArchiveDashboard() {
-
- {[...Array(5)].map((_, i) => (
+
+ {[...Array(6)].map((_, i) => (
))}
@@ -156,8 +156,8 @@ export default function MailArchiveDashboard() {
-
-
+
+
{t('dashboard.mailAccounts')}
@@ -212,6 +212,29 @@ export default function MailArchiveDashboard() {