Add debug mode option to Athena's Shield configuration

Introduced an option to activate debug mode in Athena's Shield. Updated relevant JavaScript files and configuration to handle the debug mode setting. Added a new method for retrieving the debug status within the parserAthShield.js class.
This commit is contained in:
Sandro642 2024-10-26 16:26:54 +02:00
parent 09646484f1
commit 3cdad516c9
3 changed files with 33 additions and 22 deletions

View File

@ -37,33 +37,38 @@ function startCLI() {
if (answer.toLowerCase() === 'yes') { if (answer.toLowerCase() === 'yes') {
config.athenaShieldActivated = true config.athenaShieldActivated = true
rl.question('Would you like to hide or block the menu? (hide/block): ', (menuAnswer) => { rl.question('Would you like to activate debug mode? (yes/no): ', (debugAnswer) => {
if (menuAnswer.trim().startsWith('//')) { config.debug = debugAnswer.toLowerCase() === 'yes' // Set debug to true or false
console.log('This is a comment; the line is ignored.')
rl.close()
return
}
if (menuAnswer.toLowerCase() === 'hide') { rl.question('Would you like to hide or block the menu? (hide/block): ', (menuAnswer) => {
config.menuVisibility = 'hidden' // Change to 'hidden' if (menuAnswer.trim().startsWith('//')) {
console.log('Athena\'s Shield activated. Menu hidden.') console.log('This is a comment; the line is ignored.')
} else if (menuAnswer.toLowerCase() === 'block') { rl.close()
config.menuVisibility = 'blocked' // Change to 'blocked' return
console.log('Athena\'s Shield activated. Menu blocked.') }
} else {
console.log('Invalid option for the menu.')
rl.close()
return
}
// Save the modified configuration if (menuAnswer.toLowerCase() === 'hide') {
saveConfig(config) config.menuVisibility = 'hidden' // Set to 'hidden'
rl.close() console.log('Athena\'s Shield activated. Menu hidden.')
} else if (menuAnswer.toLowerCase() === 'block') {
config.menuVisibility = 'blocked' // Set to 'blocked'
console.log('Athena\'s Shield activated. Menu blocked.')
} else {
console.log('Invalid option for the menu.')
rl.close()
return
}
// Save the modified configuration
saveConfig(config)
rl.close()
})
}) })
} else if (answer.toLowerCase() === 'no') { } else if (answer.toLowerCase() === 'no') {
console.log('Athena\'s Shield not activated. Closing the CLI.') console.log('Athena\'s Shield not activated. Closing the CLI.')
config.athenaShieldActivated = false config.athenaShieldActivated = false
config.menuVisibility = 'visible' // Reset to default value config.menuVisibility = 'visible' // Reset to default
config.debug = 'false'
// Save the modified configuration // Save the modified configuration
saveConfig(config) saveConfig(config)

View File

@ -25,6 +25,11 @@ class AthenaShield {
get type() { get type() {
return this.config.menuVisibility return this.config.menuVisibility
} }
// Récupérer le mode debug
get debug() {
return this.config.debug
}
} }
// Exporter une instance de la classe // Exporter une instance de la classe

View File

@ -1,4 +1,5 @@
{ {
"athenaShieldActivated": false, "athenaShieldActivated": false,
"menuVisibility": "visible" "menuVisibility": "visible",
"debug": "false"
} }