From f8106e31bc733878064bf11a4496f9aaad82602b Mon Sep 17 00:00:00 2001 From: liamcottle Date: Tue, 21 May 2024 00:24:53 +1200 Subject: [PATCH] add separate sections for active calls and call history --- public/call.html | 72 ++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 64 insertions(+), 8 deletions(-) diff --git a/public/call.html b/public/call.html index e1b0741..c93210b 100644 --- a/public/call.html +++ b/public/call.html @@ -21,7 +21,7 @@
-
+
@@ -108,25 +108,62 @@
- -
+ +
-
Call Log
+
Active Calls
-
+
-
Initiator Identity: {{ audioCall.initiator_identity_hash || "Unknown" }}
Call Hash: {{ audioCall.hash }}
+
Initiator Identity: {{ audioCall.initiator_identity_hash || "Unknown" }}
- Status: Active - Status: Inactive + Direction: Outbound + Direction: Inbound
+
+
+ + + + + + + +
+
+
+
+ + +
+
+
+ + + +
+
Call History
+
+
+
+
+
Call Hash: {{ audioCall.hash }}
+
Initiator Identity: {{ audioCall.initiator_identity_hash || "Unknown" }}
Direction: Outbound Direction: Inbound @@ -335,6 +372,12 @@ }, async hangupCall(callHash) { + + // confirm user wants to hang up call + if(!confirm("Are you sure you want to hang up this call?")){ + return; + } + try { // hangup call @@ -346,6 +389,7 @@ } catch(e) { alert("failed to hangup call"); } + }, leaveCall: function() { @@ -499,6 +543,18 @@ } }, }, + computed: { + activeAudioCalls: function() { + return this.audioCalls.filter((audioCall) => { + return audioCall.is_active; + }); + }, + inactiveAudioCalls: function() { + return this.audioCalls.filter((audioCall) => { + return !audioCall.is_active; + }); + }, + }, }).mount('#app');