mirror of
https://github.com/jokob-sk/NetAlertX.git
synced 2025-12-07 09:36:05 -08:00
Language plugin translation #361
This commit is contained in:
@@ -34,7 +34,7 @@ def update_api(db, isNotification = False, updateOnlyDataSources = []):
|
||||
["plugins_events", sql_plugins_events],
|
||||
["plugins_history", sql_plugins_history],
|
||||
["plugins_objects", sql_plugins_objects],
|
||||
["language_strings", sql_language_strings],
|
||||
["plugins_language_strings", sql_language_strings],
|
||||
["custom_endpoint", conf.API_CUSTOM_SQL],
|
||||
]
|
||||
|
||||
|
||||
@@ -252,8 +252,16 @@ def importConfigs (db):
|
||||
conf.mySchedules.append(schedule_class(pref, newSchedule, newSchedule.next(), False))
|
||||
|
||||
# Collect settings related language strings
|
||||
# Creates an entry with key ARPSCAN_CMD_name
|
||||
collect_lang_strings(db, set, pref + "_" + set["function"])
|
||||
|
||||
# Collect column related language strings
|
||||
for clmn in plugin.get('database_column_definitions', []):
|
||||
# Creates an entry with key ARPSCAN_Object_PrimaryID_name
|
||||
collect_lang_strings(db, clmn, pref + "_" + clmn.get("column", ""))
|
||||
|
||||
|
||||
|
||||
conf.plugins_once_run = False
|
||||
# -----------------
|
||||
# Plugins END
|
||||
|
||||
@@ -301,6 +301,7 @@ def execute_plugin(db, plugin, pluginsState = plugins_state() ):
|
||||
sql.executemany ("""INSERT INTO Plugins_History ("Plugin", "Object_PrimaryID", "Object_SecondaryID", "DateTimeCreated", "DateTimeChanged", "Watched_Value1", "Watched_Value2", "Watched_Value3", "Watched_Value4", "Status" ,"Extra", "UserData", "ForeignKey") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)""", sqlParams)
|
||||
db.commitDB()
|
||||
|
||||
# create objects
|
||||
pluginsState = process_plugin_events(db, plugin, pluginsState)
|
||||
|
||||
# update API endpoints
|
||||
@@ -532,7 +533,7 @@ def process_plugin_events(db, plugin, pluginsState):
|
||||
|
||||
sql.execute ("INSERT INTO Plugins_Events (Plugin, Object_PrimaryID, Object_SecondaryID, DateTimeCreated, DateTimeChanged, Watched_Value1, Watched_Value2, Watched_Value3, Watched_Value4, Status, Extra, UserData, ForeignKey) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?)", (plugObj.pluginPref, plugObj.primaryId , plugObj.secondaryId , createdTime, plugObj.changed , plugObj.watched1 , plugObj.watched2 , plugObj.watched3 , plugObj.watched4 , plugObj.status , plugObj.extra, plugObj.userData, plugObj.foreignKey ))
|
||||
|
||||
# Perform databse table mapping if enabled for the plugin
|
||||
# Perform database table mapping if enabled for the plugin
|
||||
if len(pluginEvents) > 0 and "mapped_to_table" in plugin:
|
||||
|
||||
# Initialize an empty list to store SQL parameters.
|
||||
|
||||
Reference in New Issue
Block a user