-
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #172 from openmhz/stats-display
fixes for slow
- Loading branch information
Showing
18 changed files
with
3,001 additions
and
3,033 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,8 +42,9 @@ const Login = (props) => { | |
const loginSubmit = async (event) => { | ||
event.preventDefault(); | ||
const result = await dispatch(loginUser({ email, password })).unwrap(); | ||
const user = result.user; | ||
if (result.success) { | ||
if ((pathname != "/terms") && (terms != 1.1)) { | ||
if ((pathname != "/terms") && (user.terms != 1.1)) { | ||
navigate("/terms") | ||
} else if (nextLocation) { | ||
switch (nextLocation) { | ||
|
@@ -130,7 +131,7 @@ const Login = (props) => { | |
href="mailto:{process.env.REACT_APP_ADMIN_EMAIL}?Subject={process.env.REACT_APP_SITE_NAME}" | ||
target="_top" | ||
> | ||
[email protected] | ||
{process.env.REACT_APP_ADMIN_EMAIL} | ||
</a>{" "} | ||
</p> | ||
</Grid.Column> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1 @@ | ||
const Group = require("../models/group"); | ||
|
||
exports.get_groups = async function (req, res) { | ||
const grp_results = await Group.find({ shortName: req.params.shortName.toLowerCase()}).sort("position").catch(err => { | ||
console.error(err); | ||
res.status(500); | ||
res.json({ success: false, message: err }); | ||
return; | ||
}); | ||
|
||
res.contentType('json'); | ||
res.send(JSON.stringify(grp_results)); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,53 @@ | ||
const Talkgroup = require("../models/talkgroup"); | ||
const Group = require("../models/group"); | ||
|
||
exports.get_talkgroups = async function (req, res) { | ||
const tg_results = await Talkgroup.find({ 'shortName': req.params.shortName.toLowerCase()}).catch(err => { | ||
let groups = {}; | ||
let talkgroups = {}; | ||
|
||
async function load_talkgroups(shortName) { | ||
const tg_results = await Talkgroup.find({ 'shortName': shortName }).catch(err => { | ||
console.error(err); | ||
res.status(500); | ||
res.json({ success: false, message: err }); | ||
return; | ||
}); | ||
var talkgroups = {}; | ||
}); | ||
|
||
let temp = {} | ||
for (var tg in tg_results) { | ||
var talkgroup = {_id: tg_results[tg]._id, num: tg_results[tg].num, alpha: tg_results[tg].alpha, description: tg_results[tg].description} | ||
talkgroups[tg_results[tg].num] = talkgroup; | ||
var talkgroup = { _id: tg_results[tg]._id, num: tg_results[tg].num, alpha: tg_results[tg].alpha, description: tg_results[tg].description } | ||
temp[tg_results[tg].num] = talkgroup; | ||
} | ||
|
||
return temp; | ||
} | ||
|
||
exports.get_talkgroups = async function (req, res) { | ||
const shortName = req.params.shortName.toLowerCase(); | ||
/* | ||
if (talkgroups.hasOwnProperty(shortName)) { | ||
talkgroups = talkgroups[shortName]; | ||
} else { | ||
}*/ | ||
|
||
let talkgroups = await load_talkgroups(shortName); | ||
|
||
res.contentType('json'); | ||
res.send(JSON.stringify({ | ||
talkgroups: talkgroups | ||
})); | ||
} | ||
|
||
|
||
exports.get_groups = async function (req, res) { | ||
const shortName = req.params.shortName.toLowerCase(); | ||
|
||
const grp_results = await Group.find({ shortName: req.params.shortName.toLowerCase() }).sort("position").catch(err => { | ||
console.error(err); | ||
res.status(500); | ||
res.json({ success: false, message: err }); | ||
return; | ||
}); | ||
|
||
res.contentType('json'); | ||
res.send(JSON.stringify(grp_results)); | ||
} |
Oops, something went wrong.