Skip to content

Commit 8d7d733

Browse files
[autofix.ci] apply automated fixes
1 parent 71ce91a commit 8d7d733

File tree

4 files changed

+73
-42
lines changed

4 files changed

+73
-42
lines changed

server/notification-providers/ntfy.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,9 @@ class Ntfy extends NotificationProvider {
3939

4040
// Apply custom templates with priority: monitor > notification > default
4141
const customTitle = monitorJSON?.ntfyCustomTitle?.trim() || notification.ntfyCustomTitle?.trim() || "";
42-
const customMessage = monitorJSON?.ntfyCustomMessage?.trim() || notification.ntfyCustomMessage?.trim() || "";
43-
42+
const customMessage =
43+
monitorJSON?.ntfyCustomMessage?.trim() || notification.ntfyCustomMessage?.trim() || "";
44+
4445
if (customTitle !== "") {
4546
title = await this.renderTemplate(customTitle, msg, monitorJSON, heartbeatJSON);
4647
}
@@ -91,8 +92,9 @@ class Ntfy extends NotificationProvider {
9192

9293
// Apply custom templates with priority: monitor > notification > default
9394
const customTitle = monitorJSON?.ntfyCustomTitle?.trim() || notification.ntfyCustomTitle?.trim() || "";
94-
const customMessage = monitorJSON?.ntfyCustomMessage?.trim() || notification.ntfyCustomMessage?.trim() || "";
95-
95+
const customMessage =
96+
monitorJSON?.ntfyCustomMessage?.trim() || notification.ntfyCustomMessage?.trim() || "";
97+
9698
if (customTitle !== "") {
9799
title = await this.renderTemplate(customTitle, msg, monitorJSON, heartbeatJSON);
98100
}

src/components/ToggleSection.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<div class="my-3 pb-0">
33
<h5 @click="isOpen = !isOpen">
4-
<div class="d-flex justify-content-between align-items-center pe-2" style="max-width: 600px;">
4+
<div class="d-flex justify-content-between align-items-center pe-2" style="max-width: 600px">
55
<span class="pb-2">{{ heading }}</span>
66
<font-awesome-icon icon="chevron-down" class="animated" :class="{ open: isOpen }" />
77
</div>

src/components/notifications/Ntfy.vue

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,7 @@
103103
</div>
104104
</div>
105105

106-
<ToggleSection
107-
:heading="$t('ntfyCustomTemplatesOptional')"
108-
:default-open="hasNtfyTemplates"
109-
>
106+
<ToggleSection :heading="$t('ntfyCustomTemplatesOptional')" :default-open="hasNtfyTemplates">
110107
<div class="form-text mb-3">
111108
<div class="mb-2">
112109
<i18n-t tag="span" keypath="liquidIntroduction">
@@ -115,20 +112,31 @@
115112
</div>
116113
<div class="mb-2">
117114
<strong>{{ $t("templateAvailableVariables") }}:</strong>
118-
<code v-pre>{{ status }}</code>,
119-
<code v-pre>{{ name }}</code>,
120-
<code v-pre>{{ hostnameOrURL }}</code>,
121-
<code v-pre>{{ msg }}</code>,
122-
<code v-pre>{{ monitorJSON }}</code>,
115+
<code v-pre>{{ status }}</code>
116+
,
117+
<code v-pre>{{ name }}</code>
118+
,
119+
<code v-pre>{{ hostnameOrURL }}</code>
120+
,
121+
<code v-pre>{{ msg }}</code>
122+
,
123+
<code v-pre>{{ monitorJSON }}</code>
124+
,
123125
<code v-pre>{{ heartbeatJSON }}</code>
124126
</div>
125-
<div class="mt-3 p-2" style="background-color: rgba(100, 100, 100, 0.1); border-radius: 4px;">
126-
<div class="mb-1"><strong>{{ $t("example") }}:</strong></div>
127+
<div class="mt-3 p-2" style="background-color: rgba(100, 100, 100, 0.1); border-radius: 4px">
128+
<div class="mb-1">
129+
<strong>{{ $t("example") }}:</strong>
130+
</div>
127131
<div class="mb-2">
128-
<code style="font-size: 0.85em; word-break: break-all;" v-pre>{% for tag in monitorJSON.tags %}{{ tag.name }}{% unless tag.value == blank %}: {{ tag.value }}{% endunless %}{% unless forloop.last %}, {% endunless %}{% endfor %}</code>
132+
<code v-pre style="font-size: 0.85em; word-break: break-all">
133+
{% for tag in monitorJSON.tags %}{{ tag.name }}{% unless tag.value == blank %}:
134+
{{ tag.value }}{% endunless %}{% unless forloop.last %}, {% endunless %}{% endfor %}
135+
</code>
129136
</div>
130-
<div style="font-size: 0.9em;">
131-
<strong>{{ $t("Result") }}:</strong> <span style="opacity: 0.9;">nightly, phone: fbal</span>
137+
<div style="font-size: 0.9em">
138+
<strong>{{ $t("Result") }}:</strong>
139+
<span style="opacity: 0.9">nightly, phone: fbal</span>
132140
</div>
133141
</div>
134142
</div>
@@ -148,8 +156,8 @@
148156
<div class="mb-3">
149157
<label for="ntfy-message" class="form-label">{{ $t("ntfyCustomMessage") }}</label>
150158
<textarea
151-
ref="ntfyMessage"
152159
id="ntfy-message"
160+
ref="ntfyMessage"
153161
v-model="$parent.notification.ntfyCustomMessage"
154162
class="form-control auto-expand-textarea"
155163
autocomplete="off"
@@ -211,10 +219,10 @@ export default {
211219
*/
212220
autoResizeTextarea() {
213221
this.$nextTick(() => {
214-
const textareas = this.$el.querySelectorAll('.auto-expand-textarea');
215-
textareas.forEach(textarea => {
216-
textarea.style.height = 'auto';
217-
textarea.style.height = Math.max(100, textarea.scrollHeight) + 'px';
222+
const textareas = this.$el.querySelectorAll(".auto-expand-textarea");
223+
textareas.forEach((textarea) => {
224+
textarea.style.height = "auto";
225+
textarea.style.height = Math.max(100, textarea.scrollHeight) + "px";
218226
});
219227
});
220228
},

src/pages/EditMonitor.vue

Lines changed: 39 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1722,31 +1722,50 @@
17221722
<div class="form-text mb-3">
17231723
<div class="mb-2">
17241724
<i18n-t tag="span" keypath="liquidIntroduction">
1725-
<a href="https://liquidjs.com/" target="_blank">{{ $t("documentation") }}</a>
1725+
<a href="https://liquidjs.com/" target="_blank">
1726+
{{ $t("documentation") }}
1727+
</a>
17261728
</i18n-t>
17271729
</div>
17281730
<div class="mb-2">
17291731
<strong>{{ $t("templateAvailableVariables") }}:</strong>
1730-
<code v-pre>{{ status }}</code>,
1731-
<code v-pre>{{ name }}</code>,
1732-
<code v-pre>{{ hostnameOrURL }}</code>,
1733-
<code v-pre>{{ msg }}</code>,
1734-
<code v-pre>{{ monitorJSON }}</code>,
1732+
<code v-pre>{{ status }}</code>
1733+
,
1734+
<code v-pre>{{ name }}</code>
1735+
,
1736+
<code v-pre>{{ hostnameOrURL }}</code>
1737+
,
1738+
<code v-pre>{{ msg }}</code>
1739+
,
1740+
<code v-pre>{{ monitorJSON }}</code>
1741+
,
17351742
<code v-pre>{{ heartbeatJSON }}</code>
17361743
</div>
1737-
<div class="mt-3 p-2" style="background-color: rgba(100, 100, 100, 0.1); border-radius: 4px;">
1738-
<div class="mb-1"><strong>{{ $t("example") }}:</strong></div>
1744+
<div
1745+
class="mt-3 p-2"
1746+
style="background-color: rgba(100, 100, 100, 0.1); border-radius: 4px"
1747+
>
1748+
<div class="mb-1">
1749+
<strong>{{ $t("example") }}:</strong>
1750+
</div>
17391751
<div class="mb-2">
1740-
<code style="font-size: 0.85em; word-break: break-all;" v-pre>{% for tag in monitorJSON.tags %}{{ tag.name }}{% unless tag.value == blank %}: {{ tag.value }}{% endunless %}{% unless forloop.last %}, {% endunless %}{% endfor %}</code>
1752+
<code v-pre style="font-size: 0.85em; word-break: break-all">
1753+
{% for tag in monitorJSON.tags %}{{ tag.name }}{% unless tag.value ==
1754+
blank %}: {{ tag.value }}{% endunless %}{% unless forloop.last %}, {%
1755+
endunless %}{% endfor %}
1756+
</code>
17411757
</div>
1742-
<div style="font-size: 0.9em;">
1743-
<strong>{{ $t("Result") }}:</strong> <span style="opacity: 0.9;">nightly, phone: fbal</span>
1758+
<div style="font-size: 0.9em">
1759+
<strong>{{ $t("Result") }}:</strong>
1760+
<span style="opacity: 0.9">nightly, phone: fbal</span>
17441761
</div>
17451762
</div>
17461763
</div>
17471764

17481765
<div class="mb-3">
1749-
<label for="ntfy-custom-title-monitor" class="form-label">{{ $t("ntfyCustomTitle") }}</label>
1766+
<label for="ntfy-custom-title-monitor" class="form-label">
1767+
{{ $t("ntfyCustomTitle") }}
1768+
</label>
17501769
<input
17511770
id="ntfy-custom-title-monitor"
17521771
v-model="monitor.ntfyCustomTitle"
@@ -1758,10 +1777,12 @@
17581777
</div>
17591778

17601779
<div class="mb-3">
1761-
<label for="ntfy-custom-message-monitor" class="form-label">{{ $t("ntfyCustomMessage") }}</label>
1780+
<label for="ntfy-custom-message-monitor" class="form-label">
1781+
{{ $t("ntfyCustomMessage") }}
1782+
</label>
17621783
<textarea
1763-
ref="ntfyMessageMonitor"
17641784
id="ntfy-custom-message-monitor"
1785+
ref="ntfyMessageMonitor"
17651786
v-model="monitor.ntfyCustomMessage"
17661787
class="form-control auto-expand-textarea"
17671788
autocomplete="off"
@@ -3037,10 +3058,10 @@ message HealthCheckResponse {
30373058
*/
30383059
autoResizeTextarea() {
30393060
this.$nextTick(() => {
3040-
const textareas = this.$el.querySelectorAll('.auto-expand-textarea');
3041-
textareas.forEach(textarea => {
3042-
textarea.style.height = 'auto';
3043-
textarea.style.height = Math.max(100, textarea.scrollHeight) + 'px';
3061+
const textareas = this.$el.querySelectorAll(".auto-expand-textarea");
3062+
textareas.forEach((textarea) => {
3063+
textarea.style.height = "auto";
3064+
textarea.style.height = Math.max(100, textarea.scrollHeight) + "px";
30443065
});
30453066
});
30463067
},

0 commit comments

Comments
 (0)