1
0
forked from boos/BoosAPI

feat: add sorting and pinning functionality for accounts and sites

- Introduced `isPinned` and `sortOrder` fields in the `accounts` and `sites` tables to allow users to pin and sort their accounts and sites.
- Updated API routes to handle pinning and sorting operations for accounts and sites.
- Enhanced the frontend to support sorting by balance and custom order, as well as toggling the pin status of accounts and sites.
- Added tests for sorting and reordering logic to ensure correct functionality.
- Updated documentation to reflect changes in token management and new features.
This commit is contained in:
cita
2026-02-28 23:45:30 +08:00
parent 08eaf11ea2
commit 44af9a91cf
17 changed files with 647 additions and 67 deletions
@@ -5,7 +5,7 @@ const VERSION = 'v1';
const ALGORITHM = 'aes-256-gcm';
function buildKey(): Buffer {
const secret = (config.accountCredentialSecret || '').trim() || config.authToken || 'change-me';
const secret = (config.accountCredentialSecret || '').trim() || config.authToken || 'change-me-admin-token';
return createHash('sha256').update(secret).digest();
}
+4
View File
@@ -161,6 +161,8 @@ function buildAccountsSectionFromRefBackup(data: RawBackupData): AccountsBackupS
url: siteUrl,
platform,
status: 'active',
isPinned: false,
sortOrder: sites.length,
apiKey: null,
createdAt: toIsoString(item.created_at),
updatedAt: toIsoString(item.updated_at),
@@ -213,6 +215,8 @@ function buildAccountsSectionFromRefBackup(data: RawBackupData): AccountsBackupS
unitCost: null,
valueScore: 0,
status: asBoolean(item.disabled, false) ? 'disabled' : 'active',
isPinned: false,
sortOrder: accounts.length,
checkinEnabled: asBoolean(checkin.autoCheckInEnabled, true),
lastCheckinAt: null,
lastBalanceRefresh: null,