|
|
@ -1,132 +1,62 @@
|
|
|
|
<template>
|
|
|
|
<template>
|
|
|
|
<form @submit.prevent="submit">
|
|
|
|
<form @submit.prevent="submit">
|
|
|
|
<div
|
|
|
|
<div ref="modal" class="modal fade" tabindex="-1" data-bs-backdrop="static">
|
|
|
|
ref="modal"
|
|
|
|
|
|
|
|
class="modal fade"
|
|
|
|
|
|
|
|
tabindex="-1"
|
|
|
|
|
|
|
|
data-bs-backdrop="static"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-dialog">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<div class="modal-header">
|
|
|
|
<h5 id="exampleModalLabel" class="modal-title">
|
|
|
|
<h5 id="exampleModalLabel" class="modal-title">
|
|
|
|
{{ $t("Setup Notification") }}
|
|
|
|
{{ $t("Setup Notification") }}
|
|
|
|
</h5>
|
|
|
|
</h5>
|
|
|
|
<button
|
|
|
|
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" />
|
|
|
|
type="button"
|
|
|
|
|
|
|
|
class="btn-close"
|
|
|
|
|
|
|
|
data-bs-dismiss="modal"
|
|
|
|
|
|
|
|
aria-label="Close"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="modal-body">
|
|
|
|
<div class="mb-3">
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="notification-type" class="form-label">{{
|
|
|
|
<label for="notification-type" class="form-label">{{ $t("Notification Type") }}</label>
|
|
|
|
$t("Notification Type")
|
|
|
|
<select id="notification-type" v-model="notification.type" class="form-select">
|
|
|
|
}}</label>
|
|
|
|
<option v-for="(name, type) in notificationNameList.regularList" :key="type" :value="type">{{ name }}</option>
|
|
|
|
<select
|
|
|
|
|
|
|
|
id="notification-type"
|
|
|
|
|
|
|
|
v-model="notification.type"
|
|
|
|
|
|
|
|
class="form-select"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<option
|
|
|
|
|
|
|
|
v-for="(
|
|
|
|
|
|
|
|
name, type
|
|
|
|
|
|
|
|
) in notificationNameList.regularList"
|
|
|
|
|
|
|
|
:key="type"
|
|
|
|
|
|
|
|
:value="type"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ name }}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
<optgroup :label="$t('notificationRegional')">
|
|
|
|
<optgroup :label="$t('notificationRegional')">
|
|
|
|
<option
|
|
|
|
<option v-for="(name, type) in notificationNameList.regionalList" :key="type" :value="type">{{ name }}</option>
|
|
|
|
v-for="(
|
|
|
|
|
|
|
|
name, type
|
|
|
|
|
|
|
|
) in notificationNameList.regionalList"
|
|
|
|
|
|
|
|
:key="type"
|
|
|
|
|
|
|
|
:value="type"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ name }}
|
|
|
|
|
|
|
|
</option>
|
|
|
|
|
|
|
|
</optgroup>
|
|
|
|
</optgroup>
|
|
|
|
</select>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
<div class="mb-3">
|
|
|
|
<label for="notification-name" class="form-label">{{
|
|
|
|
<label for="notification-name" class="form-label">{{ $t("Friendly Name") }}</label>
|
|
|
|
$t("Friendly Name")
|
|
|
|
<input id="notification-name" v-model="notification.name" type="text" class="form-control" required>
|
|
|
|
}}</label>
|
|
|
|
|
|
|
|
<input
|
|
|
|
|
|
|
|
id="notification-name"
|
|
|
|
|
|
|
|
v-model="notification.name"
|
|
|
|
|
|
|
|
type="text"
|
|
|
|
|
|
|
|
class="form-control"
|
|
|
|
|
|
|
|
required
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<!-- form body -->
|
|
|
|
<!-- form body -->
|
|
|
|
<component :is="currentForm" />
|
|
|
|
<component :is="currentForm" />
|
|
|
|
|
|
|
|
|
|
|
|
<div class="mb-3 mt-4">
|
|
|
|
<div class="mb-3 mt-4">
|
|
|
|
<hr class="dropdown-divider mb-4" />
|
|
|
|
<hr class="dropdown-divider mb-4">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-check form-switch">
|
|
|
|
<div class="form-check form-switch">
|
|
|
|
<input
|
|
|
|
<input v-model="notification.isDefault" class="form-check-input" type="checkbox">
|
|
|
|
v-model="notification.isDefault"
|
|
|
|
<label class="form-check-label">{{ $t("Default enabled") }}</label>
|
|
|
|
class="form-check-input"
|
|
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<label class="form-check-label">{{
|
|
|
|
|
|
|
|
$t("Default enabled")
|
|
|
|
|
|
|
|
}}</label>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="form-text">
|
|
|
|
<div class="form-text">
|
|
|
|
{{ $t("enableDefaultNotificationDescription") }}
|
|
|
|
{{ $t("enableDefaultNotificationDescription") }}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<br />
|
|
|
|
<br>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="form-check form-switch">
|
|
|
|
<div class="form-check form-switch">
|
|
|
|
<input
|
|
|
|
<input v-model="notification.applyExisting" class="form-check-input" type="checkbox">
|
|
|
|
v-model="notification.applyExisting"
|
|
|
|
<label class="form-check-label">{{ $t("Apply on all existing monitors") }}</label>
|
|
|
|
class="form-check-input"
|
|
|
|
|
|
|
|
type="checkbox"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
<label class="form-check-label">{{
|
|
|
|
|
|
|
|
$t("Apply on all existing monitors")
|
|
|
|
|
|
|
|
}}</label>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div class="modal-footer">
|
|
|
|
<div class="modal-footer">
|
|
|
|
<button
|
|
|
|
<button v-if="id" type="button" class="btn btn-danger" :disabled="processing" @click="deleteConfirm">
|
|
|
|
v-if="id"
|
|
|
|
|
|
|
|
type="button"
|
|
|
|
|
|
|
|
class="btn btn-danger"
|
|
|
|
|
|
|
|
:disabled="processing"
|
|
|
|
|
|
|
|
@click="deleteConfirm"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ $t("Delete") }}
|
|
|
|
{{ $t("Delete") }}
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
<button type="button" class="btn btn-warning" :disabled="processing" @click="test">
|
|
|
|
type="button"
|
|
|
|
|
|
|
|
class="btn btn-warning"
|
|
|
|
|
|
|
|
:disabled="processing"
|
|
|
|
|
|
|
|
@click="test"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ $t("Test") }}
|
|
|
|
{{ $t("Test") }}
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
<button
|
|
|
|
<button type="submit" class="btn btn-primary" :disabled="processing">
|
|
|
|
type="submit"
|
|
|
|
<div v-if="processing" class="spinner-border spinner-border-sm me-1"></div>
|
|
|
|
class="btn btn-primary"
|
|
|
|
|
|
|
|
:disabled="processing"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-if="processing"
|
|
|
|
|
|
|
|
class="spinner-border spinner-border-sm me-1"
|
|
|
|
|
|
|
|
></div>
|
|
|
|
|
|
|
|
{{ $t("Save") }}
|
|
|
|
{{ $t("Save") }}
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -135,13 +65,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</form>
|
|
|
|
</form>
|
|
|
|
|
|
|
|
|
|
|
|
<Confirm
|
|
|
|
<Confirm ref="confirmDelete" btn-style="btn-danger" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="deleteNotification">
|
|
|
|
ref="confirmDelete"
|
|
|
|
|
|
|
|
btn-style="btn-danger"
|
|
|
|
|
|
|
|
:yes-text="$t('Yes')"
|
|
|
|
|
|
|
|
:no-text="$t('No')"
|
|
|
|
|
|
|
|
@yes="deleteNotification"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ $t("deleteNotificationMsg") }}
|
|
|
|
{{ $t("deleteNotificationMsg") }}
|
|
|
|
</Confirm>
|
|
|
|
</Confirm>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
@ -197,7 +121,6 @@ export default {
|
|
|
|
"gotify": "Gotify",
|
|
|
|
"gotify": "Gotify",
|
|
|
|
"GrafanaOncall": "Grafana Oncall",
|
|
|
|
"GrafanaOncall": "Grafana Oncall",
|
|
|
|
"HomeAssistant": "Home Assistant",
|
|
|
|
"HomeAssistant": "Home Assistant",
|
|
|
|
"HeiiOnCall": "Heii On-Call",
|
|
|
|
|
|
|
|
"Kook": "Kook",
|
|
|
|
"Kook": "Kook",
|
|
|
|
"line": "LINE Messenger",
|
|
|
|
"line": "LINE Messenger",
|
|
|
|
"LineNotify": "LINE Notify",
|
|
|
|
"LineNotify": "LINE Notify",
|
|
|
@ -407,8 +330,7 @@ export default {
|
|
|
|
@import "../assets/vars.scss";
|
|
|
|
@import "../assets/vars.scss";
|
|
|
|
|
|
|
|
|
|
|
|
.dark {
|
|
|
|
.dark {
|
|
|
|
.modal-dialog .form-text,
|
|
|
|
.modal-dialog .form-text, .modal-dialog p {
|
|
|
|
.modal-dialog p {
|
|
|
|
|
|
|
|
color: $dark-font-color;
|
|
|
|
color: $dark-font-color;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|