1 import { Component, OnInit, Input } from "@angular/core";
2 import { Observable } from 'rxjs';
3 import { FormControl, FormGroup, Validators, FormBuilder } from '@angular/forms';
5 import 'rxjs/add/operator/scan';
6 import 'rxjs/add/operator/startWith';
8 import { XDSAgentService, IXDSDeploy } from "../../services/xdsagent.service";
9 import { ConfigService, IConfig, IProject } from "../../services/config.service";
10 import { AlertService, IAlert } from "../../services/alert.service";
11 import { SdkService } from "../../services/sdk.service";
14 selector: 'panel-deploy',
16 templateUrl: './deploy.component.html',
17 styleUrls: ['./deploy.component.css']
20 export class DeployComponent implements OnInit {
22 @Input() curProject: IProject;
25 deployForm: FormGroup;
27 constructor(private configSvr: ConfigService,
28 private xdsAgent: XDSAgentService,
29 private fb: FormBuilder,
30 private alert: AlertService,
32 this.deployForm = fb.group({
33 boardIP: ["", Validators.nullValidator],
34 wgtFile: ["", Validators.nullValidator],
39 this.deploying = false;
40 if (this.curProject && this.curProject.pathClient) {
41 this.deployForm.patchValue({ wgtFile: this.curProject.pathClient });
46 this.deploying = true;
50 boardIP: this.deployForm.value.boardIP,
51 file: this.deployForm.value.wgtFile
54 this.deploying = false;
56 this.deploying = false;
57 let msg = '<span>ERROR while deploying "' + this.deployForm.value.wgtFile + '"<br>';
60 this.alert.error(msg);