Commit ed156508 authored by Marta Różańska's avatar Marta Różańska
Browse files

Merge branch 'undeploy_button' into 'morphemic-rc1.5'

adding Undeploy button

See merge request !15
parents e59b6876 e0a5787d
Pipeline #16204 passed with stages
in 6 minutes and 14 seconds
......@@ -24,6 +24,7 @@ build-ui-docker:
- morphemic-rc1.5
- feature-byon-proactive-support
- feature-mor-20-dev
- undeploy_button
image: docker:19.03.1
services:
- docker:19.03.1-dind
......
......@@ -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.post(requestUrl, {applicationId}, 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