Skip to content

Commit

Permalink
Alert settings emailer config
Browse files Browse the repository at this point in the history
  • Loading branch information
rcmaiolini committed Dec 16, 2024
1 parent b0abab0 commit 4abaed9
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 14 deletions.
5 changes: 5 additions & 0 deletions src/components/common/Form/CustomInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
icon-right-clickable
@icon-right-click="clearField"
v-mask="inputMask"
:disabled="customInputDisable"
/>
</template>

Expand All @@ -23,6 +24,10 @@ export default {
type: String,
default: '',
},
customInputDisable: {
type: Boolean,
default: false,
},
},
methods: {
clearField() {
Expand Down
59 changes: 45 additions & 14 deletions src/components/settings/AlertService.vue
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
/>
<CustomRadio
v-model="AlertService.Emailer.Enabled"
:options="trueOrFalseOptions"
:options="enabledOptions"
/>
</div>
</div>
Expand Down Expand Up @@ -163,6 +163,45 @@
</div>
</div>

<div class="columns is-multiline">
<div class="column is-one-quarter">
<div class="field">
<div
class="is-flex is-flex-direction-row is-justify-content-space-between"
>
<label
v-html="highlight(AlertServiceLabels[35])"
class="label is-small"
/>
<b-icon
pack="fas"
icon="circle-info"
size="is-small"
type="is-info"
v-tooltip.top="options(crontabOptions)"
/>
</div>
<CustomInput
v-model="AlertService.ReportAlertJob.Crontab"
:customInputDisable="AlertService.Emailer.Enabled !== null"
/>
</div>
</div>
<div class="column is-one-quarter">
<div class="field">
<label
v-html="highlight(AlertServiceLabels[36])"
class="label is-small"
/>
<CustomRadio
v-model="AlertService.ReportAlertJob.RunAtStartup"
:options="trueOrFalseOptions"
:customRadioDisable="AlertService.Emailer.Enabled !== null"
/>
</div>
</div>
</div>

<div class="columns is-multiline">
<div class="column is-one-quarter">
<div class="field">
Expand Down Expand Up @@ -696,7 +735,7 @@
<div class="column is-one-quarter">
<div class="field">
<label
v-html="highlight(AlertServiceLabels[29])"
v-html="highlight(AlertServiceLabels[36])"
class="label is-small"
/>
<CustomRadio
Expand Down Expand Up @@ -743,7 +782,7 @@
<div class="column is-one-quarter">
<div class="field">
<label
v-html="highlight(AlertServiceLabels[32])"
v-html="highlight(AlertServiceLabels[36])"
class="label is-small"
/>
<CustomRadio
Expand Down Expand Up @@ -814,17 +853,9 @@ export default {
},
watch: {
emailerEnabled(value) {
if (!value) {
this.AlertService.Emailer.AlertType.NewHost.Enable = false
this.AlertService.Emailer.AlertType.NewDatabase.Enable = false
this.AlertService.Emailer.AlertType.NewLicense.Enable = false
this.AlertService.Emailer.AlertType.NewOption.Enable = false
this.AlertService.Emailer.AlertType.NewUnlistedRunningDatabase.Enable = false
this.AlertService.Emailer.AlertType.NewHostCpu.Enable = false
this.AlertService.Emailer.AlertType.MissingPrimaryDatabase.Enable = false
this.AlertService.Emailer.AlertType.MissingDatabase.Enable = false
this.AlertService.Emailer.AlertType.AgentError.Enable = false
this.AlertService.Emailer.AlertType.NoData.Enable = false
if (value !== null) {
this.AlertService.ReportAlertJob.Crontab = null
this.AlertService.ReportAlertJob.RunAtStartup = false
}
},
},
Expand Down
26 changes: 26 additions & 0 deletions src/mixins/settings/settings.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ export default {
DueDays: null,
RunAtStartup: null,
},
ReportAlertJob: {
Crontab: null,
RunAtStartup: null,
},
},
ChartService: {
RemoteEndpoint: null,
Expand Down Expand Up @@ -260,6 +264,8 @@ export default {
'Delete Alerts Older Than',
'Enable All To',
'Alert Severity',
'Report Alert Crontab',
'Run At Startup',
],
highlightAlertService: false,
ChartServiceLabels: [
Expand Down Expand Up @@ -486,6 +492,10 @@ export default {
DueDays: this.getAlertService.RemoveAlertJob.DueDays,
RunAtStartup: this.getAlertService.RemoveAlertJob.RunAtStartup,
},
ReportAlertJob: {
Crontab: this.getAlertService.ReportAlertJob.Crontab,
RunAtStartup: this.getAlertService.ReportAlertJob.RunAtStartup,
},
}
},
bindOriginalChartServiceData() {
Expand Down Expand Up @@ -696,5 +706,21 @@ export default {
},
]
},
enabledOptions() {
return [
{
text: this.$i18n.t('common.forms.yes'),
val: true,
},
{
text: 'Crontab',
val: null,
},
{
text: this.$i18n.t('common.forms.no'),
val: false,
},
]
},
},
}

0 comments on commit 4abaed9

Please sign in to comment.