KI-AGENT: Asterisk-Trunk aus FEDEO anwenden
This commit is contained in:
@@ -134,6 +134,7 @@ const mcpTokenForm = reactive({
|
||||
})
|
||||
const telephonyTrunkLoading = ref(false)
|
||||
const telephonyTrunkSaving = ref(false)
|
||||
const telephonyTrunkApplying = ref(false)
|
||||
const telephonyTrunkForm = reactive({
|
||||
enabled: false,
|
||||
registrar: "tel.t-online.de",
|
||||
@@ -272,6 +273,30 @@ const saveTelephonyTrunk = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const applyTelephonyTrunk = async () => {
|
||||
telephonyTrunkApplying.value = true
|
||||
|
||||
try {
|
||||
const res = await useNuxtApp().$api("/api/telephony/trunk-config/apply", {
|
||||
method: "POST"
|
||||
})
|
||||
|
||||
toast.add({
|
||||
title: res?.warning ? "Trunk-Konfiguration geschrieben" : "Telefonie-Trunk angewendet",
|
||||
description: res?.warning || (res?.status?.registered ? "Telekom-Registration ist aktiv." : "Asterisk wurde neu geladen."),
|
||||
color: res?.warning ? "orange" : "success"
|
||||
})
|
||||
} catch (error) {
|
||||
toast.add({
|
||||
title: "Telefonie-Trunk konnte nicht angewendet werden",
|
||||
description: error?.data?.error || error?.message,
|
||||
color: "error"
|
||||
})
|
||||
} finally {
|
||||
telephonyTrunkApplying.value = false
|
||||
}
|
||||
}
|
||||
|
||||
const createMcpToken = async () => {
|
||||
if (!mcpTokenForm.name?.trim()) {
|
||||
toast.add({ title: "Name fehlt", description: "Bitte gib einen Namen für den Token an.", color: "orange" })
|
||||
@@ -516,6 +541,15 @@ onMounted(() => {
|
||||
>
|
||||
Telefonie-Trunk speichern
|
||||
</UButton>
|
||||
<UButton
|
||||
icon="i-heroicons-arrow-path-rounded-square"
|
||||
color="primary"
|
||||
variant="soft"
|
||||
:loading="telephonyTrunkApplying"
|
||||
@click="applyTelephonyTrunk"
|
||||
>
|
||||
In Asterisk anwenden
|
||||
</UButton>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user