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