Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix CVE–2022–31129 #113

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18,872 changes: 18,824 additions & 48 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -40,7 +40,7 @@
"guid-typescript": "^1.0.9",
"jwt-decode": "^2.2.0",
"leaflet": "^1.7.1",
"moment": "^2.27.0",
"moment": "^2.29.4",
"ng": "0.0.0",
"ng-inline-svg": "^11.0.0",
"ngx-monaco-editor": "^9.0.0",
Expand Down
7 changes: 7 additions & 0 deletions src/app/network-server/adr-algorithm.model.ts
@@ -0,0 +1,7 @@
export class AdrAlgorithm {
public id: string;
public name: string;
}
export interface AdrAlgorithmResponse {
adrAlgorithms: AdrAlgorithm[];
}
20 changes: 20 additions & 0 deletions src/app/network-server/network-server.service.ts
@@ -0,0 +1,20 @@
import { Injectable } from '@angular/core';
import { RestService } from '@shared/services/rest.service';
import { Observable } from 'rxjs';
import { AdrAlgorithmResponse } from '@app/network-server/adr-algorithm.model';


@Injectable({
providedIn: 'root'
})
export class NetworkServerService {
URL = 'chirpstack/network-server';

constructor(
private restService: RestService) {}


getAllAdrAlgorithms(): Observable<AdrAlgorithmResponse> {
return this.restService.get(`${this.URL}/adr-algorithms`, {});
}
}
1 change: 1 addition & 0 deletions src/app/profiles/device-profiles/device-profile.model.ts
Expand Up @@ -3,6 +3,7 @@ import { EditPermission } from '@shared/models/edit-permission.model';
export class DeviceProfile extends EditPermission {
public id: string;
public name: string;
public adrAlgorithmID = 'default';
public classBTimeout = 0;
public classCTimeout = 0;
public factoryPresetFreqs: number[];
Expand Down
Expand Up @@ -67,6 +67,18 @@ <h3>{{ 'PROFILES.DEVICE_PROFILE.DETAILS' | translate }}</h3>
</mat-select>
</mat-form-field>
</div>

<div class="col-xs-12 form-group">
<label
class="form-label asterisk-if-mandatory">{{ 'PROFILES.DEVICE_PROFILE.ADRALGORITHM' | translate }}</label>
<mat-form-field appearance="outline">
<mat-select matNativeControl required name="adrAlgorithmID" [disabled]="!deviceProfile.canEdit"
[(value)]="deviceProfile.adrAlgorithmID" [compareWith]="compare">
<mat-option *ngFor="let adr of adrAlgorithms" [value]="adr.id">{{ adr.name }}</mat-option>
</mat-select>
</mat-form-field>
</div>

<div class="col-xs-12 form-group">
<label for="maxEIRP"
class="form-label asterisk-if-mandatory">{{'PROFILES.DEVICE_PROFILE.MAXEIRP' | translate}}</label>
Expand Down
Expand Up @@ -10,6 +10,8 @@ import { Subscription } from 'rxjs';
import { DeviceProfile } from '../device-profile.model';
import { DeviceProfileService } from '../device-profile.service';
import { OrganizationAccessScope } from '@shared/enums/access-scopes';
import { AdrAlgorithm, AdrAlgorithmResponse } from '@app/network-server/adr-algorithm.model';
import { NetworkServerService } from '@app/network-server/network-server.service';

@Component({
selector: 'app-device-profiles-edit',
Expand All @@ -27,14 +29,16 @@ export class DeviceProfilesEditComponent implements OnInit, OnDestroy {
public formFailedSubmit = false;
public title = '';
public backButton: BackButton = { label: '', routerLink: '/profiles' };
public adrAlgorithms: AdrAlgorithm[] = [];

constructor(
private route: ActivatedRoute,
private translate: TranslateService,
private deviceProfileService: DeviceProfileService,
private location: Location,
private meService: MeService,
private errorMessageService: ErrorMessageService
private errorMessageService: ErrorMessageService,
private networkServerService: NetworkServerService
) { }

ngOnInit(): void {
Expand All @@ -44,6 +48,12 @@ export class DeviceProfilesEditComponent implements OnInit, OnDestroy {
this.backButton.label = translations['PROFILES.NAME'];
});

this.networkServerService.getAllAdrAlgorithms()
.subscribe(
response => {
this.adrAlgorithms = response.adrAlgorithms;
});

this.id = this.route.snapshot.paramMap.get('deviceId');
if (this.id) {
this.getDeviceProfile(this.id);
Expand Down
1 change: 1 addition & 0 deletions src/assets/i18n/da.json
Expand Up @@ -896,6 +896,7 @@
"NAME": "Device profil navn",
"NAME_PLACEHOLDER": "Device profil navn",
"MACVERSION": "LoRaWAN MAC version ",
"ADRALGORITHM": "ADR algoritme ",
"REGPARAMSREVISION": "LoRaWAN regional parameters revision ",
"MAXEIRP": "Max EIRP ",
"GEOLOCBUFFERTTL": "Geolocation buffer TTL (seconds)",
Expand Down