mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2026-04-13 13:41:37 -07:00
Maintenance icons #341
This commit is contained in:
@@ -210,16 +210,28 @@ $db->close();
|
|||||||
<div class="nav-tabs-custom">
|
<div class="nav-tabs-custom">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="active">
|
<li class="active">
|
||||||
<a id="tab_Settings_id" href="#tab_Settings" data-toggle="tab"><?= lang('Maintenance_Tools_Tab_UISettings');?></a>
|
<a id="tab_Settings_id" href="#tab_Settings" data-toggle="tab">
|
||||||
|
<i class="fa fa-cogs"></i>
|
||||||
|
<?= lang('Maintenance_Tools_Tab_UISettings');?>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tab_DBTools_id" href="#tab_DBTools" data-toggle="tab"><?= lang('Maintenance_Tools_Tab_Tools');?></a>
|
<a id="tab_DBTools_id" href="#tab_DBTools" data-toggle="tab">
|
||||||
|
<i class="fa fa-toolbox"></i>
|
||||||
|
<?= lang('Maintenance_Tools_Tab_Tools');?>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tab_BackupRestore_id" href="#tab_BackupRestore" data-toggle="tab"><?= lang('Maintenance_Tools_Tab_BackupRestore');?></a>
|
<a id="tab_BackupRestore_id" href="#tab_BackupRestore" data-toggle="tab">
|
||||||
|
<i class="fa fa-file-shield"></i>
|
||||||
|
<?= lang('Maintenance_Tools_Tab_BackupRestore');?>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
<li>
|
<li>
|
||||||
<a id="tab_Logging_id" href="#tab_Logging" data-toggle="tab"><?= lang('Maintenance_Tools_Tab_Logging');?></a>
|
<a id="tab_Logging_id" href="#tab_Logging" data-toggle="tab">
|
||||||
|
<i class="fa fa-triangle-exclamation"></i>
|
||||||
|
<?= lang('Maintenance_Tools_Tab_Logging');?>
|
||||||
|
</a>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
|
|||||||
@@ -27,18 +27,31 @@ while ($row = $result->fetchArray(SQLITE3_ASSOC)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Load data from JSON files
|
|
||||||
function getLanguageDataFromJson()
|
function getLanguageDataFromJson()
|
||||||
{
|
{
|
||||||
global $allLanguages;
|
global $allLanguages;
|
||||||
|
|
||||||
|
// Default language
|
||||||
|
$defaultLanguage = 'en_us';
|
||||||
|
|
||||||
// Array to hold the language data from the JSON files
|
// Array to hold the language data from the JSON files
|
||||||
$languageData = [];
|
$languageData = [];
|
||||||
|
|
||||||
// Load and parse the JSON data from .json files
|
|
||||||
foreach ($allLanguages as $language) {
|
foreach ($allLanguages as $language) {
|
||||||
$data = json_decode(file_get_contents(dirname(__FILE__).'/'.$language.'.json'), true);
|
// Load and parse the JSON data from .json files
|
||||||
$languageData[$language] = $data[$language];
|
$jsonFilePath = dirname(__FILE__) . '/' . $language . '.json';
|
||||||
|
|
||||||
|
if (file_exists($jsonFilePath)) {
|
||||||
|
$data = json_decode(file_get_contents($jsonFilePath), true);
|
||||||
|
|
||||||
|
// Use the default language if the key is not found
|
||||||
|
$languageData[$language] = $data[$language] ?? $data[$defaultLanguage] ?? [];
|
||||||
|
} else {
|
||||||
|
// Handle the case where the JSON file doesn't exist
|
||||||
|
// For example, you might want to log an error message
|
||||||
|
echo 'File not found: '.$jsonFilePath;
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $languageData;
|
return $languageData;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
}],
|
}],
|
||||||
"description": [{
|
"description": [{
|
||||||
"language_code":"en_us",
|
"language_code":"en_us",
|
||||||
"string" : "Set to <code>once</code> and specify password to reset your pasword in <code>SETPWD_password</code>."
|
"string" : "Set to <code>before_config_save</code> and specify password to reset your pasword in <code>SETPWD_password</code>."
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -64,15 +64,13 @@ def importConfigs (db):
|
|||||||
|
|
||||||
mylog('debug', ['[Import Config] checking config file '])
|
mylog('debug', ['[Import Config] checking config file '])
|
||||||
mylog('debug', ['[Import Config] lastImportedConfFile :', conf.lastImportedConfFile])
|
mylog('debug', ['[Import Config] lastImportedConfFile :', conf.lastImportedConfFile])
|
||||||
mylog('debug', ['[Import Config] file modified time :', fileModifiedTime])
|
mylog('debug', ['[Import Config] fileModifiedTime :', fileModifiedTime])
|
||||||
|
|
||||||
|
|
||||||
if (fileModifiedTime == conf.lastImportedConfFile) :
|
if (fileModifiedTime == conf.lastImportedConfFile) :
|
||||||
mylog('debug', ['[Import Config] skipping config file import'])
|
mylog('debug', ['[Import Config] skipping config file import'])
|
||||||
return
|
return
|
||||||
|
|
||||||
conf.lastImportedConfFile = fileModifiedTime
|
|
||||||
|
|
||||||
mylog('debug', ['[Import Config] importing config file'])
|
mylog('debug', ['[Import Config] importing config file'])
|
||||||
conf.mySettings = [] # reset settings
|
conf.mySettings = [] # reset settings
|
||||||
conf.mySettingsSQLsafe = [] # same as above but safe to be passed into a SQL query
|
conf.mySettingsSQLsafe = [] # same as above but safe to be passed into a SQL query
|
||||||
@@ -285,7 +283,7 @@ def importConfigs (db):
|
|||||||
run_plugin_scripts(db, 'before_config_save')
|
run_plugin_scripts(db, 'before_config_save')
|
||||||
|
|
||||||
# Used to determine the next import
|
# Used to determine the next import
|
||||||
conf.lastTimeImported = time.time()
|
conf.lastImportedConfFile = os.path.getmtime(config_file)
|
||||||
|
|
||||||
#TO DO this creates a circular reference between API and HELPER !
|
#TO DO this creates a circular reference between API and HELPER !
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user