Notification Report page rewrite v0.2 + cleanup📩
This commit is contained in:
@@ -641,7 +641,8 @@ The UI will adjust how columns are displayed in the UI based on the resolvers de
|
||||
| `url` | The value is considered to be a URL, so a link is generated. |
|
||||
| `textbox_save` | Generates an editable and saveable text box that saves values in the database. Primarily intended for the `UserData` database column in the `Plugins_Objects` table. |
|
||||
| `url_http_https` | Generates two links with the `https` and `http` prefix as lock icons. |
|
||||
|
||||
| `eval` | Evaluates as JavaScript. Use the variable `value` to use the given column value as input (e.g. ``<b>${value}<b>`` ) |
|
||||
|
||||
|
||||
> [!NOTE]
|
||||
> Supports chaining. You can chain multiple resolvers with `.`. For example `regex.url_http_https`. This will apply the `regex` resolver and then the `url_http_https` resolver.
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
"options": [
|
||||
{
|
||||
"type": "eval",
|
||||
"param": "`<a href='/report?guid=${value}'>${value}</a>`"
|
||||
"param": "`<a href='/report.php?guid=${value}'>${value}</a>`"
|
||||
}
|
||||
],
|
||||
"localized": ["name"],
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
"options": [
|
||||
{
|
||||
"type": "eval",
|
||||
"param": "`<a href='/report?guid=${value}'>${value}</a>`"
|
||||
"param": "`<a href='/report.php?guid=${value}'>${value}</a>`"
|
||||
}
|
||||
],
|
||||
"localized": [
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"options": [
|
||||
{
|
||||
"type": "eval",
|
||||
"param": "`<a href='/report?guid=${value}'>${value}</a>`"
|
||||
"param": "`<a href='/report.php?guid=${value}'>${value}</a>`"
|
||||
}
|
||||
],
|
||||
"localized": ["name"],
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"options": [
|
||||
{
|
||||
"type": "eval",
|
||||
"param": "`<a href='/report?guid=${value}'>${value}</a>`"
|
||||
"param": "`<a href='/report.php?guid=${value}'>${value}</a>`"
|
||||
}
|
||||
],
|
||||
"localized": ["name"],
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
"options": [
|
||||
{
|
||||
"type": "eval",
|
||||
"param": "`<a href='/report?guid=${value}'>${value}</a>`"
|
||||
"param": "`<a href='/report.php?guid=${value}'>${value}</a>`"
|
||||
}
|
||||
],
|
||||
"localized": ["name"],
|
||||
|
||||
@@ -92,6 +92,23 @@ def cleanup_database (dbPath, DAYS_TO_KEEP_EVENTS, PHOLUS_DAYS_DATA, HRS_TO_KEEP
|
||||
|
||||
cursor.execute(delete_query)
|
||||
|
||||
# Trim Notifications entries to less than DBCLNP_NOTIFI_HIST setting
|
||||
mylog('verbose', [f'[DBCLNP] Plugins_History: Trim Notifications entries to less than {str(get_setting_value('DBCLNP_NOTIFI_HIST'))} )'])
|
||||
|
||||
# Build the SQL query to delete entries
|
||||
delete_query = f"""DELETE FROM Notifications
|
||||
WHERE "Index" NOT IN (
|
||||
SELECT "Index"
|
||||
FROM (
|
||||
SELECT "Index",
|
||||
ROW_NUMBER() OVER(PARTITION BY "Notifications" ORDER BY DateTimeCreated DESC) AS row_num
|
||||
FROM Notifications
|
||||
) AS ranked_objects
|
||||
WHERE row_num <= {str(get_setting_value('DBCLNP_NOTIFI_HIST'))}
|
||||
);"""
|
||||
|
||||
cursor.execute(delete_query)
|
||||
|
||||
# Cleanup Pholus_Scan
|
||||
if PHOLUS_DAYS_DATA != 0:
|
||||
mylog('verbose', ['[DBCLNP] Pholus_Scan: Delete all older than ' + str(PHOLUS_DAYS_DATA) + ' days (PHOLUS_DAYS_DATA setting)'])
|
||||
|
||||
Reference in New Issue
Block a user