From 43d5c51e7cbd0cd592a92652aa7c755180bd9d87 Mon Sep 17 00:00:00 2001 From: Jokob-sk Date: Mon, 20 Feb 2023 20:45:18 +1100 Subject: [PATCH] Plugins 0.2 - UI fixes --- back/pialert.py | 14 +------ docker-compose.yml | 2 +- front/plugins.php | 83 ++++++++++++++++++++++++++--------------- front/plugins/README.md | 8 ++-- 4 files changed, 59 insertions(+), 48 deletions(-) diff --git a/back/pialert.py b/back/pialert.py index b2f74a9d..b3d86d39 100755 --- a/back/pialert.py +++ b/back/pialert.py @@ -2440,8 +2440,8 @@ def send_notifications (): changedPorts_json_struc = None - # DEBUG - print number of rows updated - mylog('info', [' Notifications: ', sql.rowcount]) + # DEBUG - print number of rows updated + mylog('info', ['[', timeNow(), '] Notifications: ', sql.rowcount]) # Commit changes commitDB() @@ -3888,8 +3888,6 @@ def process_plugin_events(plugin): pluginEvents[index].status = "watched-not-changed" index += 1 - - # Merge existing plugin objects with newly discovered ones and update existin ones with new values for eveObj in pluginEvents: @@ -3935,14 +3933,6 @@ def process_plugin_events(plugin): commitDB() - # TODO HERE test on empty DB as well - # collect notifications here as well? - # delete the events here or later? probably later - on notification fail - # so the events can be reanalyzed and notification re-send - # enable form controls on table columns - - - #------------------------------------------------------------------------------- class plugin_object_class: def __init__(self, plugin, objDbRow): diff --git a/docker-compose.yml b/docker-compose.yml index 5821bf50..e4d25288 100755 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,7 +9,7 @@ services: volumes: - ${APP_DATA_LOCATION}/pialert/config:/home/pi/pialert/config # - ${APP_DATA_LOCATION}/pialert/db/pialert.db:/home/pi/pialert/db/pialert.db - - ${APP_DATA_LOCATION}/pialert/db2:/home/pi/pialert/db + - ${APP_DATA_LOCATION}/pialert/db:/home/pi/pialert/db # (optional) useful for debugging if you have issues setting up the container - ${LOGS_LOCATION}:/home/pi/pialert/front/log # DELETE START anyone trying to use this file: comment out / delete BELOW lines, they are only for development purposes diff --git a/front/plugins.php b/front/plugins.php index aa3b8f82..dd28280c 100755 --- a/front/plugins.php +++ b/front/plugins.php @@ -23,7 +23,7 @@ -
+ @@ -170,40 +170,61 @@ function generateTabs() $('#tabs-content-location').append( ` -
-
- +
+ + + +
+ +
+ + + + ${headersHtml} + + ${obRows} + +
+
+
+ + + + + ${headersHtml} + + ${evRows} + +
+
+ +
+ ${localize(obj, 'description')} -
- -
-
- + + + - - - ${headersHtml} - - ${evRows} - -
- -
- -
-
- - - - - - ${headersHtml} - - ${obRows} - -
`); diff --git a/front/plugins/README.md b/front/plugins/README.md index f0853e04..fffe40fa 100755 --- a/front/plugins/README.md +++ b/front/plugins/README.md @@ -121,10 +121,10 @@ Example: - `API_SQL` - (optional) Generates a `table_` + code_name + `.json` file as per [API docs](https://github.com/jokob-sk/Pi.Alert/blob/main/docs/API.md). - `RUN_TIMEOUT` - (optional) Max execution time of the script. If not specified a default value of 10 seconds is used to prevent hanging. - `WATCH` - (optional) Which database columns are watched for changes for this particular plugin. If not specified no notifications are sent. -- `REPORT_ON` - (optional) Send a notification only on these statuses. Supprted options are: - - `new` means a new unique (unique combination of PrimaryId and SecondaryId) object was discovered. - - `watched-changed` - means that selected `Watched_ValueN` columns changed - - `watched-not-changed` - reports even on events where selected `Watched_ValueN` did not change +- `REPORT_ON` - (optional) Send a notification only on these statuses. Supported options are: + - `new` means a new unique (unique combination of PrimaryId and SecondaryId) object was discovered. + - `watched-changed` - means that selected `Watched_ValueN` columns changed + - `watched-not-changed` - reports even on events where selected `Watched_ValueN` did not change Example: