add button and api to announce from call ui
This commit is contained in:
@@ -149,9 +149,23 @@
|
|||||||
<span>Initiate Call</span>
|
<span>Initiate Call</span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="p-1">
|
<div class="flex p-1">
|
||||||
<div>My Destination Hash</div>
|
<div>
|
||||||
<div class="text-sm text-gray-700">{{ myAudioCallAddressHash || "Unknown" }}</div>
|
<div>My Destination Hash</div>
|
||||||
|
<div class="text-sm text-gray-700">{{ myAudioCallAddressHash || "Unknown" }}</div>
|
||||||
|
</div>
|
||||||
|
<div class="ml-auto my-auto mr-1">
|
||||||
|
<a @click="announce" href="javascript:void(0)" class="rounded-full">
|
||||||
|
<div class="flex text-gray-700 bg-gray-100 hover:bg-gray-200 px-2 py-1 rounded-full">
|
||||||
|
<div>
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-6 h-6">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M8.288 15.038a5.25 5.25 0 0 1 7.424 0M5.106 11.856c3.807-3.808 9.98-3.808 13.788 0M1.924 8.674c5.565-5.565 14.587-5.565 20.152 0M12.53 18.22l-.53.53-.53-.53a.75.75 0 0 1 1.06 0Z" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
<div class="my-auto mx-1 text-sm">Announce</div>
|
||||||
|
</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -645,6 +659,14 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
async announce() {
|
||||||
|
try {
|
||||||
|
await window.axios.get(`/api/v1/announce`);
|
||||||
|
} catch(e) {
|
||||||
|
alert("failed to announce");
|
||||||
|
console.log(error);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
activeAudioCalls: function() {
|
activeAudioCalls: function() {
|
||||||
|
|||||||
26
web.py
26
web.py
@@ -403,6 +403,16 @@ class ReticulumWebChat:
|
|||||||
"message": "call has been hungup",
|
"message": "call has been hungup",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
# announce
|
||||||
|
@routes.get("/api/v1/announce")
|
||||||
|
async def index(request):
|
||||||
|
|
||||||
|
self.announce()
|
||||||
|
|
||||||
|
return web.json_response({
|
||||||
|
"message": "announcing",
|
||||||
|
})
|
||||||
|
|
||||||
# serve announces
|
# serve announces
|
||||||
@routes.get("/api/v1/announces")
|
@routes.get("/api/v1/announces")
|
||||||
async def index(request):
|
async def index(request):
|
||||||
@@ -611,6 +621,15 @@ class ReticulumWebChat:
|
|||||||
app.on_startup.append(on_startup)
|
app.on_startup.append(on_startup)
|
||||||
web.run_app(app, host=host, port=port)
|
web.run_app(app, host=host, port=port)
|
||||||
|
|
||||||
|
# handle announcing
|
||||||
|
def announce(self):
|
||||||
|
|
||||||
|
# send announce for lxmf
|
||||||
|
self.local_lxmf_destination.announce(app_data=self.config.display_name.get().encode("utf-8"))
|
||||||
|
|
||||||
|
# send announce for audio call
|
||||||
|
self.audio_call_manager.announce(app_data=self.config.display_name.get().encode("utf-8"))
|
||||||
|
|
||||||
# handle data received from websocket client
|
# handle data received from websocket client
|
||||||
async def on_websocket_data_received(self, client, data):
|
async def on_websocket_data_received(self, client, data):
|
||||||
|
|
||||||
@@ -669,12 +688,7 @@ class ReticulumWebChat:
|
|||||||
|
|
||||||
# handle sending an announce
|
# handle sending an announce
|
||||||
elif _type == "announce":
|
elif _type == "announce":
|
||||||
|
self.announce()
|
||||||
# send announce for lxmf
|
|
||||||
self.local_lxmf_destination.announce(app_data=self.config.display_name.get().encode("utf-8"))
|
|
||||||
|
|
||||||
# send announce for audio call
|
|
||||||
self.audio_call_manager.announce(app_data=self.config.display_name.get().encode("utf-8"))
|
|
||||||
|
|
||||||
# handle downloading a file from a nomadnet node
|
# handle downloading a file from a nomadnet node
|
||||||
elif _type == "nomadnet.file.download":
|
elif _type == "nomadnet.file.download":
|
||||||
|
|||||||
Reference in New Issue
Block a user