| import {Component, OnInit} from '@angular/core'; |
| import {TreeModel} from "ng2-tree"; |
| import { HttpClient } from '@angular/common/http'; |
| // Tabs Component |
| import { TabsModule } from 'ngx-bootstrap/tabs'; |
| import { TabsComponent } from '../base/tabs.component'; |
| |
| @Component({ |
| templateUrl: 'modeldesigner.component.html' |
| }) |
| export class ModelDesignerComponent implements OnInit { |
| constructor(private http: HttpClient) { |
| try { |
| this.http.get("core/cloud/stemprojects", {responseType: 'json'}).subscribe((data: any[]) => { |
| console.log("stemprojects", data); |
| this.stemprojects = { |
| settings: { |
| 'isCollapsedOnInit': true |
| }, |
| value: 'stemprojects', |
| children: data['subDirectories'] |
| }; |
| }); |
| } |
| catch (e) { |
| console.log(e) |
| } |
| |
| try { |
| this.http.get("core/cloud/graphs", {responseType: 'json'}).subscribe((data: any[])=>{ |
| console.log("graphs",data); |
| |
| this.graph = { |
| settings: { |
| 'isCollapsedOnInit':true |
| }, |
| value: 'graphs', |
| children: data['children'] |
| }; |
| }); |
| }catch (e) { |
| console.log(e) |
| } |
| try { |
| this.http.get("core/cloud/scenarios", {responseType: 'json'}).subscribe((data: any[]) => { |
| console.log("scenarios", data); |
| this.Scenarios = { |
| settings: { |
| 'isCollapsedOnInit': true |
| }, |
| value: 'Scenario', |
| children: data['children'] |
| }; |
| }); |
| } |
| catch (e) { |
| console.log(e) |
| } |
| |
| try { |
| this.http.get("core/cloud/models", {responseType: 'json'}).subscribe((data: any[])=>{ |
| console.log("models",data); |
| this.models = { |
| settings: { |
| 'isCollapsedOnInit':true |
| }, |
| value: 'models', |
| children: data['children'] |
| }; |
| }); |
| }catch (e) { |
| console.log(e) |
| } |
| try { |
| this.http.get("core/cloud/predicate", {responseType: 'json'}).subscribe((data: any[])=>{ |
| console.log("predicate",data); |
| |
| this.predicate = { |
| settings: { |
| 'isCollapsedOnInit':true |
| }, |
| value: 'predicate', |
| children: data['children'] |
| }; |
| }); |
| }catch (e) { |
| console.log(e) |
| } |
| try { |
| this.http.get("core/cloud/sequencer", {responseType: 'json'}).subscribe((data: any[]) => { |
| console.log("sequencer", data); |
| this.sequencer = { |
| settings: { |
| 'isCollapsedOnInit': true |
| }, |
| value: 'sequencer', |
| children: data['children'] |
| }; |
| }); |
| } |
| catch (e) { |
| console.log(e) |
| } |
| |
| try { |
| this.http.get("core/cloud/trigger", {responseType: 'json'}).subscribe((data: any[])=>{ |
| console.log("trigger",data); |
| this.triggers = { |
| settings: { |
| 'isCollapsedOnInit':true |
| }, |
| value: 'trigger', |
| children: data['children'] |
| }; |
| }); |
| }catch (e) { |
| console.log(e) |
| } |
| try { |
| this.http.get("core/cloud/experiments", {responseType: 'json'}).subscribe((data: any[])=>{ |
| console.log("trigger",data); |
| this.experiments = { |
| settings: { |
| 'isCollapsedOnInit':true |
| }, |
| value: 'experiments', |
| children: data['children'] |
| }; |
| }); |
| }catch (e) { |
| console.log(e) |
| } |
| |
| } |
| public stemprojects: TreeModel; |
| public Scenarios: TreeModel; |
| public models: TreeModel; |
| public graph: TreeModel; |
| public predicate: TreeModel; |
| public sequencer: TreeModel; |
| public triggers: TreeModel; |
| public experiments: TreeModel; |
| |
| ngOnInit(): void { |
| |
| |
| |
| } |
| } |