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