diff --git a/security/etpro-telemetry/Makefile b/security/etpro-telemetry/Makefile index b7a7a3c43..e135a3f1d 100644 --- a/security/etpro-telemetry/Makefile +++ b/security/etpro-telemetry/Makefile @@ -1,6 +1,6 @@ PLUGIN_NAME= etpro-telemetry -PLUGIN_VERSION= 1.6 -PLUGIN_REVISION= 4 +PLUGIN_VERSION= 1.7 +#PLUGIN_REVISION= 1 PLUGIN_COMMENT= ET Pro Telemetry Edition PLUGIN_MAINTAINER= ad@opnsense.org PLUGIN_WWW= https://docs.opnsense.org/manual/etpro_telemetry.html diff --git a/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js b/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js new file mode 100644 index 000000000..a9b8a49f6 --- /dev/null +++ b/security/etpro-telemetry/src/opnsense/www/js/widgets/ETProTelemetry.js @@ -0,0 +1,72 @@ +/* + * Copyright (C) 2024 Deciso B.V. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * + * 1. Redistributions of source code must retain the above copyright notice, + * this list of conditions and the following disclaimer. + * + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, + * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY + * AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, + * OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN + * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + */ + +import BaseTableWidget from "./BaseTableWidget.js"; + +export default class ETProTelemetry extends BaseTableWidget { + constructor() { + super(); + this.tickTimeout = 3600000; + } + + getMarkup() { + let $container = $('
'); + let $ETProTelemetrytable = this.createTable('ETProTelemetry-table', { + headerPosition: 'left', + }); + $container.append($ETProTelemetrytable); + return $container; + } + + async onWidgetTick() { + await ajaxGet('/api/diagnostics/proofpoint_et/status', {}, (data, status) => { + if (data['sensor_status'] == 'active') { + $('#etpro_sensor_status').text(data['sensor_status']); + $('#etpro_event_received').text(data['event_received']); + $('#etpro_last_rule_download').text(data['last_rule_download']); + $('#etpro_last_heartbeat').text(data['last_heartbeat']); + } else { + $('#etpro_sensor_status').text('-'); + $('#etpro_event_received').text('-'); + $('#etpro_last_rule_download').text('-'); + $('#etpro_last_heartbeat').text('-'); + } + }); + } + + async onMarkupRendered() { + await ajaxGet('/api/core/system/systemInformation', {}, (data, status) => { + let rows = []; + rows.push([['|
-
-
-
- |
- |
|---|---|
| - =gettext("For more information, please visit");?> - docs.opnsense.org - | -