Add default completion. Update Apiv1 message type selection

This commit is contained in:
AxeKam333 2025-03-20 09:26:53 +01:00
parent 1d3e811e1b
commit c200a3450b
2 changed files with 31 additions and 12 deletions

View File

@ -38,11 +38,11 @@ class SMSEagle extends NotificationProvider {
else
duration = 10;
if (notification.smseagleRecipientType == "smseagle-ring") {
if (notification.smseagleMsgType == "smseagle-ring") {
sendMethod = "/ring_call";
} else if (notification.smseagleRecipientType == "smseagle-tts") {
} else if (notification.smseagleMsgType == "smseagle-tts") {
sendMethod = "/tts_call";
} else if (notification.smseagleRecipientType == "smseagle-tts-advanced") {
} else if (notification.smseagleMsgType == "smseagle-tts-advanced") {
sendMethod = "/tts_adv_call";
voice_id = notification.smseagleTtsModel;
}

View File

@ -1,7 +1,8 @@
<template>
<div class="mb-3">
<label for="smseagle-url" class="form-label">{{ $t("smseagleUrl") }}</label>
<input id="smseagle-url" v-model="$parent.notification.smseagleUrl" type="text" minlength="7" class="form-control" placeholder="http://127.0.0.1" required>
<input id="smseagle-url" v-model="$parent.notification.smseagleUrl" type="text" minlength="7"
class="form-control" placeholder="http://127.0.0.1" required>
</div>
<div class="mb-3">
<label for="smseagle-token" class="form-label">{{ $t("smseagleToken") }}</label>
@ -17,13 +18,11 @@
<div v-if="$parent.notification.smseagleApiType === 'smseagle-apiv1'" class="mb-3">
<div class="mb-3">
<label for="smseagle-recipient-type" class="form-label">{{ $t("smseagleRecipientType") }}</label>
<select id="smseagle-recipient-type" v-model="$parent.notification.smseagleRecipientType" class="form-select">
<select id="smseagle-recipient-type" v-model="$parent.notification.smseagleRecipientType"
class="form-select">
<option value="smseagle-to" selected>{{ $t("smseagleTo") }}</option>
<option value="smseagle-group">{{ $t("smseagleGroup") }}</option>
<option value="smseagle-contact">{{ $t("smseagleContact") }}</option>
<option value="smseagle-ring">{{ $t("smseagleTo") }} {{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleTo") }} {{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleTo") }} {{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div class="mb-3">
@ -38,13 +37,22 @@
<label for="smseagle-encoding" class="form-label">{{ $t("smseagleEncoding") }}</label>
<input id="smseagle-encoding" v-model="$parent.notification.smseagleEncoding" type="checkbox" class="form-check-input">
</div>
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-ring'
|| $parent.notification.smseagleRecipientType === 'smseagle-tts'
|| $parent.notification.smseagleRecipientType === 'smseagle-tts-advanced'" class="mb-3">
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-to'" class="mb-3">
<label for="smseagle-msg-type" class="form-label">{{ $t("smseagleMsgType") }} </label>
<select id="smseagle-msg-type" v-model="$parent.notification.smseagleMsgType" class="form-select">
<option value="smseagle-sms" selected>{{ $t("smseagleMsgSms") }} </option>
<option value="smseagle-ring">{{ $t("smseagleMsgRing") }} </option>
<option value="smseagle-tts">{{ $t("smseagleMsgTts") }} </option>
<option value="smseagle-tts-advanced">{{ $t("smseagleMsgTtsAdvanced") }} </option>
</select>
</div>
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-ring'
|| $parent.notification.smseagleMsgType === 'smseagle-tts'
|| $parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-duration" class="form-label">{{ $t("smseagleDuration") }}</label>
<input id="smseagle-duration" v-model="$parent.notification.smseagleDuration" type="number" class="form-control" min="0" max="30" step="1" placeholder="10">
</div>
<div v-if="$parent.notification.smseagleRecipientType === 'smseagle-tts-advanced'" class="mb-3">
<div v-if="$parent.notification.smseagleMsgType === 'smseagle-tts-advanced'" class="mb-3">
<label for="smseagle-tts-model" class="form-label">{{ $t("smseagleTtsModel") }} </label>
<input id="smseagle-tts-model" v-model="$parent.notification.smseagleTtsModel" type="number" class="form-control" required>
</div>
@ -100,5 +108,16 @@ export default {
components: {
HiddenInput,
},
mounted() {
if (!this.$parent.notification.smseagleApiType) {
this.$parent.notification.smseagleApiType = 'smseagle-apiv2';
}
if (!this.$parent.notification.smseagleMsgType) {
this.$parent.notification.smseagleMsgType = 'smseagle-sms';
}
if (!this.$parent.notification.smseagleRecipientType) {
this.$parent.notification.smseagleRecipientType = 'smseagle-to';
}
}
};
</script>