1 /* Copyright (c) 2019 AT&T Intellectual Property. #
\r
3 # Licensed under the Apache License, Version 2.0 (the "License"); #
\r
4 # you may not use this file except in compliance with the License. #
\r
5 # You may obtain a copy of the License at #
\r
7 # http://www.apache.org/licenses/LICENSE-2.0 #
\r
9 # Unless required by applicable law or agreed to in writing, software #
\r
10 # distributed under the License is distributed on an "AS IS" BASIS, #
\r
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
\r
12 # See the License for the specific language governing permissions and #
\r
13 # limitations under the License. #
\r
14 ##############################################################################*/
\r
17 import { Component, OnInit } from '@angular/core';
\r
18 import {ActivatedRoute} from "@angular/router";
\r
19 import {TestHead} from "app/shared/models/test-head.model";
\r
20 import {TestHeadService} from "app/shared/services/test-head.service";
\r
21 import { Subscription } from 'rxjs';
\r
22 import { StatsService } from 'app/layout/components/stats/stats.service';
\r
26 selector: 'app-virtual-test-head-details',
\r
27 templateUrl: './virtual-test-head-details.component.pug',
\r
28 styleUrls: ['./virtual-test-head-details.component.scss']
\r
30 export class VirtualTestHeadDetailsComponent implements OnInit {
\r
32 private toDestroy : Array<Subscription> = [];
\r
33 testHead : TestHead;
\r
34 public totalExecutions;
\r
36 private route: ActivatedRoute,
\r
37 private testHeadService : TestHeadService,
\r
38 public stats: StatsService
\r
42 this.toDestroy.push(this.route.params.subscribe(param => {
\r
44 this.toDestroy.push(this.testHeadService.get(param.id).subscribe(res => {
\r
45 this.testHead = res as TestHead;
\r
51 this.getData(param.id);
\r
58 this.toDestroy.forEach(e => {
\r
63 getData(testHeadId?){
\r
65 testHeadId = this.testHead._id
\r
72 this.stats.getDefaultData(1, {
\r
73 'testHeadResults.testHeadId': testHeadId,
\r
77 "historicTestDefinition._id",
\r
78 "historicTestDefinition.testName",
\r
79 "historicTestInstance._id",
\r
80 "historicTestInstance.testInstanceName",
\r
81 "testHeadResults.startTime",
\r
82 "testHeadResults.endTime",
\r
83 "testHeadResults.testHeadName",
\r
84 "testHeadResults.testHeadId",
\r
85 "testHeadResults.testHeadGroupId",
\r
86 "testHeadResults.statusCode",
\r
94 $gte: this.stats.filters.startDate,
\r
95 $lte: this.stats.filters.endDate
\r
101 setTotalExecutions(event){
\r
102 this.totalExecutions = event;
\r