Major UI overhaul: bigger icons, creative inventory tabs, grouped smelting, alerts popup, analytics, mod icons
- Inventory: Bigger item icons (48px) filling their slots, MC-style hover tooltips - Creative inventory category tabs (All/Blocks/Tools/Combat/Food/Redstone/Materials/Misc) - Smelting recipes grouped by output item with collapsible sections - Alerts moved from full tab to popup overlay triggered from header bell icon - New Analytics tab with SVG charts (storage over time, top items, item trend lookup) - Mod icon support for ComputerCraft (CC:Tweaked) via GitHub CDN fallback - Server: new /api/history-summary endpoint for aggregate storage history - Store: fetchHistorySummary and fetchItemHistory for analytics data
This commit is contained in:
@@ -124,6 +124,13 @@ const getItemHistory = db.prepare(`
|
||||
LIMIT ?
|
||||
`);
|
||||
|
||||
const getHistorySummaryStmt = db.prepare(`
|
||||
SELECT recorded_at as recordedAt, SUM(count) as total
|
||||
FROM item_history
|
||||
GROUP BY recorded_at
|
||||
ORDER BY recorded_at ASC
|
||||
`);
|
||||
|
||||
// Cleanup old history (keep last 7 days)
|
||||
const cleanupHistory = db.prepare(`
|
||||
DELETE FROM item_history WHERE recorded_at < ?
|
||||
@@ -292,6 +299,13 @@ export function getHistory(itemName, limit = 100) {
|
||||
return getItemHistory.all(itemName, limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get aggregate total item count over time
|
||||
*/
|
||||
export function getHistorySummary() {
|
||||
return getHistorySummaryStmt.all();
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the full last-known inventory state from DB
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user