Skip to content

Commit 3b25b6d

Browse files
GHMattiGHMatti
authored andcommitted
chore: update to 3.3.1
1 parent 1d0a9f6 commit 3b25b6d

File tree

8 files changed

+58
-26
lines changed

8 files changed

+58
-26
lines changed

fxmanifest.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,16 @@ game 'common'
44
name 'mysql-async'
55
description 'MySQL Middleware for lua.'
66
author 'Joel Wurtz & Matthias Mandelartz'
7-
version '3.3.0'
7+
version '3.3.1'
88
url 'https://github.com/brouznouf/fivem-mysql-async'
99

1010
server_script 'mysql-async.js'
1111
client_script 'mysql-async-client.js'
1212

1313
files {
1414
'ui/index.html',
15-
'ui/app.js',
16-
'ui/app.css',
15+
'ui/js/app.js',
16+
'ui/css/app.css',
1717
'ui/fonts/fira-sans-v9-latin-700.woff',
1818
'ui/fonts/fira-sans-v9-latin-700.woff2',
1919
'ui/fonts/fira-sans-v9-latin-italic.woff',

mysql-async.js

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15727,6 +15727,7 @@ const defaultLoggerConfig = {
1572715727
color: Color.Default,
1572815728
tag: 'ghmattimysql',
1572915729
level: '',
15730+
logLevel: 15,
1573015731
output: OutputDestination.None
1573115732
};
1573215733

@@ -15856,13 +15857,33 @@ function writeConsole(msg, options) {
1585615857
}
1585715858

1585815859
/* harmony default export */ var logger_writeConsole = (writeConsole);
15860+
// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/logLevel.ts
15861+
var LogLevel;
15862+
15863+
(function (LogLevel) {
15864+
LogLevel[LogLevel["Info"] = 0] = "Info";
15865+
LogLevel[LogLevel["Success"] = 1] = "Success";
15866+
LogLevel[LogLevel["Warning"] = 2] = "Warning";
15867+
LogLevel[LogLevel["Error"] = 3] = "Error";
15868+
})(LogLevel || (LogLevel = {}));
15869+
15870+
/* harmony default export */ var logger_logLevel = (LogLevel);
15871+
// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/getLoggingFileName.ts
15872+
function getLoggingFileName() {
15873+
const loggingFile = GetConvar('mysql_log_file_format', '%s-%d.log');
15874+
return loggingFile.replace('%s', GetCurrentResourceName()).replace('%d', Date.now().toString());
15875+
}
15876+
15877+
/* harmony default export */ var logger_getLoggingFileName = (getLoggingFileName);
1585915878
// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/index.ts
1586015879

1586115880

1586215881

1586315882

1586415883

1586515884

15885+
15886+
1586615887
class logger_Logger {
1586715888
constructor(outputString, defaultOverRides) {
1586815889
const output = OutputDestination[outputString] || OutputDestination.None;
@@ -15873,7 +15894,7 @@ class logger_Logger {
1587315894
this.loggingFile = null;
1587415895

1587515896
if (this.defaultConfig.output === OutputDestination.File || this.defaultConfig.output === OutputDestination.FileAndConsole) {
15876-
this.loggingFile = `./${GetCurrentResourceName()}-${Date.now()}.log`;
15897+
this.loggingFile = logger_getLoggingFileName();
1587715898
Object(external_fs_["closeSync"])(Object(external_fs_["openSync"])(this.loggingFile, 'w'));
1587815899
}
1587915900
}
@@ -15903,13 +15924,21 @@ class logger_Logger {
1590315924
logger_writeConsole(msg, opts);
1590415925
this.writeFile(msg, opts);
1590515926
break;
15927+
15928+
default:
1590615929
}
1590715930
}
1590815931

15932+
getOutputDestination(logLevel) {
15933+
/* eslint no-bitwise: ["error", { "allow": ["&", "<<"] }] */
15934+
const logToConsole = (this.defaultConfig.logLevel & 1 << logLevel) !== 0;
15935+
return logToConsole ? OutputDestination.FileAndConsole : OutputDestination.File;
15936+
}
15937+
1590915938
error(msg, options = {}) {
1591015939
this.log(msg, {
1591115940
color: Color.Error,
15912-
output: OutputDestination.FileAndConsole,
15941+
output: this.getOutputDestination(logger_logLevel.Error),
1591315942
level: 'ERROR',
1591415943
...options
1591515944
});
@@ -15918,7 +15947,7 @@ class logger_Logger {
1591815947
info(msg, options = {}) {
1591915948
this.log(msg, {
1592015949
color: Color.Info,
15921-
output: OutputDestination.FileAndConsole,
15950+
output: this.getOutputDestination(logger_logLevel.Info),
1592215951
level: 'INFO',
1592315952
...options
1592415953
});
@@ -15927,7 +15956,7 @@ class logger_Logger {
1592715956
success(msg, options = {}) {
1592815957
this.log(msg, {
1592915958
color: Color.Success,
15930-
output: OutputDestination.FileAndConsole,
15959+
output: this.getOutputDestination(logger_logLevel.Success),
1593115960
level: 'SUCCESS',
1593215961
...options
1593315962
});
@@ -15936,7 +15965,7 @@ class logger_Logger {
1593615965
warning(msg, options = {}) {
1593715966
this.log(msg, {
1593815967
color: Color.Warning,
15939-
output: OutputDestination.FileAndConsole,
15968+
output: this.getOutputDestination(logger_logLevel.Warning),
1594015969
level: 'WARNING',
1594115970
...options
1594215971
});
@@ -16071,7 +16100,9 @@ class profiler_Profiler {
1607116100

1607216101
class server_Server {
1607316102
constructor(config, loggerOverrides = {}) {
16074-
this.logger = new server_logger(GetConvar('mysql_debug', 'None'), loggerOverrides);
16103+
this.logger = new server_logger(GetConvar('mysql_debug', 'None'), { ...loggerOverrides,
16104+
logLevel: GetConvarInt('mysql_log_level', 15)
16105+
});
1607516106
this.profiler = new server_profiler({
1607616107
slowQueryWarningTime: GetConvarInt('mysql_slow_query_warning', 150)
1607716108
}, this.logger);

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mysql-async",
3-
"version": "3.3.0",
3+
"version": "3.3.1",
44
"description": "fivem-mysql-async",
55
"private": true,
66
"scripts": {

ui/app.css

Lines changed: 0 additions & 1 deletion
This file was deleted.

ui/app.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

ui/css/app.css

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

ui/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
<!doctype html><html lang="en"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title></title><link href="app.css" rel="stylesheet"></head><body><noscript><strong>We're sorry but mysql-explorer doesn't work properly without JavaScript enabled. Please enable it to continue.</strong></noscript><div id="app"></div><script src="app.js"></script></body></html>
1+
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1"><title>Vue App</title><link href=css/app.css rel=preload as=style><link href=js/app.js rel=preload as=script><link href=css/app.css rel=stylesheet></head><body><div id=app></div><script src=js/app.js></script></body></html>

ui/js/app.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)