Commit 161d854c authored by Łukasz Szymański's avatar Łukasz Szymański
Browse files

adding button to undeploy application

parent e59b6876
Pipeline #15209 passed with stage
in 5 minutes and 45 seconds
......@@ -71,6 +71,15 @@
</td>
</ng-container>
<ng-container matColumnDef="undeployApplication">
<th mat-header-cell *matHeaderCellDef>Undeploy Application</th>
<td mat-cell *matCellDef="let row">
<button mat-raised-button color="primary" (click)="onUndeployApplication(row)">
Undeploy
</button>
</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns"></tr>
<tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr>
</table>
......
......@@ -15,7 +15,7 @@ export class JobListComponent implements OnInit {
jobList: JobMelodic[];
data: MatTableDataSource<JobMelodic>;
displayedColumns: string[] = ['no', 'name', 'id', 'submittedJobId', 'submittedJobType', 'properties'];
displayedColumns: string[] = ['no', 'name', 'id', 'submittedJobId', 'submittedJobType', 'properties', 'undeployApplication'];
@ViewChild(MatPaginator) paginator: MatPaginator;
@ViewChild(MatSort) sort: MatSort;
......@@ -50,4 +50,14 @@ export class JobListComponent implements OnInit {
this.data.paginator.firstPage();
}
}
onUndeployApplication(job: JobMelodic) {
console.log(`Undeploying application name: ${job.name}, id: ${job.id} and submitted Job Id: ${job.submittedJobId} click`);
this.deploymentDetailsService.undeployApplication(job.id).subscribe(value => {
this.snackBar.open(`ProActive job undeployment state: ${value.state}`, 'Close');
},
error1 => {
this.snackBar.open(`Error by getting ProActive job undeployment state: ${error1.error.message}`, 'Close');
});
}
}
export class JobUndeploymentState {
state: string;
}
......@@ -9,6 +9,7 @@ import {QueueCloudiator} from '../model/queue-cloudiator';
import {JobMelodic} from '../model/job-melodic';
import {ScheduleCloudiator} from '../model/schedule-cloudiator';
import {MonitorProactive} from "../model/monitor-proactive";
import {JobUndeploymentState} from "../model/job-undeployment-state";
const httpOptions = {
headers: new HttpHeaders({'Content-Type': 'application/json'})
......@@ -71,4 +72,12 @@ export class DeploymentDetailsService {
e => console.log('Error by getting ProActive monitor list: ', e))
);
}
undeployApplication(applicationId: string): Observable<JobUndeploymentState> {
const requestUrl = `${this.apiUrl}/undeploy`;
return this.http.get(requestUrl, httpOptions).pipe(
tap((response: JobUndeploymentState) => console.log(`Response from ProActive job undeployment - state: ${response.state}`),
e => console.log('Error by getting ProActive job undeployment state: ', e))
);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment