Skip to content
Snippets Groups Projects
Commit 42093de4 authored by Chris Hines's avatar Chris Hines
Browse files

update for job display to include extra info

parent 9efc4f0a
No related branches found
No related tags found
No related merge requests found
...@@ -67,6 +67,7 @@ import { ModaldialogComponent } from './modaldialog/modaldialog.component' ...@@ -67,6 +67,7 @@ import { ModaldialogComponent } from './modaldialog/modaldialog.component'
Sv2SideNavComponent, Sv2SideNavComponent,
ShareconnectComponent, ShareconnectComponent,
LaunchDialogComponent, LaunchDialogComponent,
ModaldialogComponent
], ],
imports: [ imports: [
BrowserModule, BrowserModule,
...@@ -95,7 +96,7 @@ import { ModaldialogComponent } from './modaldialog/modaldialog.component' ...@@ -95,7 +96,7 @@ import { ModaldialogComponent } from './modaldialog/modaldialog.component'
], ],
entryComponents: [ LogoutdialogComponent, LaunchDialogComponent ], entryComponents: [ LogoutdialogComponent, LaunchDialogComponent, ModaldialogComponent],
providers: [ StrudelappsService, ComputesitesService, TesService, SubmitAppService, MatDialog, AuthorisationService], providers: [ StrudelappsService, ComputesitesService, TesService, SubmitAppService, MatDialog, AuthorisationService],
bootstrap: [AppComponent] bootstrap: [AppComponent]
}) })
......
...@@ -7,7 +7,9 @@ export class Job { ...@@ -7,7 +7,9 @@ export class Job {
public jobid: string; public jobid: string;
public desc: string; public desc: string;
public state: string; public state: string;
public time: number; public endtime: string;
public mem: string;
public cpus: string;
public batch_host: string; public batch_host: string;
public identity: Identity; public identity: Identity;
public app: Strudelapp; public app: Strudelapp;
......
<mat-card> <mat-card>
<mat-card-title>{{ jobdata.name }}</mat-card-title> <mat-card-title>{{ jobdata.name }}</mat-card-title>
<div *ngIf="(jobdata.connectionState === undefined || jobdata.connectionState == 0)"> <div *ngIf="(jobdata.connectionState === undefined || jobdata.connectionState == 0)">
<table> <div gdAreas="name name name name|
status resources space buttons"
gdColumns="20% 60% auto 20%">
<div gdArea="name">
{{ jobdata.desc }}
</div>
<div gdArea="status">
{{ jobdata.state }}
</div>
<div gdArea="buttons">
<div fxLayout="row">
<div fxFlex *ngIf="!nocancel">
<button mat-button (click)="onCancel()" >
Cancel
</button>
</div>
<div fxFlex *ngIf="available">
<button mat-button (click)="onConnect()" [disabled]="busy">
Connect
</button>
</div>
</div>
</div>
<div gdArea="resources">
<div fxLayout="column">
<div>
{{ resources }}
</div>
<div>
{{ timeremaining }}
</div>
</div>
</div>
</div>
<!-- <table>
<tr> <tr>
<td width="1000%"> <td width="100%">
{{ jobdata.desc }} {{ jobdata.desc }}
</td> </td>
<td width="20%"> <td width="20%">
...@@ -24,7 +59,7 @@ ...@@ -24,7 +59,7 @@
</div> </div>
</td> </td>
</tr> </tr>
</table> </table> -->
</div> </div>
<div *ngIf="jobdata.connectionState == 1"> <div *ngIf="jobdata.connectionState == 1">
Getting app parameters Getting app parameters
......
...@@ -14,6 +14,8 @@ export class JobComponent implements OnInit { ...@@ -14,6 +14,8 @@ export class JobComponent implements OnInit {
public available: Boolean; public available: Boolean;
private busy: Boolean; private busy: Boolean;
public nocancel: Boolean; public nocancel: Boolean;
public resources: string;
public timeremaining: string;
constructor(private tesService: TesService, private strudelAppsService: StrudelappsService) { constructor(private tesService: TesService, private strudelAppsService: StrudelappsService) {
...@@ -35,7 +37,29 @@ export class JobComponent implements OnInit { ...@@ -35,7 +37,29 @@ export class JobComponent implements OnInit {
} else { } else {
this.nocancel = false; this.nocancel = false;
} }
this.resources="";
if (this.jobdata.cpus != undefined) {
this.resources = this.resources+"CPUs: "+this.jobdata.cpus;
}
if (this.jobdata.mem != undefined) {
this.resources = this.resources+" Mem: "+this.jobdata.mem;
}
if (this.jobdata.endtime != undefined) {
let end = Date.parse(this.jobdata.endtime);
let remaining = end.valueOf() - Date.now().valueOf();
this.timeremaining = "Time remaining: "+this.secondsToHms(remaining/1000);
}
}
secondsToHms(d: number) {
var h: number = Math.floor(d / 3600);
var m: number = Math.floor(d % 3600 / 60);
var s: number = Math.floor(d % 3600 % 60);
var hDisplay = h > 0 ? h + (h == 1 ? " hour, " : " hours, ") : "";
var mDisplay = m > 0 ? m + (m == 1 ? " minute, " : " minutes ") : "";
return hDisplay + mDisplay ;
} }
onCancel() { onCancel() {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment