feat: Add batch delete functionality and enhance chart tooltips in statistics cards

This commit is contained in:
web
2025-09-03 07:17:21 -07:00
parent f4a1237619
commit c4f536eb05
3 changed files with 134 additions and 15 deletions
+17
View File
@@ -317,6 +317,23 @@ export default function ServersPage() {
{t('copy')}
</Button>,
],
batchRender(rows) {
return [
<ConfirmButton
key='delete'
trigger={<Button variant='destructive'>{t('delete')}</Button>}
title={t('confirmDeleteTitle')}
description={t('confirmDeleteDesc')}
onConfirm={async () => {
await Promise.all(rows.map((r) => deleteServer({ id: r.id })));
toast.success(t('deleted'));
ref.current?.refresh();
}}
cancelText={t('cancel')}
confirmText={t('confirm')}
/>,
];
},
}}
onSort={async (source, target, items) => {
const sourceIndex = items.findIndex((item) => String(item.id) === source);