Added Grafana url setting in config panel
[src/xds/xds-agent.git] / webapp / src / app / pages / config / config-global / config-global.component.ts
index dc8af4f..35d1e17 100644 (file)
@@ -1,6 +1,6 @@
 /**
 * @license
-* Copyright (C) 2017 "IoT.bzh"
+* Copyright (C) 2017-2018 "IoT.bzh"
 * Author Sebastien Douheret <sebastien@iot.bzh>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -28,6 +28,7 @@ import { ConfigService, IConfig } from '../../../@core-xds/services/config.servi
 export class ConfigGlobalComponent implements OnInit {
 
   public configFormChanged = false;
+  public Config: IConfig = <IConfig>{};
 
   constructor(
     private configSvr: ConfigService,
@@ -35,9 +36,12 @@ export class ConfigGlobalComponent implements OnInit {
   }
 
   ngOnInit() {
+    this.configSvr.Conf$.subscribe(cfg => this.Config = cfg);
   }
 
   onSubmit() {
+    this.configSvr.save(this.Config);
+    this.configFormChanged = false;
   }
 }