chore: fix build warnings, add deployment config, and cleanup lint errors
- Fix React Hook dependencies and Image optimization warnings - Add DATA_DIR and INITIAL_PASSWORD env var support - Fix Tailwind v4 legacy syntax and suppress CSS directives warnings - Add PropTypes and remove unused variables
This commit is contained in:
parent
0943387d24
commit
0848dd5d13
21 changed files with 156 additions and 114 deletions
|
|
@ -52,7 +52,7 @@ export default function UsageStats() {
|
|||
router.replace(`?${params.toString()}`, { scroll: false });
|
||||
};
|
||||
|
||||
const sortData = (dataMap, pendingMap = {}) => {
|
||||
const sortData = useCallback((dataMap, pendingMap = {}) => {
|
||||
return Object.entries(dataMap || {})
|
||||
.map(([key, data]) => {
|
||||
const totalTokens =
|
||||
|
|
@ -91,11 +91,11 @@ export default function UsageStats() {
|
|||
if (valA > valB) return sortOrder === "asc" ? 1 : -1;
|
||||
return 0;
|
||||
});
|
||||
};
|
||||
}, [sortBy, sortOrder]);
|
||||
|
||||
const sortedModels = useMemo(
|
||||
() => sortData(stats?.byModel, stats?.pending?.byModel),
|
||||
[stats?.byModel, stats?.pending?.byModel, sortBy, sortOrder]
|
||||
[stats?.byModel, stats?.pending?.byModel, sortData]
|
||||
);
|
||||
const sortedAccounts = useMemo(() => {
|
||||
// For accounts, pendingMap is by connectionId, but dataMap is by accountKey
|
||||
|
|
@ -114,7 +114,7 @@ export default function UsageStats() {
|
|||
});
|
||||
}
|
||||
return sortData(stats?.byAccount, accountPendingMap);
|
||||
}, [stats?.byAccount, stats?.pending?.byAccount, sortBy, sortOrder]);
|
||||
}, [stats?.byAccount, stats?.pending?.byAccount, sortData]);
|
||||
|
||||
const fetchStats = useCallback(async (showLoading = true) => {
|
||||
if (showLoading) setLoading(true);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue