mirror of
https://github.com/darksaid98/oxmysql.git
synced 2026-12-01 14:38:50 +00:00
refactor(web): visibility handling
This commit is contained in:
1 parent
e06c61d292
commit
fb78adec43
6 files changed
+24
-10
No files matched your search
@@ -31,12 +31,12 @@ jobs:
|
||||
- name: Bundle files
|
||||
run: |
|
||||
mkdir -p ./temp/oxmysql
|
||||
mkdir -p ./temp/oxmysql/ui/
|
||||
mkdir -p ./temp/oxmysql/web/
|
||||
mkdir -p ./temp/oxmysql/lib/
|
||||
cp ./{LICENSE,README.md,fxmanifest.lua,ui.lua} ./temp/oxmysql
|
||||
cp ./lib/{MySQL.lua,define.lua} ./temp/oxmysql/lib
|
||||
cp -r ./dist ./temp/oxmysql
|
||||
cp -r ./ui/build ./temp/oxmysql/ui/
|
||||
cp -r ./web/build ./temp/oxmysql/web/
|
||||
cd ./temp && zip -r ../oxmysql.zip ./oxmysql
|
||||
|
||||
- name: Create Release
|
||||
|
||||
@@ -66,12 +66,12 @@ jobs:
|
||||
- name: Bundle files
|
||||
run: |
|
||||
mkdir -p ./temp/oxmysql
|
||||
mkdir -p ./temp/oxmysql/ui/
|
||||
mkdir -p ./temp/oxmysql/web/
|
||||
mkdir -p ./temp/oxmysql/lib/
|
||||
cp ./{LICENSE,README.md,fxmanifest.lua,ui.lua} ./temp/oxmysql
|
||||
cp ./lib/{MySQL.lua,define.lua} ./temp/oxmysql/lib
|
||||
cp -r ./dist ./temp/oxmysql
|
||||
cp -r ./ui/build ./temp/oxmysql/ui/
|
||||
cp -r ./web/build ./temp/oxmysql/web/
|
||||
cd ./temp && zip -r ../oxmysql.zip ./oxmysql
|
||||
|
||||
- name: Create Release
|
||||
|
||||
+3
-3
@@ -15,11 +15,11 @@ client_script 'ui.lua'
|
||||
server_script 'dist/build.js'
|
||||
|
||||
files {
|
||||
'ui/build/index.html',
|
||||
'ui/build/**/*'
|
||||
'web/build/index.html',
|
||||
'web/build/**/*'
|
||||
}
|
||||
|
||||
ui_page 'ui/build/index.html'
|
||||
ui_page 'web/build/index.html'
|
||||
|
||||
provide 'mysql-async'
|
||||
provide 'ghmattimysql'
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
{
|
||||
"packages": ["ui"],
|
||||
"packages": ["web"],
|
||||
"npmClient": "pnpm",
|
||||
"version": "0.0.0"
|
||||
}
|
||||
+14
-2
@@ -5,6 +5,8 @@
|
||||
import { useNuiEvent } from './utils/useNuiEvent';
|
||||
import { resources, generalData } from './store';
|
||||
import { debugData } from './utils/debugData';
|
||||
import { visible } from './store';
|
||||
import { scale } from 'svelte/transition';
|
||||
|
||||
interface OpenData {
|
||||
resources: string[];
|
||||
@@ -22,6 +24,7 @@
|
||||
router.goto('/');
|
||||
|
||||
useNuiEvent('openUI', (data: OpenData) => {
|
||||
$visible = true;
|
||||
$resources = data.resources;
|
||||
$generalData = {
|
||||
queries: data.totalQueries,
|
||||
@@ -46,9 +49,17 @@
|
||||
},
|
||||
},
|
||||
]);
|
||||
|
||||
const handleESC = (e: KeyboardEvent) => e.key === 'Escape' && ($visible = false);
|
||||
|
||||
$: $visible ? window.addEventListener('keydown', handleESC) : window.removeEventListener('keydown', handleESC);
|
||||
</script>
|
||||
|
||||
<main class="w-full h-full flex justify-center items-center font-main">
|
||||
{#if $visible}
|
||||
<main
|
||||
transition:scale={{ start: 0.95, duration: 150 }}
|
||||
class="w-full h-full flex justify-center items-center font-main"
|
||||
>
|
||||
<div class="bg-dark-800 text-white w-[1000px] h-[600px] flex rounded-md">
|
||||
<Route path="/">
|
||||
<Root />
|
||||
@@ -57,4 +68,5 @@
|
||||
<Resource />
|
||||
</Route>
|
||||
</div>
|
||||
</main>
|
||||
</main>
|
||||
{/if}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { derived, writable } from 'svelte/store';
|
||||
|
||||
export const visible = writable(false)
|
||||
|
||||
export const search = writable('');
|
||||
let timeout: NodeJS.Timeout;
|
||||
export const debouncedSearch = derived(search, (value, set: (value: string) => void) => {
|
||||
|
||||
Reference in new issue
Block a user