mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-09 15:27:30 -05:00
Merge pull request #177 from tadscottsmith/save-patches
Save patch infomation for calls.
This commit is contained in:
@@ -20,6 +20,7 @@ const build_call_list = (items) => {
|
||||
srcList: item.srcList,
|
||||
star: item.star,
|
||||
freq: item.freq,
|
||||
patches: item.patches,
|
||||
len: Math.round(item.len)
|
||||
};
|
||||
calls.push(call);
|
||||
@@ -38,6 +39,7 @@ async function get_calls(query, numResults, middleDate, res) {
|
||||
time: true,
|
||||
srcList: true,
|
||||
freq: true,
|
||||
patches: true,
|
||||
star: true,
|
||||
len: true,
|
||||
url: true
|
||||
|
||||
@@ -108,6 +108,19 @@ exports.upload = async function (req, res, next) {
|
||||
return;
|
||||
}
|
||||
|
||||
patches = [];
|
||||
|
||||
let req_patches;
|
||||
req_patches = req.body.patch_list;
|
||||
|
||||
if(typeof req_patches != "undefined"){
|
||||
var split_patches = req_patches.replace("[","").replace("]","").split(",");
|
||||
|
||||
for (var patch in split_patches){
|
||||
patches.push(split_patches[patch]);
|
||||
}
|
||||
}
|
||||
|
||||
let item = null;
|
||||
|
||||
await tracer.startActiveSpan('validate_system', { parent: trace.getActiveSpan(context.active()) }, async (validateSpan) => {
|
||||
@@ -178,6 +191,7 @@ exports.upload = async function (req, res, next) {
|
||||
url,
|
||||
emergency,
|
||||
path: local_path,
|
||||
patches: patches,
|
||||
srcList,
|
||||
len: req.body.call_length ? parseFloat(req.body.call_length) : (stopTime - time) / 1000,
|
||||
});
|
||||
|
||||
@@ -17,6 +17,7 @@ const callSchema = mongoose.Schema({
|
||||
emergency: Boolean,
|
||||
path: String,
|
||||
len: Number,
|
||||
patches: [Number],
|
||||
star: {
|
||||
type: Number,
|
||||
default: 0
|
||||
|
||||
@@ -22,6 +22,8 @@ function CallInfoPane(props) {
|
||||
let callDate = "-";
|
||||
let callTime = "-";
|
||||
let talkgroupNum = "-";
|
||||
let patches = [];
|
||||
let patchString = "";
|
||||
let header = "Call Info"
|
||||
let title = ""
|
||||
const currentCall = props.call ? props.call : false;
|
||||
@@ -51,6 +53,14 @@ function CallInfoPane(props) {
|
||||
srcList = currentCall.srcList.map((source, index) => <List.Item key={index}>{source.src}[{source.pos}]</List.Item>);
|
||||
callLength = currentCall.len;
|
||||
talkgroupNum = currentCall.talkgroupNum;
|
||||
patches = currentCall.patches;
|
||||
|
||||
if(patches.length > 1) {
|
||||
patchString = patches.join(", ");
|
||||
}
|
||||
else{
|
||||
patchString = "No Patches";
|
||||
}
|
||||
|
||||
}
|
||||
let system = false;
|
||||
@@ -102,7 +112,6 @@ function CallInfoPane(props) {
|
||||
<Statistic.Label>Talkgroup</Statistic.Label>
|
||||
<Statistic.Value>{talkgroupNum}</Statistic.Value>
|
||||
</Statistic>
|
||||
|
||||
<List divided verticalAlign='middle'>
|
||||
<List.Item>
|
||||
<Icon name="wait" />
|
||||
@@ -122,6 +131,12 @@ function CallInfoPane(props) {
|
||||
{callFreq} MHz
|
||||
</List.Content>
|
||||
</List.Item>
|
||||
<List.Item>
|
||||
<Icon name="exchange" />
|
||||
<List.Content>
|
||||
{patchString}
|
||||
</List.Content>
|
||||
</List.Item>
|
||||
</List>
|
||||
<Divider />
|
||||
<Menu secondary fluid widths={2}>
|
||||
|
||||
Reference in New Issue
Block a user