-
Notifications
You must be signed in to change notification settings - Fork 7
/
debug.lua
115 lines (101 loc) · 3.1 KB
/
debug.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
RegisterNetEvent("icmysql:client:openDebugUI")
AddEventHandler("icmysql:client:openDebugUI", function()
SendNUIMessage({
action = "open"
})
SetNuiFocus(true, true)
end)
RegisterNUICallback("closeDebugUI", function()
SetNuiFocus(false, false)
end)
RegisterNUICallback("loadData", function(data)
data = data.load
if data == "cache" then
TriggerServerEvent("icmysql:server:getquerycache")
elseif data == "resources" then
TriggerServerEvent("icmysql:server:getresources")
elseif data == "logs" then
TriggerServerEvent("icmysql:server:getlogs")
elseif data == "backup" then
TriggerServerEvent("icmysql:server:getbackup")
elseif data == "dbs" then
TriggerServerEvent("icmysql:server:getdbs")
elseif data == "queries" then
TriggerServerEvent("icmysql:server:getQueries")
end
end)
RegisterNetEvent("icmysql:client:getdbs")
AddEventHandler("icmysql:client:getdbs", function(data)
SendNUIMessage({
action = "loadData",
info = "dbs",
data = data
})
end)
RegisterNetEvent("icmysql:client:getQueries")
AddEventHandler("icmysql:client:getQueries", function(data)
SendNUIMessage({
action = "loadData",
info = "queries",
data = data
})
end)
RegisterNetEvent("icmysql:client:getquerycache")
AddEventHandler("icmysql:client:getquerycache", function(data)
SendNUIMessage({
action = "loadData",
info = "cache",
data = data
})
end)
RegisterNetEvent("icmysql:client:getResources")
AddEventHandler("icmysql:client:getResources", function(data)
SendNUIMessage({
action = "loadData",
info = "resources",
data = data
})
end)
RegisterNetEvent("icmysql:client:getlogs")
AddEventHandler("icmysql:client:getlogs", function(data)
SendNUIMessage({
action = "loadData",
info = "logs",
data = data
})
end)
RegisterNetEvent("icmysql:client:getbackup")
AddEventHandler("icmysql:client:getbackup", function(data)
SendNUIMessage({
action = "loadData",
info = "backup",
data = data
})
end)
RegisterNetEvent("icmysql:client:setInterceptor")
AddEventHandler("icmysql:client:setInterceptor", function(data)
SendNUIMessage({
action = "setInterceptor",
data = data
})
end)
RegisterNetEvent("icmysql:client:getQueryData")
AddEventHandler("icmysql:client:getQueryData", function(queryID, data)
SendNUIMessage({
action = "getQueryData",
queryID = queryID,
data = data
})
end)
RegisterNUICallback("suscribeInterceptor", function()
TriggerServerEvent("icmysql:server:subscribeInterceptor")
end)
RegisterNUICallback("setInterceptor", function(data)
TriggerServerEvent("icmysql:server:setInterceptor", data)
end)
RegisterNUICallback("forwardQuery", function(data)
TriggerServerEvent("icmysql:server:forwardQuery", data)
end)
RegisterNUICallback("dropQuery", function(data)
TriggerServerEvent("icmysql:server:dropQuery", data)
end)