Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions emhttp/plugins/dynamix/NotificationAgents.page
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ foreach ($xml_files as $xml_file) {
$vHelp = preg_replace('#\[([^\]]*)\]#', '<$1>', $v->attributes()->Help);
$currentValue = isset($values[$vName]) ? $values[$vName] : $vDefault;
$isTitleOrMessage = preg_match('/title|message/', $vDesc);
$isVerify = preg_match('/verify/i', $vDesc);
?>
<dl>
<dt><?= $vDesc ?>:</dt>
Expand All @@ -202,6 +203,11 @@ foreach ($xml_files as $xml_file) {
<?= mk_option_check($value, '$'.strtoupper($field), _($field)) ?>
<?php endforeach; ?>
</select>
<?php elseif ($isVerify): ?>
<select name="<?= $vName ?>" class="variable">
<?= mk_option($currentValue, 'yes', _('Yes')) ?>
<?= mk_option($currentValue, 'no', _('No')) ?>
</select>
<?php else: ?>
<input type="text" name="<?= $vName ?>" class="variable" required value="<?= $currentValue ?>">
<?php endif; ?>
Expand Down
4 changes: 3 additions & 1 deletion emhttp/plugins/dynamix/agents/Gotify.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Name>Gotify</Name>
<Variables>
<Variable Help="The full server base URL including protocol and port. eg: https://example.com:8888/" Desc="Full Server Base URL" Default="">SERVER_URL</Variable>
<Variable Help="Enable TLS certificate verification for the server URL. Disable if your server does not use TLS or uses a self-signed certificate." Desc="Verify TLS certificate" Default="yes">VERIFY_TLS</Variable>
<Variable Help="The App Token to use." Desc="App Token" Default="">APP_TOKEN</Variable>
<Variable Help="Specify the fields which are included in the title of the notification." Desc="Notification Title" Default="$SUBJECT">TITLE</Variable>
<Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable>
Expand All @@ -29,7 +30,8 @@
# Remove any trailing slash
SERVER_URL=${SERVER_URL%/}

curl -s -k -X POST \
[[ "$VERIFY_TLS" == "no" ]] && K_FLAG="-k" || K_FLAG=""
curl -s $K_FLAG -X POST \
-F "title=$TITLE" \
-F "message=$MESSAGE" \
-F "priority=$PRIORITY" \
Expand Down
4 changes: 3 additions & 1 deletion emhttp/plugins/dynamix/agents/PushBits.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<Name>PushBits</Name>
<Variables>
<Variable Help="The full server base URL including protocol and port. eg: https://example.com:8080/" Desc="Full Server Base URL" Default="FULL PUSHBITS URL">SERVER_URL</Variable>
<Variable Help="Enable TLS certificate verification for the server URL. Disable if your server does not use TLS or uses a self-signed certificate." Desc="Verify TLS certificate" Default="yes">VERIFY_TLS</Variable>
<Variable Help="The App Token to use." Desc="App Token" Default="YOUR APP TOKEN">APP_TOKEN</Variable>
<Variable Help="Specify the fields which are included in the title of the notification." Desc="Notification Title" Default="$SUBJECT">TITLE</Variable>
<Variable Help="Specify the fields which are included in the message body of the notification." Desc="Notification Message" Default="$DESCRIPTION">MESSAGE</Variable>
Expand All @@ -29,7 +30,8 @@
# Remove any trailing slash
SERVER_URL=${SERVER_URL%/}

curl -s -k -X POST \
[[ "$VERIFY_TLS" == "no" ]] && K_FLAG="-k" || K_FLAG=""
curl -s $K_FLAG -X POST \
-F "title=$TITLE" \
-F "message=$MESSAGE" \
-F "priority=$PRIORITY" \
Expand Down