Skip to content

Commit

Permalink
chore: update to 3.3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
GHMatti authored and GHMatti committed Jul 5, 2020
1 parent 1d0a9f6 commit 3b25b6d
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 26 deletions.
6 changes: 3 additions & 3 deletions fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ game 'common'
name 'mysql-async'
description 'MySQL Middleware for lua.'
author 'Joel Wurtz & Matthias Mandelartz'
version '3.3.0'
version '3.3.1'
url 'https://github.com/brouznouf/fivem-mysql-async'

server_script 'mysql-async.js'
client_script 'mysql-async-client.js'

files {
'ui/index.html',
'ui/app.js',
'ui/app.css',
'ui/js/app.js',
'ui/css/app.css',
'ui/fonts/fira-sans-v9-latin-700.woff',
'ui/fonts/fira-sans-v9-latin-700.woff2',
'ui/fonts/fira-sans-v9-latin-italic.woff',
Expand Down
43 changes: 37 additions & 6 deletions mysql-async.js
Original file line number Diff line number Diff line change
Expand Up @@ -15727,6 +15727,7 @@ const defaultLoggerConfig = {
color: Color.Default,
tag: 'ghmattimysql',
level: '',
logLevel: 15,
output: OutputDestination.None
};

Expand Down Expand Up @@ -15856,13 +15857,33 @@ function writeConsole(msg, options) {
}

/* harmony default export */ var logger_writeConsole = (writeConsole);
// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/logLevel.ts
var LogLevel;

(function (LogLevel) {
LogLevel[LogLevel["Info"] = 0] = "Info";
LogLevel[LogLevel["Success"] = 1] = "Success";
LogLevel[LogLevel["Warning"] = 2] = "Warning";
LogLevel[LogLevel["Error"] = 3] = "Error";
})(LogLevel || (LogLevel = {}));

/* harmony default export */ var logger_logLevel = (LogLevel);
// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/getLoggingFileName.ts
function getLoggingFileName() {
const loggingFile = GetConvar('mysql_log_file_format', '%s-%d.log');
return loggingFile.replace('%s', GetCurrentResourceName()).replace('%d', Date.now().toString());
}

/* harmony default export */ var logger_getLoggingFileName = (getLoggingFileName);
// CONCATENATED MODULE: ./vendor/ghmattimysql/packages/ghmattimysql/src/server/logger/index.ts








class logger_Logger {
constructor(outputString, defaultOverRides) {
const output = OutputDestination[outputString] || OutputDestination.None;
Expand All @@ -15873,7 +15894,7 @@ class logger_Logger {
this.loggingFile = null;

if (this.defaultConfig.output === OutputDestination.File || this.defaultConfig.output === OutputDestination.FileAndConsole) {
this.loggingFile = `./${GetCurrentResourceName()}-${Date.now()}.log`;
this.loggingFile = logger_getLoggingFileName();
Object(external_fs_["closeSync"])(Object(external_fs_["openSync"])(this.loggingFile, 'w'));
}
}
Expand Down Expand Up @@ -15903,13 +15924,21 @@ class logger_Logger {
logger_writeConsole(msg, opts);
this.writeFile(msg, opts);
break;

default:
}
}

getOutputDestination(logLevel) {
/* eslint no-bitwise: ["error", { "allow": ["&", "<<"] }] */
const logToConsole = (this.defaultConfig.logLevel & 1 << logLevel) !== 0;
return logToConsole ? OutputDestination.FileAndConsole : OutputDestination.File;
}

error(msg, options = {}) {
this.log(msg, {
color: Color.Error,
output: OutputDestination.FileAndConsole,
output: this.getOutputDestination(logger_logLevel.Error),
level: 'ERROR',
...options
});
Expand All @@ -15918,7 +15947,7 @@ class logger_Logger {
info(msg, options = {}) {
this.log(msg, {
color: Color.Info,
output: OutputDestination.FileAndConsole,
output: this.getOutputDestination(logger_logLevel.Info),
level: 'INFO',
...options
});
Expand All @@ -15927,7 +15956,7 @@ class logger_Logger {
success(msg, options = {}) {
this.log(msg, {
color: Color.Success,
output: OutputDestination.FileAndConsole,
output: this.getOutputDestination(logger_logLevel.Success),
level: 'SUCCESS',
...options
});
Expand All @@ -15936,7 +15965,7 @@ class logger_Logger {
warning(msg, options = {}) {
this.log(msg, {
color: Color.Warning,
output: OutputDestination.FileAndConsole,
output: this.getOutputDestination(logger_logLevel.Warning),
level: 'WARNING',
...options
});
Expand Down Expand Up @@ -16071,7 +16100,9 @@ class profiler_Profiler {

class server_Server {
constructor(config, loggerOverrides = {}) {
this.logger = new server_logger(GetConvar('mysql_debug', 'None'), loggerOverrides);
this.logger = new server_logger(GetConvar('mysql_debug', 'None'), { ...loggerOverrides,
logLevel: GetConvarInt('mysql_log_level', 15)
});
this.profiler = new server_profiler({
slowQueryWarningTime: GetConvarInt('mysql_slow_query_warning', 150)
}, this.logger);
Expand Down
2 changes: 1 addition & 1 deletion src/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mysql-async",
"version": "3.3.0",
"version": "3.3.1",
"description": "fivem-mysql-async",
"private": true,
"scripts": {
Expand Down
1 change: 0 additions & 1 deletion ui/app.css

This file was deleted.

14 changes: 0 additions & 14 deletions ui/app.js

This file was deleted.

2 changes: 2 additions & 0 deletions ui/css/app.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion ui/index.html
Original file line number Diff line number Diff line change
@@ -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>
<!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>
14 changes: 14 additions & 0 deletions ui/js/app.js

Large diffs are not rendered by default.

0 comments on commit 3b25b6d

Please sign in to comment.