diff --git a/docs/ICONS.md b/docs/ICONS.md index 61ea561b..bceb56b8 100755 --- a/docs/ICONS.md +++ b/docs/ICONS.md @@ -1,6 +1,6 @@ ## Icons overview -Icons are used to visually distinguish devices in the app in most of the device listing tables and the [network tree](/docs/NETWORK_TREE.md). Currently only free [Font Awesome](https://fontawesome.com/search?o=r&m=free) icons (up-to v 6.4.0) are supported (I have an unblockable [sponsorship goal](https://github.com/sponsors/jokob-sk) to add the material design icon pack). +Icons are used to visually distinguish devices in the app in most of the device listing tables and the [network tree](/docs/NETWORK_TREE.md). Currently only free [Font Awesome](https://fontawesome.com/search?o=r&m=free) icons (up-to v 6.4.0) are supported. ![Raspberry Pi with a brand icon](/docs/img/ICONS/devices-icons.png) @@ -8,6 +8,8 @@ Icons are used to visually distinguish devices in the app in most of the device You can assign icons individually on each device in the Details tab. +![preview](/docs/img/ICONS/device_icons_preview.gif) + ![Raspberry Pi device details](/docs/img/ICONS/device-icon.png) - You can click into the `Icon` field or click the Pencil (2) icon in the above screenshot to enter any text. Only [free Font Awesome](https://fontawesome.com/search?o=r&m=free) icons in the following format will work: diff --git a/docs/img/ICONS/device_icons_preview.gif b/docs/img/ICONS/device_icons_preview.gif new file mode 100755 index 00000000..01929ff3 Binary files /dev/null and b/docs/img/ICONS/device_icons_preview.gif differ diff --git a/front/css/pialert.css b/front/css/pialert.css index 9056cb17..6b0aeb84 100755 --- a/front/css/pialert.css +++ b/front/css/pialert.css @@ -718,6 +718,10 @@ input[readonly] { } /* Devices */ +#txtIconFA { + min-width: 18px; +} + .drp-edit { cursor: pointer; diff --git a/front/deviceDetails.php b/front/deviceDetails.php index fabccd03..cb12db29 100755 --- a/front/deviceDetails.php +++ b/front/deviceDetails.php @@ -146,7 +146,10 @@
- +
+ + +
@@ -156,6 +159,7 @@
+
@@ -172,6 +176,7 @@
+
@@ -227,6 +232,7 @@
+
@@ -1818,9 +1825,3 @@ function toggleNetworkConfiguration(disable) } - - \ No newline at end of file diff --git a/front/plugins/_publisher_apprise/apprise.py b/front/plugins/_publisher_apprise/apprise.py index 2feb151f..27b23fc8 100755 --- a/front/plugins/_publisher_apprise/apprise.py +++ b/front/plugins/_publisher_apprise/apprise.py @@ -36,9 +36,6 @@ def main(): db = DB() # instance of class DB db.open() - # parser = argparse.ArgumentParser(description='APPRISE publisher Plugin') - # values = parser.parse_args() - # Initialize the Plugin obj output file plugin_objects = Plugin_Objects(RESULT_FILE) diff --git a/front/settings.php b/front/settings.php index d2d48b85..a6dd7ee8 100755 --- a/front/settings.php +++ b/front/settings.php @@ -112,7 +112,7 @@ while ($row = $result -> fetchArray (SQLITE3_ASSOC)) { const settingGroups = []; const settingKeyOfLists = []; // core groups are the ones not generated by plugins - const settingCoreGroups = ['General', 'Email', 'Webhooks', 'Apprise', 'NTFY', 'PUSHSAFER', 'MQTT', 'DynDNS', 'API']; + const settingCoreGroups = ['General']; // Loop through the settingsArray and collect unique settingGroups diff --git a/pialert/conf.py b/pialert/conf.py index 266579cd..2078bf7d 100755 --- a/pialert/conf.py +++ b/pialert/conf.py @@ -70,12 +70,6 @@ WEBHOOK_PAYLOAD = 'json' WEBHOOK_REQUEST_METHOD = 'GET' WEBHOOK_SECRET = '' -# Apprise -REPORT_APPRISE = False -APPRISE_HOST = '' -APPRISE_URL = '' -APPRISE_PAYLOAD = 'html' - # NTFY REPORT_NTFY = False NTFY_HOST = 'https://ntfy.sh' diff --git a/pialert/publishers/apprise.py b/pialert/publishers/apprise.py deleted file mode 100755 index 6be9f0e5..00000000 --- a/pialert/publishers/apprise.py +++ /dev/null @@ -1,58 +0,0 @@ - -import json -import subprocess -import conf -from helper import noti_obj -from logger import logResult, mylog - -#------------------------------------------------------------------------------- -def check_config(): - if conf.APPRISE_URL == '' or conf.APPRISE_HOST == '': - mylog('none', ['[Check Config] Error: Apprise service not set up correctly. Check your pialert.conf APPRISE_* variables.']) - return False - else: - return True - -#------------------------------------------------------------------------------- -def send(msg: noti_obj): - html = msg.html - text = msg.text - - payloadData = '' - - # limit = 1024 * 1024 # 1MB limit (1024 bytes * 1024 bytes = 1MB) - limit = conf.APPRISE_SIZE - - # truncate size - if conf.APPRISE_PAYLOAD == 'html': - if len(msg.html) > limit: - payloadData = msg.html[:limit] + "

(text was truncated)

" - else: - payloadData = msg.html - if conf.APPRISE_PAYLOAD == 'text': - if len(msg.text) > limit: - payloadData = msg.text[:limit] + " (text was truncated)" - else: - payloadData = msg.text - - # Define Apprise compatible payload (https://github.com/caronc/apprise-api#stateless-solution) - - _json_payload = { - "urls": conf.APPRISE_URL, - "title": "Pi.Alert Notifications", - "format": conf.APPRISE_PAYLOAD, - "body": payloadData - } - - try: - # try runnning a subprocess - p = subprocess.Popen(["curl","-i","-X", "POST" ,"-H", "Content-Type:application/json" ,"-d", json.dumps(_json_payload), conf.APPRISE_HOST], stdout=subprocess.PIPE, stderr=subprocess.STDOUT) - stdout, stderr = p.communicate() - # write stdout and stderr into .log files for debugging if needed - logResult (stdout, stderr) # TO-DO should be changed to mylog - - # Log the stdout and stderr - mylog('debug', [stdout, stderr]) # TO-DO should be changed to mylog - except subprocess.CalledProcessError as e: - # An error occurred, handle it - mylog('none', [e.output]) \ No newline at end of file diff --git a/pialert/reporting.py b/pialert/reporting.py index 35e63803..8912d579 100755 --- a/pialert/reporting.py +++ b/pialert/reporting.py @@ -28,8 +28,6 @@ from publishers.email import (check_config as email_check_config, send as send_email ) from publishers.ntfy import (check_config as ntfy_check_config, send as send_ntfy ) -from publishers.apprise import (check_config as apprise_check_config, - send as send_apprise) from publishers.webhook import (check_config as webhook_check_config, send as send_webhook) from publishers.pushsafer import (check_config as pushsafer_check_config, @@ -263,9 +261,7 @@ def get_notifications (db): write_file (logPath + '/report_output.txt', final_text) write_file (logPath + '/report_output.html', final_html) - return noti_obj(final_json, final_text, final_html) - - + return noti_obj(final_json, final_text, final_html) # mylog('minimal', ['[Notification] Udating API files']) # send_api() @@ -307,28 +303,6 @@ def get_notifications (db): # mylog('verbose', ['[Notification] No changes to report']) - -# #------------------------------------------------------------------------------- -# def check_config(service): - -# if service == 'email': -# return email_check_config() - -# if service == 'apprise': -# return apprise_check_config() - -# if service == 'webhook': -# return webhook_check_config() - -# if service == 'ntfy': -# return ntfy_check_config () - -# if service == 'pushsafer': -# return pushsafer_check_config() - -# if service == 'mqtt': -# return mqtt_check_config() - #------------------------------------------------------------------------------- # Replacing table headers def format_table (html, thValue, props, newThValue = ''):