mirror of
https://github.com/openmhz/trunk-server.git
synced 2026-11-14 09:48:10 -05:00
show all systems
This commit is contained in:
@@ -33,7 +33,6 @@ exports.get_systems = function (req, res) {
|
|||||||
lastActive: results[result].lastActive,
|
lastActive: results[result].lastActive,
|
||||||
callAvg: results[result].callAvg,
|
callAvg: results[result].callAvg,
|
||||||
description: results[result].description,
|
description: results[result].description,
|
||||||
planType: results[result].planType,
|
|
||||||
clientCount: clientCount
|
clientCount: clientCount
|
||||||
}
|
}
|
||||||
if (results[result].showScreenName && results[result].userId) {
|
if (results[result].showScreenName && results[result].userId) {
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ var systemSchema = mongoose.Schema({
|
|||||||
callCount: Number,
|
callCount: Number,
|
||||||
ignoreUnknownTalkgroup : Boolean,
|
ignoreUnknownTalkgroup : Boolean,
|
||||||
active: {type: Boolean, default: false},
|
active: {type: Boolean, default: false},
|
||||||
|
lastActive: Date,
|
||||||
planType: {type: Number, default: 0},
|
planType: {type: Number, default: 0},
|
||||||
userId: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
userId: {type: mongoose.Schema.Types.ObjectId, ref: 'User'},
|
||||||
key: String
|
key: String
|
||||||
|
|||||||
@@ -25,15 +25,16 @@ import InternationList from "./InternationList";
|
|||||||
|
|
||||||
const ListSystems = (props) => {
|
const ListSystems = (props) => {
|
||||||
|
|
||||||
const { data: allSystems, isSuccess } = useGetSystemsQuery();
|
const { data: systems, isSuccess } = useGetSystemsQuery();
|
||||||
const systems = useSelector(selectActiveSystems)
|
//const systems = useSelector(selectActiveSystems)
|
||||||
const contextRef = useRef();
|
const contextRef = useRef();
|
||||||
|
|
||||||
// Sorts the systems by State and also creates an International Arry
|
// Sorts the systems by State and also creates an International Arry
|
||||||
let states = {};
|
let states = {};
|
||||||
let other = []
|
let other = []
|
||||||
for (var i = 0; i < systems.length; i++) {
|
if (isSuccess && systems.systems)
|
||||||
const system = systems[i];
|
for (var i = 0; i < systems.systems.length; i++) {
|
||||||
|
const system = systems.systems[i];
|
||||||
if (system.hasOwnProperty("state")) {
|
if (system.hasOwnProperty("state")) {
|
||||||
if (!states.hasOwnProperty(system.state)) {
|
if (!states.hasOwnProperty(system.state)) {
|
||||||
states[system.state] = [];
|
states[system.state] = [];
|
||||||
|
|||||||
Reference in New Issue
Block a user