Skip to content
This repository has been archived by the owner on Apr 10, 2024. It is now read-only.

Commit

Permalink
dps UI catch more cases where no jobs to view, address some UI feedba…
Browse files Browse the repository at this point in the history
…ck from ticket #65
  • Loading branch information
echyam committed Aug 18, 2020
1 parent 7903f1c commit d36d12f
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 13 deletions.
21 changes: 15 additions & 6 deletions dps_info/src/jobinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,16 @@ export class JobTable extends Widget {
// --------------------
// set description from response
let disp = '';
if (this._job_id !== undefined || this._job_id !== ''){
if (Object.keys(DISPLAYS).length === 0){
disp = 'No job history.'
} else if (this._job_id === undefined || this._job_id === ''){
disp = 'Job ID not selected.';
} else {
disp = DISPLAYS[this._job_id];
console.log(disp);
// console.log(disp);
}

console.log(disp);
if (document.getElementById('job-detail-display') != null) {
// console.log(this._job_id);
(document.getElementById('job-detail-display') as HTMLDivElement).innerHTML = disp;
Expand Down Expand Up @@ -162,6 +167,8 @@ export class JobTable extends Widget {
}
me._updateJobTable(me);
me._setRowClick('job-cache-display', function(){me._updateJobDisplay()});
} else {
me._updateJobTable(me);
}
} else {
console.log('unable to get user job list');
Expand Down Expand Up @@ -749,6 +756,7 @@ export class JobWidget extends Widget {
let executeCell = rrow.insertCell();
executeCell.setAttribute('id','cell-execute');
executeCell.setAttribute('valign','top');
executeCell.setAttribute('style','max-width:475px');

let overviewCell = rrow.insertCell();
overviewCell.setAttribute('id','cell-overview');
Expand Down Expand Up @@ -1063,20 +1071,19 @@ export class JobWidget extends Widget {
let infoCell = rrow.insertCell();
infoCell.setAttribute('id','cell-jobinfo');
infoCell.setAttribute('valign','top');
infoCell.setAttribute('style','min-width:360px');
infoCell.setAttribute('style','min-width:360px; max-width:475px');

let resultsCell = rrow.insertCell();
resultsCell.setAttribute('id','cell-jobresults');
resultsCell.setAttribute('valign','top');
resultsCell.setAttribute('style','min-width:360px');
resultsCell.setAttribute('style','min-width:360px; max-width:475px');

// rrow = infoTable.insertRow() as HTMLTableRowElement;

let metricsCell = rrow.insertCell();
metricsCell.setAttribute('id','cell-jobmetrics');
metricsCell.setAttribute('valign','top');
metricsCell.setAttribute('style','min-width:720px');
metricsCell.setAttribute('colspan','2');
metricsCell.setAttribute('style','min-width:360px');

infoDiv.appendChild(infoTable);
this._widget_div.appendChild(infoDiv);
Expand Down Expand Up @@ -1144,6 +1151,8 @@ export class JobWidget extends Widget {
}
me._updateJobTable(me);
me._setJobClick('widget-job-table', function(){me._updateJobInfo()})
} else {
me._updateJobTable(me);
}
} else {
console.log('unable to get user job list');
Expand Down
15 changes: 8 additions & 7 deletions submit_jobs/submit_jobs/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1363,17 +1363,18 @@ def get(self):
table += '<col width=33%>'
table += '<col width=33%>'
table += '<col width=33%>'
table += '<thead><tr>'
table += '<th>Job Id</th>'
table += '<th>Status</th>'
table += '<th>Algorithm</th>'
table += '</tr></thead>'
table += '<tbody>'

if len(jobs) == 0:
table += 'No jobs found for user.'
table += '<tbody>'
table += '<tr><td colspan="3">No jobs found for user.</td></tr>'

else:
table += '<thead><tr>'
table += '<th>Job Id</th>'
table += '<th>Status</th>'
table += '<th>Algorithm</th>'
table += '</tr></thead>'
table += '<tbody>'
for job in jobs:
job['detailed'] = detailed_display(job)
table += '<tr><td><u>{}</u></td><td>{}</td><td>{}</td></tr>'.format(job['job_id'],job['status'],job['algo_id'])
Expand Down

0 comments on commit d36d12f

Please sign in to comment.