mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-02 22:22:50 +00:00
feat(nui): WIP manual pagination
This commit is contained in:
1 parent
3a1462e0c0
commit
7560099231
8 files changed
+67
-57
No files matched your search
+6
-4
@@ -48,12 +48,14 @@ RegisterCommand(
|
||||
true
|
||||
);
|
||||
|
||||
onNet(`oxmysql:fetchResource`, (resource: string) => {
|
||||
if (typeof resource !== 'string') return;
|
||||
onNet(`oxmysql:fetchResource`, (data: {resource: string, pageIndex: number}) => {
|
||||
if (typeof data.resource !== 'string') return;
|
||||
|
||||
const queries = logStorage[resource];
|
||||
const queries = logStorage[data.resource].slice(data.pageIndex * 12, data.pageIndex + 12)
|
||||
|
||||
const pageCount = Math.ceil(logStorage[data.resource].length / 12)
|
||||
|
||||
if (!queries) return;
|
||||
|
||||
emitNet(`oxmysql:loadResource`, source, queries);
|
||||
emitNet(`oxmysql:loadResource`, source, {queries, pageCount});
|
||||
});
|
||||
Reference in new issue
Block a user