You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.4 KiB
35 lines
1.4 KiB
import { Component, OnInit } from '@angular/core';
|
|
import { GlobalSettings, GlobalSettingsService } from '../global-settings.service';
|
|
|
|
@Component({
|
|
selector: 'app-global-settings',
|
|
templateUrl: './global-settings.component.html',
|
|
styleUrls: ['./global-settings.component.css']
|
|
})
|
|
export class GlobalSettingsComponent implements OnInit {
|
|
|
|
tempSettings = new GlobalSettings();
|
|
displaySettings;
|
|
|
|
updateGlobalSettings() {
|
|
this.tempSettings.secretRegistrationCode = this.displaySettings.secretRegistrationCode;
|
|
this.tempSettings.webTemplatePrefix = this.displaySettings.webTemplatePrefix;
|
|
this.tempSettings.webTemplateRoute = this.displaySettings.webTemplateRoute;
|
|
this.tempSettings.threadsPerCampaign = parseInt(this.displaySettings.threadsPerCampaign, 10) + 0;
|
|
this.tempSettings.bcryptCost = parseInt(this.displaySettings.bcryptCost, 10);
|
|
this.tempSettings.maxRequestRetries = parseInt(this.displaySettings.maxRequestRetries, 10);
|
|
this.tempSettings.waitBeforeRetry = parseInt(this.displaySettings.waitBeforeRetry, 10);
|
|
|
|
this.globalSettingsService.updateGlobalSettings(this.tempSettings);
|
|
}
|
|
|
|
constructor(private globalSettingsService: GlobalSettingsService) { }
|
|
|
|
ngOnInit() {
|
|
this.globalSettingsService.getGlobalSettingsObs().subscribe(settings => {
|
|
console.log(settings);
|
|
this.displaySettings = settings;
|
|
});
|
|
}
|
|
|
|
}
|