Plugins 0.2 - UI fixes

This commit is contained in:
Jokob-sk
2023-02-20 20:45:18 +11:00
parent 647013f3ff
commit 43d5c51e7c
4 changed files with 59 additions and 48 deletions

View File

@@ -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>
@@ -170,40 +170,61 @@ 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 id="${obj.unique_prefix}" class="tab-pane ${activetab}">
<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>
<tr>
${headersHtml}
</tr>
${evRows}
</tbody>
</table>
</div>
</div>
${localize(obj, 'description')}
<h5>
<i class="fa fa-clock"></i> <?= lang('Plugins_Unprocessed_Events');?>
</h5>
<hr>
<table class="table table-striped">
<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>
${evRows}
</tbody>
</table>
<h5>
<i class="fa fa-clock"></i> <?= lang('Plugins_Objects');?>
</h5>
<hr>
<table class="table table-striped">
<tbody>
<tr>
${headersHtml}
</tr>
${obRows}
</tbody>
</table>
</div>
`);

View File

@@ -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: