You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dlab.apache.org by an...@apache.org on 2019/07/10 15:53:14 UTC

[incubator-dlab] 11/19: [DLAB-834]: added management-data.service

This is an automated email from the ASF dual-hosted git repository.

ankovalyshyn pushed a commit to branch feature/projects
in repository https://gitbox.apache.org/repos/asf/incubator-dlab.git

commit f906c63a6e1e25aada4b5136126877da0231598b
Author: Andriana Kovalyshyn <An...@epam.com>
AuthorDate: Tue Jul 9 13:24:48 2019 +0300

    [DLAB-834]: added management-data.service
---
 .../src/app/administration/management/index.ts     |  2 ++
 .../management/management-data.service.ts          | 42 ++++++++++++++++++++++
 2 files changed, 44 insertions(+)

diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts
index 8d03ac0..bb6e960 100644
--- a/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/index.ts
@@ -25,6 +25,7 @@ import { BubbleModule, ConfirmationDialogModule } from '../../shared';
 import { MaterialModule } from '../../shared/material.module';
 
 import { ManagementComponent } from './management.component';
+import { EnvironmentsDataService } from './management-data.service';
 import { ManagementGridComponent, ReconfirmationDialogComponent } from './management-grid/management-grid.component';
 import { ComputationalResourcesModule } from '../../resources/computational/computational-resources-list';
 
@@ -70,6 +71,7 @@ export * from './management.component';
     SsnMonitorComponent,
     EndpointsComponent,
     ManageEnvironmentComponent],
+  providers: [EnvironmentsDataService],
   exports: [ManagementComponent]
 })
 export class ManagenementModule { }
diff --git a/services/self-service/src/main/resources/webapp/src/app/administration/management/management-data.service.ts b/services/self-service/src/main/resources/webapp/src/app/administration/management/management-data.service.ts
new file mode 100644
index 0000000..090a253
--- /dev/null
+++ b/services/self-service/src/main/resources/webapp/src/app/administration/management/management-data.service.ts
@@ -0,0 +1,42 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import { Injectable } from '@angular/core';
+import { BehaviorSubject } from 'rxjs';
+
+import { ManageEnvironmentsService } from '../../core/services';
+
+@Injectable()
+export class EnvironmentsDataService {
+
+  _data = new BehaviorSubject<any>(null);
+
+  constructor(private manageEnvironmentsService: ManageEnvironmentsService) {
+    this.getAllEnvironmentData();
+  }
+
+  public updateEnvironmentData() {
+    this.getAllEnvironmentData();
+  }
+
+  private getAllEnvironmentData() {
+    this.manageEnvironmentsService.getAllEnvironmentData().subscribe(
+      (response) => this._data.next(response));
+  }
+}
\ No newline at end of file


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@dlab.apache.org
For additional commands, e-mail: commits-help@dlab.apache.org