Notification rework - Apprise v1 - working

This commit is contained in:
Jokob-sk
2023-10-08 14:52:22 +11:00
parent 79c47015f4
commit be4e0acdfc
11 changed files with 152 additions and 182 deletions

View File

@@ -619,7 +619,8 @@ The UI will adjust how columns are displayed in the UI based on the resolvers de
| Supported Types | Description |
| -------------- | ----------- |
| `label` | Displays a column only. |
| `text` | Makes a column editable, and a save icon is displayed next to it. See below for information on `threshold`, `replace`. |
| `textarea_readonly` | Generates a read only text area and cleans up the text to display it somewhat formatted with new lines preserved. |
| See below for information on `threshold`, `replace`. | |
| | |
| `options` Property | Used in conjunction with types like `threshold`, `replace`, `regex`. |
| `threshold` | The `options` array contains objects ordered from the lowest `maximum` to the highest. The corresponding `hexColor` is used for the value background color if it's less than the specified `maximum` but more than the previous one in the `options` array. |

View File

@@ -137,9 +137,9 @@
},
{
"column": "Watched_Value2",
"css_classes": "col-sm-2",
"css_classes": "col-sm-8",
"show": true,
"type": "label",
"type": "textarea_readonly",
"default_value":"",
"options": [],
"localized": ["name"],

View File

@@ -89,6 +89,11 @@ function processColumnValue(dbColumnDef, value, index, type) {
case 'label':
value = `<span>${value}<span>`;
break;
case 'textarea_readonly':
value = `<textarea cols="70" rows="3" wrap="off" readonly style="white-space: pre-wrap;">
${value.replace(/^b'(.*)'$/gm, '$1').replace(/\\n/g, '\n').replace(/\\r/g, '\r')}
</textarea>`;
break;
case 'textbox_save':
value = value == 'null' ? '' : value; // hide 'null' values