Compare commits
2 commits
f2b325c8a4
...
fc34e3b1d9
Author | SHA1 | Date | |
---|---|---|---|
fc34e3b1d9 | |||
7af1dd1720 |
4 changed files with 18 additions and 5 deletions
|
@ -29,6 +29,10 @@ export interface System {
|
||||||
name: string;
|
name: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface Metadata {
|
||||||
|
encrypted: boolean|null;
|
||||||
|
}
|
||||||
|
|
||||||
export interface Talkgroup {
|
export interface Talkgroup {
|
||||||
id: number;
|
id: number;
|
||||||
system_id: number;
|
system_id: number;
|
||||||
|
@ -37,7 +41,7 @@ export interface Talkgroup {
|
||||||
alpha_tag: string;
|
alpha_tag: string;
|
||||||
tg_group: string;
|
tg_group: string;
|
||||||
frequency: number;
|
frequency: number;
|
||||||
metadata: Object;
|
metadata: Metadata|null;
|
||||||
tags: string[];
|
tags: string[];
|
||||||
alert: boolean;
|
alert: boolean;
|
||||||
alert_config: AlertRule[];
|
alert_config: AlertRule[];
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
placeholder="Paste RadioReference page here"
|
placeholder="Paste RadioReference page here"
|
||||||
formControlName="contents"
|
formControlName="contents"
|
||||||
></textarea>
|
></textarea>
|
||||||
|
<input type="number" class="input input-bordered" formControlName="systemID" id="systemID" />
|
||||||
<input type="submit" class="btn btn-secondary" value="Save" />
|
<input type="submit" class="btn btn-secondary" value="Save" />
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
@ -16,8 +17,11 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th>Sys</th>
|
<th>Sys</th>
|
||||||
<th>Sys ID</th>
|
<th>Sys ID</th>
|
||||||
|
<th>Group</th>
|
||||||
|
<th>Alpha</th>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>TG ID</th>
|
<th>TG ID</th>
|
||||||
|
<th>Enc</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
@ -26,8 +30,11 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ tg.system.name }}</td>
|
<td>{{ tg.system.name }}</td>
|
||||||
<td>{{ tg.system.id }}</td>
|
<td>{{ tg.system.id }}</td>
|
||||||
|
<td>{{ tg.tg_group }}</td>
|
||||||
|
<td>{{ tg.alpha_tag }}</td>
|
||||||
<td>{{ tg.name }}</td>
|
<td>{{ tg.name }}</td>
|
||||||
<td>{{ tg.tgid }}</td>
|
<td>{{ tg.tgid }}</td>
|
||||||
|
<td>{{ tg?.metadata?.encrypted ? 'E' : '' }}</td>
|
||||||
</tr>
|
</tr>
|
||||||
}
|
}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
@ -26,11 +26,13 @@ export class ImportComponent {
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.form = new FormGroup({
|
this.form = new FormGroup({
|
||||||
contents: new FormControl(''),
|
contents: new FormControl(''),
|
||||||
|
systemID: new FormControl(0),
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
submit() {
|
submit() {
|
||||||
let content = this.form.controls['contents'].value;
|
let content = this.form.controls['contents'].value;
|
||||||
this.tgService.importRR(content)
|
let sysID = Number(this.form.controls['systemID'].value);
|
||||||
|
this.tgService.importRR(sysID, content)
|
||||||
.pipe(
|
.pipe(
|
||||||
catchError(() => {
|
catchError(() => {
|
||||||
return of(null);
|
return of(null);
|
||||||
|
|
|
@ -18,9 +18,9 @@ export class TalkgroupService {
|
||||||
return this.http.get<Talkgroup>(`/api/talkgroup/${sys}/${tg}`);
|
return this.http.get<Talkgroup>(`/api/talkgroup/${sys}/${tg}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
importRR(content: string): Observable<Talkgroup[]> {
|
importRR(sysID: number, content: string): Observable<Talkgroup[]> {
|
||||||
return this.http.put<Talkgroup[]>('/api/talkgroup/import',
|
return this.http.post<Talkgroup[]>('/api/talkgroup/import',
|
||||||
{type: 'radioreference', body: content});
|
{systemID: sysID, type: 'radioreference', body: content});
|
||||||
}
|
}
|
||||||
|
|
||||||
putTalkgroup(tu: TalkgroupUpdate): Observable<Talkgroup> {
|
putTalkgroup(tu: TalkgroupUpdate): Observable<Talkgroup> {
|
||||||
|
|
Loading…
Reference in a new issue