New dashboard look & feel
[src/xds/xds-agent.git] / webapp / src / app / pages / sdks / sdk-card / sdk-card.component.ts
1 import { Component, Input, Pipe, PipeTransform } from '@angular/core';
2 import { SdkService, ISdk } from '../../../@core-xds/services/sdk.service';
3 import { AlertService } from '../../../@core-xds/services/alert.service';
4
5
6 @Component({
7   selector: 'xds-sdk-card',
8   styleUrls: ['./sdk-card.component.scss'],
9   templateUrl: './sdk-card.component.html',
10 })
11 export class SdkCardComponent {
12
13   // FIXME workaround of https://github.com/angular/angular-cli/issues/2034
14   // should be removed with angular 5
15   // @Input() sdk: ISdk;
16   @Input() sdk = <ISdk>null;
17
18   constructor(
19     private alert: AlertService,
20     private sdkSvr: SdkService
21   ) {
22   }
23
24   labelGet(sdk: ISdk) {
25     return sdk.profile + '-' + sdk.arch + '-' + sdk.version;
26   }
27
28   delete(sdk: ISdk) {
29     this.sdkSvr.delete(sdk).subscribe(
30       res => { },
31       err => this.alert.error('ERROR delete: ' + err)
32     );
33   }
34 }
35