mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-03 14:38:50 +00:00
refactor(web): use nui data
This commit is contained in:
1 parent
9c8bb33c4a
commit
6e9fddd384
2 files changed
+37
-18
No files matched your search
@@ -2,9 +2,45 @@
|
|||||||
import { Route, router } from 'tinro';
|
import { Route, router } from 'tinro';
|
||||||
import Resource from './pages/resource/Resource.svelte';
|
import Resource from './pages/resource/Resource.svelte';
|
||||||
import Root from './pages/root/Root.svelte';
|
import Root from './pages/root/Root.svelte';
|
||||||
|
import { useNuiEvent } from './utils/useNuiEvent';
|
||||||
|
import { resources } from './store';
|
||||||
|
import { debugData } from './utils/debugData';
|
||||||
|
|
||||||
|
interface OpenData {
|
||||||
|
resources: string[];
|
||||||
|
totalQueries: number;
|
||||||
|
slowQueries: number;
|
||||||
|
totalTime: number;
|
||||||
|
chartData: {
|
||||||
|
x: number;
|
||||||
|
y: number;
|
||||||
|
z: number;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
router.mode.hash();
|
router.mode.hash();
|
||||||
router.goto('/');
|
router.goto('/');
|
||||||
|
|
||||||
|
useNuiEvent('openUI', (data: OpenData) => {
|
||||||
|
$resources = data.resources;
|
||||||
|
});
|
||||||
|
|
||||||
|
debugData<OpenData>([
|
||||||
|
{
|
||||||
|
action: 'openUI',
|
||||||
|
data: {
|
||||||
|
resources: ['ox_core', 'oxmysql', 'ox_inventory', 'ox_doorlock', 'ox_lib', 'ox_vehicleshop', 'ox_target'],
|
||||||
|
slowQueries: 13,
|
||||||
|
totalQueries: 332,
|
||||||
|
totalTime: 230123,
|
||||||
|
chartData: {
|
||||||
|
x: 2,
|
||||||
|
y: 5,
|
||||||
|
z: 3,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="w-full h-full flex justify-center items-center font-main">
|
<main class="w-full h-full flex justify-center items-center font-main">
|
||||||
|
|||||||
@@ -2,24 +2,7 @@
|
|||||||
import Input from '../../components/Input.svelte';
|
import Input from '../../components/Input.svelte';
|
||||||
import { IconSearch } from '@tabler/icons-svelte';
|
import { IconSearch } from '@tabler/icons-svelte';
|
||||||
import { router } from 'tinro';
|
import { router } from 'tinro';
|
||||||
import { search, filteredResources, resources } from '../../store';
|
import { search, filteredResources } from '../../store';
|
||||||
|
|
||||||
$resources = [
|
|
||||||
'ox_core',
|
|
||||||
'oxmysql',
|
|
||||||
'ox_inventory',
|
|
||||||
'ox_doorlock',
|
|
||||||
'ox_lib',
|
|
||||||
'ox_vehicleshop',
|
|
||||||
'ox_target',
|
|
||||||
'ox_core',
|
|
||||||
'oxmysql',
|
|
||||||
'ox_inventory',
|
|
||||||
'ox_doorlock',
|
|
||||||
'ox_lib',
|
|
||||||
'ox_vehicleshop',
|
|
||||||
'ox_target',
|
|
||||||
];
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="p-4 w-full h-full flex justify-between gap-4">
|
<div class="p-4 w-full h-full flex justify-between gap-4">
|
||||||
|
|||||||
Reference in new issue
Block a user