Skip to content

Commit

Permalink
added option to remove only script.js #21
Browse files Browse the repository at this point in the history
  • Loading branch information
ciddi89 committed Mar 3, 2023
1 parent 32bf0b7 commit b3c38cf
Show file tree
Hide file tree
Showing 15 changed files with 993 additions and 891 deletions.
73 changes: 37 additions & 36 deletions admin/i18n/de/translations.json

Large diffs are not rendered by default.

263 changes: 132 additions & 131 deletions admin/i18n/en/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/es/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/fr/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/it/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/nl/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/pl/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/pt/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/ru/translations.json

Large diffs are not rendered by default.

75 changes: 38 additions & 37 deletions admin/i18n/uk/translations.json

Large diffs are not rendered by default.

73 changes: 37 additions & 36 deletions admin/i18n/zh-cn/translations.json

Large diffs are not rendered by default.

16 changes: 14 additions & 2 deletions admin/jsonConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,22 @@
"marginTop": 0
}
},
"removeScriptJs": {
"removeOnlyScriptJs": {
"newLine": true,
"type": "checkbox",
"label": "Remove script.js.Script_Name"
"label": "Remove only script.js",
"disabled": "data.removeScriptJs === true",
"sm": 12,
"md": 4,
"lg": 4
},
"removeScriptJs": {
"type": "checkbox",
"label": "Remove script.js.Script_Name",
"disabled": "data.removeOnlyScriptJs === true",
"sm": 12,
"md": 4,
"lg": 4
},
"_headerReplaceDate": {
"type": "header",
Expand Down
214 changes: 138 additions & 76 deletions admin/words.js

Large diffs are not rendered by default.

651 changes: 332 additions & 319 deletions io-package.json

Large diffs are not rendered by default.

8 changes: 6 additions & 2 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ class LogParser extends utils.Adapter {
* Typically called every midnight.
*/
async updateTodayYesterday() {
//FIXME: Fix call at midnight
try {
for (const lpFilterName of g_activeFilters) {
// First: Update global variable g_allLogs
Expand Down Expand Up @@ -501,13 +502,16 @@ class LogParser extends utils.Adapter {
if (msg != '' && this.config.removePid) msg = await this.removePid(msg);

// Remove 'script.js.Script_Name: '
if (msg != '' && this.config.removeScriptJs) msg = msg.replace(/script\.js\.[^:]*: /, '');
if (msg != '' && msg.includes('script.js', 0) && this.config.removeScriptJs) msg = msg.replace(/script\.js\.[^:]*: /, '');

// Remove 'script.js.Script_Name: '
if (msg != '' && msg.includes('script.js', 0) && this.config.removeOnlyScriptJs) msg = msg.slice(msg.lastIndexOf('.') + 1);

// Verify source
if (msg != '' && (await this.isLikeEmpty(logObject.from))) msg = '';

// Verify timestamp
if (msg != '' && (await this.isLikeEmpty(logObject.ts)) && typeof logObject.ts != 'number') msg = '';
//if (msg != '' && (await this.isLikeEmpty(logObject.ts)) && typeof logObject.ts != 'number') msg = '';

logObject.message = msg;

Expand Down

0 comments on commit b3c38cf

Please sign in to comment.