mirror of
https://github.com/chuot/rdio-scanner.git
synced 2026-08-13 16:33:01 -06:00
Version 4.7.1
This commit is contained in:
parent
9ec483a531
commit
f63111f2ab
2
client/package-lock.json
generated
2
client/package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rdio-scanner-client",
|
"name": "rdio-scanner-client",
|
||||||
"version": "4.7.0",
|
"version": "4.7.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,5 @@
|
||||||
"build": "ng build --base-href ./ --prod",
|
"build": "ng build --base-href ./ --prod",
|
||||||
"start": "ng serve"
|
"start": "ng serve"
|
||||||
},
|
},
|
||||||
"version": "4.7.0"
|
"version": "4.7.1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -682,7 +682,7 @@ export class AppRdioScannerService implements OnDestroy {
|
||||||
|
|
||||||
this.websocket.onclose = (ev: CloseEvent) => {
|
this.websocket.onclose = (ev: CloseEvent) => {
|
||||||
if (ev.code !== 1000) {
|
if (ev.code !== 1000) {
|
||||||
this.reconnectWebsocket();
|
timer(2000).subscribe(() => this.reconnectWebsocket());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -815,13 +815,13 @@ export class AppRdioScannerService implements OnDestroy {
|
||||||
|
|
||||||
private rebuildGroups(): void {
|
private rebuildGroups(): void {
|
||||||
this.groups = Object.keys(this.config.groups || []).map((label) => {
|
this.groups = Object.keys(this.config.groups || []).map((label) => {
|
||||||
const allOff = Object.keys(this.config.groups[label])
|
const allOff = Object.keys(this.config.groups[label]).map((sys) => +sys)
|
||||||
.map((sys) => +sys)
|
.every((sys: number) => this.config.groups[label] && this.config.groups[label][sys]
|
||||||
.every((sys: number) => this.config.groups[label][sys].every((tg) => !this.livefeedMap[sys][tg]));
|
.every((tg) => !this.livefeedMap[sys][tg]));
|
||||||
|
|
||||||
const allOn = Object.keys(this.config.groups[label])
|
const allOn = Object.keys(this.config.groups[label]).map((sys) => +sys)
|
||||||
.map((sys) => +sys)
|
.every((sys: number) => this.config.groups[label] && this.config.groups[label][sys]
|
||||||
.every((sys: number) => this.config.groups[label][sys].every((tg) => this.livefeedMap[sys][tg]));
|
.every((tg) => this.livefeedMap[sys][tg]));
|
||||||
|
|
||||||
const status = allOff ? RdioScannerGroupStatus.Off : allOn ? RdioScannerGroupStatus.On : RdioScannerGroupStatus.Partial;
|
const status = allOff ? RdioScannerGroupStatus.Off : allOn ? RdioScannerGroupStatus.On : RdioScannerGroupStatus.Partial;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,5 +11,5 @@
|
||||||
"start": "node run",
|
"start": "node run",
|
||||||
"update": "node update"
|
"update": "node update"
|
||||||
},
|
},
|
||||||
"version": "4.7.0"
|
"version": "4.7.1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -294,12 +294,39 @@ class Controller extends EventEmitter {
|
||||||
|
|
||||||
async getConfig(scope) {
|
async getConfig(scope) {
|
||||||
return Object.assign({}, this.getOptions(), {
|
return Object.assign({}, this.getOptions(), {
|
||||||
groups: this.groups,
|
groups: this.getGroups(scope),
|
||||||
systems: await this.getSystems(scope),
|
systems: await this.getSystems(scope),
|
||||||
tags: this.tags,
|
tags: this.getTags(scope),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getGroups(scope = {}) {
|
||||||
|
if (scope !== null && typeof scope === 'object') {
|
||||||
|
return Object.keys(this.groups).reduce((groups, group) => {
|
||||||
|
Object.keys(this.groups[group]).forEach((system) => {
|
||||||
|
if (Object.keys(scope).includes(system)) {
|
||||||
|
const talkgroups = this.groups[group][system]
|
||||||
|
.filter((talkgroup) => scope[system].includes(talkgroup));
|
||||||
|
|
||||||
|
if (talkgroups.length) {
|
||||||
|
if (!groups[group]) {
|
||||||
|
groups[group] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
groups[group][system] = talkgroups;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return groups;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return this.groups;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
getOptions() {
|
getOptions() {
|
||||||
const options = this.config.options;
|
const options = this.config.options;
|
||||||
|
|
||||||
|
|
@ -414,6 +441,33 @@ class Controller extends EventEmitter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getTags(scope = {}) {
|
||||||
|
if (scope !== null && typeof scope === 'object') {
|
||||||
|
return Object.keys(this.tags).reduce((tags, tag) => {
|
||||||
|
Object.keys(this.tags[tag]).forEach((system) => {
|
||||||
|
if (Object.keys(scope).includes(system)) {
|
||||||
|
const talkgroups = this.tags[tag][system]
|
||||||
|
.filter((talkgroup) => scope[system].includes(talkgroup));
|
||||||
|
|
||||||
|
if (talkgroups.length) {
|
||||||
|
if (!tags[tag]) {
|
||||||
|
tags[tag] = {};
|
||||||
|
}
|
||||||
|
|
||||||
|
tags[tag][system] = talkgroups;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
return tags;
|
||||||
|
}, {});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
return this.tags;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async importCall(call = {}) {
|
async importCall(call = {}) {
|
||||||
const system = this.config.systems.find((sys) => sys.id === call.system);
|
const system = this.config.systems.find((sys) => sys.id === call.system);
|
||||||
|
|
||||||
|
|
|
||||||
2
server/package-lock.json
generated
2
server/package-lock.json
generated
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "rdio-scanner-server",
|
"name": "rdio-scanner-server",
|
||||||
"version": "4.7.0",
|
"version": "4.7.1",
|
||||||
"lockfileVersion": 1,
|
"lockfileVersion": 1,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|
|
||||||
|
|
@ -39,5 +39,5 @@
|
||||||
"build": "webpack",
|
"build": "webpack",
|
||||||
"start": "nodemon"
|
"start": "nodemon"
|
||||||
},
|
},
|
||||||
"version": "4.7.0"
|
"version": "4.7.1"
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue