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.
Ombi/src/Ombi/ClientApp/app/settings/customization/customization.component.ts

45 lines
1.4 KiB

import { Component, OnInit } from "@angular/core";
import { ICustomizationSettings } from "../../interfaces";
import { NotificationService } from "../../services";
import { SettingsService } from "../../services";
@Component({
templateUrl: "./customization.component.html",
})
export class CustomizationComponent implements OnInit {
public settings: ICustomizationSettings;
public advanced: boolean;
constructor(private settingsService: SettingsService, private notificationService: NotificationService) { }
public ngOnInit() {
this.settingsService.getCustomization().subscribe(x => {
this.settings = x;
});
}
public save() {
this.settingsService.verifyUrl(this.settings.applicationUrl).subscribe(x => {
if (this.settings.applicationUrl) {
if (!x) {
this.notificationService.error(`The URL "${this.settings.applicationUrl}" is not valid. Please format it correctly e.g. http://www.google.com/`);
return;
}
}
this.settingsService.saveCustomization(this.settings).subscribe(x => {
if (x) {
this.notificationService.success("Successfully saved Ombi settings");
} else {
this.notificationService.success("There was an error when saving the Ombi settings");
}
});
});
}
}