diff --git a/backend/controllers/calls.js b/backend/controllers/calls.js
index 248bbac..882c1a3 100644
--- a/backend/controllers/calls.js
+++ b/backend/controllers/calls.js
@@ -17,6 +17,7 @@ function get_calls(query, numResults, res) {
var fields = {
_id: true,
talkgroupNum: true,
+ shortName: true,
path: true,
name: true,
time: true,
@@ -38,6 +39,7 @@ function get_calls(query, numResults, res) {
if (item) {
call = {
_id: item._id.toHexString(),
+ shortName: item.shortName,
talkgroupNum: item.talkgroupNum,
url: item.url,
filename: item.path + item.name,
diff --git a/frontend/src/Call/components/CallInfo.js b/frontend/src/Call/components/CallInfo.js
index a566028..74935d2 100644
--- a/frontend/src/Call/components/CallInfo.js
+++ b/frontend/src/Call/components/CallInfo.js
@@ -13,6 +13,7 @@ import {
Tab
} from "semantic-ui-react";
import PlaylistBuilder from "./PlaylistBuilder"
+import CallInfoPane from "./CallInfoPane"
// ----------------------------------------------------
function CallInfo(props) {
const { shortName } = useParams();
@@ -51,56 +52,18 @@ function CallInfo(props) {
const panes = [
{
- menuItem: 'Call Info', render: () => {
+ menuItem: { key: 'info', icon: 'info', content: 'Call Info' }, render: () => {
return (
-
-
-
-
- {srcList}
-
-
-
- Seconds
- {callLength}
-
-
- Talkgroup
- {talkgroupNum}
-
-
-
-
-
- {callTime}
-
-
-
-
-
- {callDate}
-
-
-
-
-
- {callFreq} MHz
-
-
-
+
+
-
-
+
)
}
},
{
- menuItem: 'Playlist', render: () => {
+ menuItem: { key: 'list', icon: 'list', content: 'Create Event' }, render: () => {
return (
)
@@ -111,7 +74,7 @@ function CallInfo(props) {
return (
-
+
);
}
diff --git a/frontend/src/Call/components/CallInfoPane.js b/frontend/src/Call/components/CallInfoPane.js
new file mode 100644
index 0000000..6d70c34
--- /dev/null
+++ b/frontend/src/Call/components/CallInfoPane.js
@@ -0,0 +1,98 @@
+import React, { useState } from "react";
+import { useCallLink } from "./CallLinks";
+import {skipToken} from '@reduxjs/toolkit/query'
+import { useGetGroupsQuery, useGetTalkgroupsQuery } from '../../features/api/apiSlice'
+import { Link, useLocation, useParams, useNavigate } from 'react-router-dom';
+import {
+ Header,
+ Divider,
+ List,
+ Segment,
+ Statistic,
+ Icon,
+ Menu,
+ Tab
+} from "semantic-ui-react";
+import PlaylistBuilder from "./PlaylistBuilder"
+// ----------------------------------------------------
+function CallInfoPane(props) {
+
+
+ let srcList = "";
+ let callLength = "-";
+ let callFreq = "-";
+ let callDate = "-";
+ let callTime = "-";
+ let talkgroupNum = "-";
+ let header = "Call Info"
+ const currentCall = props.call?props.call:false;
+
+
+
+ const { data: talkgroupsData, isSuccess: isTalkgroupsSuccess } = useGetTalkgroupsQuery(currentCall?currentCall.shortName:skipToken);
+
+ if (currentCall) {
+ if ((talkgroupsData) && talkgroupsData.talkgroups[currentCall.talkgroupNum]) {
+ header = talkgroupsData.talkgroups[currentCall.talkgroupNum].description;
+ }
+ const time = new Date(currentCall.time);
+ callTime = time.toLocaleTimeString();
+ callDate = time.toLocaleDateString();
+ if (currentCall.freq) {
+ const freq = currentCall.freq / 1000000;
+ callFreq = Math.round(freq * 1000) / 1000;
+ }
+ srcList = currentCall.srcList.map((source, index) => {source.src}[{source.pos}]);
+ callLength = currentCall.len;
+ talkgroupNum = currentCall.talkgroupNum;
+
+ }
+ const { callLink, callDownload, callTweet } = useCallLink(props.call)
+
+
+ return (
+ <>
+
+
+ {srcList}
+
+
+
+ Seconds
+ {callLength}
+
+
+ Talkgroup
+ {talkgroupNum}
+
+
+
+
+
+
+ {callTime}
+
+
+
+
+
+ {callDate}
+
+
+
+
+
+ {callFreq} MHz
+
+
+
+
+
+ >
+ );
+}
+
+export default CallInfoPane;
diff --git a/frontend/src/Call/components/PlaylistBuilder.js b/frontend/src/Call/components/PlaylistBuilder.js
index b38ddeb..176365e 100644
--- a/frontend/src/Call/components/PlaylistBuilder.js
+++ b/frontend/src/Call/components/PlaylistBuilder.js
@@ -164,7 +164,7 @@ function PlaylistBuilder(props) {
-
-
+
{eventData && eventData.description}
@@ -135,15 +135,15 @@ function ViewEvent(props) {
- {eventData.numCalls}
+ {eventData && eventData.numCalls}
Calls
-
+
-
+ {eventData && }
);
}