Plugins 0.2 - UI fixes
This commit is contained in:
@@ -2441,7 +2441,7 @@ def send_notifications ():
|
||||
changedPorts_json_struc = None
|
||||
|
||||
# DEBUG - print number of rows updated
|
||||
mylog('info', [' Notifications: ', sql.rowcount])
|
||||
mylog('info', ['[', timeNow(), '] Notifications: ', sql.rowcount])
|
||||
|
||||
# Commit changes
|
||||
commitDB()
|
||||
@@ -3889,8 +3889,6 @@ def process_plugin_events(plugin):
|
||||
|
||||
index += 1
|
||||
|
||||
|
||||
|
||||
# Merge existing plugin objects with newly discovered ones and update existin ones with new values
|
||||
for eveObj in pluginEvents:
|
||||
if eveObj.status == 'new':
|
||||
@@ -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):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
<ul id="tabs-location" class="nav nav-tabs">
|
||||
<!-- PLACEHOLDER -->
|
||||
</ul>
|
||||
<div id="tabs-content-location" class="tab-content">
|
||||
<div id="tabs-content-location" class="nav nav-tabs">
|
||||
<!-- PLACEHOLDER -->
|
||||
</div>
|
||||
|
||||
@@ -171,15 +171,41 @@ function generateTabs()
|
||||
$('#tabs-content-location').append(
|
||||
`
|
||||
<div id="${obj.unique_prefix}" class="tab-pane ${activetab}">
|
||||
<div>
|
||||
<a href="https://github.com/jokob-sk/Pi.Alert/tree/main/front/plugins/${obj.code_name}" target="_blank"><?= lang('Gen_Help');?></a>
|
||||
</div>
|
||||
${localize(obj, 'description')}
|
||||
<h5>
|
||||
<i class="fa fa-clock"></i> <?= lang('Plugins_Unprocessed_Events');?>
|
||||
</h5>
|
||||
<hr>
|
||||
<div class="nav-tabs-custom" style="margin-bottom: 0px">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="active">
|
||||
<a href="#objectsTarget" data-toggle="tab" >
|
||||
|
||||
<i class="fa fa-cube"></i> <?= lang('Plugins_Objects');?> (${pluginObjects.length})
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="#eventsTarget" data-toggle="tab" >
|
||||
|
||||
<i class="fa fa-bolt"></i> <?= lang('Plugins_Unprocessed_Events');?> (${pluginUnprocessedEvents.length})
|
||||
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="tab-content">
|
||||
|
||||
<div id="objectsTarget" class="tab-pane active">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
${headersHtml}
|
||||
</tr>
|
||||
${obRows}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="eventsTarget" class="tab-pane">
|
||||
<table class="table table-striped">
|
||||
|
||||
<tbody>
|
||||
@@ -189,21 +215,16 @@ function generateTabs()
|
||||
${evRows}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<h5>
|
||||
<i class="fa fa-clock"></i> <?= lang('Plugins_Objects');?>
|
||||
</h5>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped">
|
||||
${localize(obj, 'description')}
|
||||
|
||||
<span>
|
||||
<a href="https://github.com/jokob-sk/Pi.Alert/tree/main/front/plugins/${obj.code_name}" target="_blank"><?= lang('Gen_Help');?></a>
|
||||
</span>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
${headersHtml}
|
||||
</tr>
|
||||
${obRows}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ 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:
|
||||
- `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
|
||||
|
||||
Reference in New Issue
Block a user