mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
PLG: SNMPDSC typo
This commit is contained in:
@@ -534,7 +534,7 @@
|
|||||||
{
|
{
|
||||||
"elementType": "input",
|
"elementType": "input",
|
||||||
"elementOptions": [{ "type": "password" }],
|
"elementOptions": [{ "type": "password" }],
|
||||||
"transformers": []
|
"transformers": ["base64"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -483,7 +483,7 @@
|
|||||||
"description": [
|
"description": [
|
||||||
{
|
{
|
||||||
"language_code": "en_us",
|
"language_code": "en_us",
|
||||||
"string": "A list of <code>snmpwalk</code> commands to execute against IP addresses of roputers/switches with SNMP turned on. <br/> <br/> Example with the router on the IP <code>192.168.1.1</code> (the <code>-OXsq</code> is a required parameter): <br/> <code>snmpwalk -v 2c -c public -OXsq 192.168.1.1 .1.3.6.1.2.1.3.1.1.2</code> <br/><br/> Only IPv4 supported. Authentication is not supported. More info on the plugin <a href='https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/snmp_discovery' target='_blank'>here</a>."
|
"string": "A list of <code>snmpwalk</code> commands to execute against IP addresses of routers/switches with SNMP turned on. <br/> <br/> Example with the router on the IP <code>192.168.1.1</code> (the <code>-OXsq</code> is a required parameter): <br/> <code>snmpwalk -v 2c -c public -OXsq 192.168.1.1 .1.3.6.1.2.1.3.1.1.2</code> <br/><br/> Only IPv4 supported. Authentication is not supported. More info on the plugin <a href='https://github.com/jokob-sk/NetAlertX/tree/main/front/plugins/snmp_discovery' target='_blank'>here</a>."
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"language_code": "es_es",
|
"language_code": "es_es",
|
||||||
|
|||||||
@@ -768,11 +768,19 @@ def collect_lang_strings(json, pref, stringSqlParams):
|
|||||||
return stringSqlParams
|
return stringSqlParams
|
||||||
|
|
||||||
#-------------------------------------------------------------------------------
|
#-------------------------------------------------------------------------------
|
||||||
def checkNewVersion():
|
# Get the value from the buildtimestamp.txt and initialize it if missing
|
||||||
mylog('debug', [f"[Version check] Checking if new version available"])
|
def getBuildTimeStamp():
|
||||||
|
"""
|
||||||
|
Retrieves the build timestamp from 'front/buildtimestamp.txt' within the
|
||||||
|
application directory.
|
||||||
|
|
||||||
newVersion = False
|
If the file does not exist, it is created and initialized with the value '0'.
|
||||||
|
|
||||||
|
Returns:
|
||||||
|
int: The integer value of the build timestamp read from the file.
|
||||||
|
Returns 0 if the file is empty or just initialized.
|
||||||
|
"""
|
||||||
|
buildTimestamp = 0
|
||||||
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
|
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
|
||||||
|
|
||||||
# Ensure file exists, initialize if missing
|
# Ensure file exists, initialize if missing
|
||||||
@@ -784,6 +792,16 @@ def checkNewVersion():
|
|||||||
with open(build_timestamp_path, 'r') as f:
|
with open(build_timestamp_path, 'r') as f:
|
||||||
buildTimestamp = int(f.read().strip() or 0)
|
buildTimestamp = int(f.read().strip() or 0)
|
||||||
|
|
||||||
|
return buildTimestamp
|
||||||
|
|
||||||
|
|
||||||
|
#-------------------------------------------------------------------------------
|
||||||
|
def checkNewVersion():
|
||||||
|
mylog('debug', [f"[Version check] Checking if new version available"])
|
||||||
|
|
||||||
|
newVersion = False
|
||||||
|
buildTimestamp = getBuildTimeStamp()
|
||||||
|
|
||||||
try:
|
try:
|
||||||
response = requests.get(
|
response = requests.get(
|
||||||
"https://api.github.com/repos/jokob-sk/NetAlertX/releases",
|
"https://api.github.com/repos/jokob-sk/NetAlertX/releases",
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import re
|
|||||||
# Register NetAlertX libraries
|
# Register NetAlertX libraries
|
||||||
import conf
|
import conf
|
||||||
from const import fullConfPath, applicationPath, fullConfFolder, default_tz
|
from const import fullConfPath, applicationPath, fullConfFolder, default_tz
|
||||||
from helper import fixPermissions, collect_lang_strings, updateSubnets, isJsonObject, setting_value_to_python_type, timeNowTZ, get_setting_value, generate_random_string
|
from helper import getBuildTimeStamp, fixPermissions, collect_lang_strings, updateSubnets, isJsonObject, setting_value_to_python_type, timeNowTZ, get_setting_value, generate_random_string
|
||||||
from app_state import updateState
|
from app_state import updateState
|
||||||
from logger import mylog
|
from logger import mylog
|
||||||
from api import update_api
|
from api import update_api
|
||||||
@@ -378,29 +378,21 @@ def importConfigs (pm, db, all_plugins):
|
|||||||
# HANDLE APP was upgraded message - clear cache
|
# HANDLE APP was upgraded message - clear cache
|
||||||
|
|
||||||
# Check if app was upgraded
|
# Check if app was upgraded
|
||||||
build_timestamp_path = os.path.join(applicationPath, 'front/buildtimestamp.txt')
|
|
||||||
|
|
||||||
# Ensure the build timestamp file exists and has an initial value
|
buildTimestamp = getBuildTimeStamp()
|
||||||
if not os.path.exists(build_timestamp_path):
|
cur_version = conf.VERSION
|
||||||
with open(build_timestamp_path, 'w') as f:
|
|
||||||
f.write("0")
|
|
||||||
|
|
||||||
with open(build_timestamp_path, 'r') as f:
|
mylog('debug', [f"[Config] buildTimestamp: '{buildTimestamp}'"])
|
||||||
|
mylog('debug', [f"[Config] conf.VERSION : '{cur_version}'"])
|
||||||
|
|
||||||
buildTimestamp = int(f.read().strip())
|
if str(cur_version) != str(buildTimestamp):
|
||||||
cur_version = conf.VERSION
|
|
||||||
|
|
||||||
mylog('debug', [f"[Config] buildTimestamp: '{buildTimestamp}'"])
|
mylog('none', ['[Config] App upgraded 🚀'])
|
||||||
mylog('debug', [f"[Config] conf.VERSION : '{cur_version}'"])
|
|
||||||
|
|
||||||
if str(cur_version) != str(buildTimestamp):
|
# ccd(key, default, config_dir, name, inputtype, options, group, events=None, desc="", setJsonMetadata=None, overrideTemplate=None, forceDefault=False)
|
||||||
|
ccd('VERSION', buildTimestamp , c_d, '_KEEP_', '_KEEP_', '_KEEP_', '_KEEP_', None, "_KEEP_", None, None, True)
|
||||||
|
|
||||||
mylog('none', ['[Config] App upgraded 🚀'])
|
write_notification(f'[Upgrade] : App upgraded 🚀 Please clear the cache: <ol> <li>Click OK below</li> <li>Clear the browser cache (shift + browser refresh button)</li> <li> Clear app cache with the <i class="fa-solid fa-rotate"></i> (reload) button in the header</li><li>Go to Settings and click Save</li> </ol> Check out new features and what has changed in the <a href="https://github.com/jokob-sk/NetAlertX/releases" target="_blank">📓 release notes</a>.', 'interrupt', timeNowTZ())
|
||||||
|
|
||||||
# ccd(key, default, config_dir, name, inputtype, options, group, events=None, desc="", setJsonMetadata=None, overrideTemplate=None, forceDefault=False)
|
|
||||||
ccd('VERSION', buildTimestamp , c_d, '_KEEP_', '_KEEP_', '_KEEP_', '_KEEP_', None, "_KEEP_", None, None, True)
|
|
||||||
|
|
||||||
write_notification(f'[Upgrade] : App upgraded 🚀 Please clear the cache: <ol> <li>Click OK below</li> <li>Clear the browser cache (shift + browser refresh button)</li> <li> Clear app cache with the <i class="fa-solid fa-rotate"></i> (reload) button in the header</li><li>Go to Settings and click Save</li> </ol> Check out new features and what has changed in the <a href="https://github.com/jokob-sk/NetAlertX/releases" target="_blank">📓 release notes</a>.', 'interrupt', timeNowTZ())
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user