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

Commit

Permalink
add underline to clickable texts, set default display text for jobs l…
Browse files Browse the repository at this point in the history
…ist if no job history yet
  • Loading branch information
echyam committed Aug 13, 2020
1 parent 4ad4a90 commit 7903f1c
Show file tree
Hide file tree
Showing 2 changed files with 1,355 additions and 1,341 deletions.
29 changes: 17 additions & 12 deletions dps_info/src/jobinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,20 +76,23 @@ export class JobTable extends Widget {
let disp = '';
if (this._job_id !== undefined || this._job_id !== ''){
disp = DISPLAYS[this._job_id];
console.log(disp);
}

if (document.getElementById('job-detail-display') != null) {
// console.log(this._job_id);
(document.getElementById('job-detail-display') as HTMLTextAreaElement).innerHTML = disp;
(document.getElementById('job-detail-display') as HTMLDivElement).innerHTML = disp;
} else {
// create textarea if it doesn't already exist
// detailed info on one job
let display:HTMLTextAreaElement = document.createElement("textarea");
// <div contenteditable="true"></div>
let display:HTMLDivElement = document.createElement("div");
display.id = 'job-detail-display';
display.readOnly = true;
display.cols = 30;
// display.readOnly = true;
// display.cols = 30;
display.innerHTML = disp;
display.setAttribute('style', 'margin: 0px; height:17%; width: 98%; border: none; resize: none');
// display.setAttribute('contenteditable', 'true');
display.setAttribute('style', 'margin: 0px; height:17%; width: 105%; border: none; resize: none; font-size: 11px;');
display.className = 'jp-JSONEditor-host';
div2.appendChild(display);
}
Expand Down Expand Up @@ -146,7 +149,7 @@ export class JobTable extends Widget {
// console.log(json_response);
if (json_response['status_code'] === 200){
// let resp = json_response['result'];
me._table = json_response['result'];
me._table = json_response['results'];
JOBS = json_response['jobs'];
DISPLAYS = json_response['displays'];

Expand Down Expand Up @@ -292,7 +295,8 @@ export class JobTable extends Widget {

if (json_response['status_code'] === 200) {
INotification.success("Get user job metrics success.");
this._results = json_response['results'];
this._metrics = json_response['results'];
console.log(this._metrics);
} else {
console.log('get user job result != 200');
INotification.error("Get user job metrics failed.");
Expand Down Expand Up @@ -324,7 +328,7 @@ export class JobTable extends Widget {
_setRowClick(tableId:string, setDisplays:any) {
let me = this;
onRowClick(tableId, function(row:HTMLTableRowElement){
let job_id = row.getElementsByTagName('td')[0].innerHTML;
let job_id = row.getElementsByTagName('td')[0].innerText;
console.log('set new job id '+job_id);
me._job_id = job_id;
setDisplays(me);
Expand Down Expand Up @@ -444,7 +448,7 @@ export class JobWidget extends Widget {
// new table row per algo
let arow:HTMLTableRowElement = algoList.insertRow() as HTMLTableRowElement;
let acell = arow.insertCell();
acell.innerHTML = algo+':'+version;
acell.innerHTML = '<u>'+algo+':'+version+'</u>';
arow.onclick = function() {
me._algorithm = algo;
me._version = version;
Expand Down Expand Up @@ -907,14 +911,15 @@ export class JobWidget extends Widget {
console.log('job not complete');
} else {
console.log('looking up job results');
let me = this;
const res:RequestResult = await getResults(this._job_id,this._username);
// console.log(res);
if (res.ok) {
let json_response:any = res.json();

// console.log(json_response);
if (json_response['status_code'] === 200) {
INotification.success("Get user job result success.");
this._results = json_response['results'];
me._results = json_response['results'];
} else {
console.log('get user job result != 200');
INotification.error("Get user job result failed.");
Expand Down Expand Up @@ -1179,7 +1184,7 @@ export class JobWidget extends Widget {
_setJobClick(tableId:string, setDisplays:any) {
let me = this;
onRowClick(tableId, function(row:HTMLTableRowElement){
let job_id = row.getElementsByTagName('td')[0].innerHTML;
let job_id = row.getElementsByTagName('td')[0].innerText;
console.log('widget set new job id '+job_id);
me._job_id = job_id;
setDisplays(me);
Expand Down
Loading

0 comments on commit 7903f1c

Please sign in to comment.