Commit 48515bb9 authored by Ziwen Su's avatar Ziwen Su

Matched the Jobtag value/array in both cases.

parent dc5a276e
......@@ -129,7 +129,7 @@ export class SearchComponent implements OnInit {
nodename: string;
jobtag_bool: boolean[];
jobtag_sum: number;
jobtag_value: string;
selected_jobtags: string;
jobtag_option: SelectItem[];
selected_jobtag_option: string;
......@@ -266,7 +266,7 @@ export class SearchComponent implements OnInit {
this.selected_jobtag_option = localStorage.getItem('JOBTAG_OPTION');
}
if ( searchStorage['TAGS'] ) {
this.jobtag_sum = Number(searchStorage['TAGS']);
this.jobtag_value = (searchStorage['TAGS']);
this.jobtag_bool[0] = (localStorage.getItem('JTAG_1'))==='true';
this.jobtag_bool[1] = (localStorage.getItem('JTAG_2'))==='true';
this.jobtag_bool[2] = (localStorage.getItem('JTAG_4'))==='true';
......@@ -427,7 +427,7 @@ export class SearchComponent implements OnInit {
this.jobname = null;
this.nodename = null;
this.jobtag_bool = [false, false, false, false, false];
this.jobtag_sum = null;
this.jobtag_value = null;
this.selected_jobtag_option = "and";
this.selected_jobtags = null;
this.footprint_code = null;
......@@ -505,17 +505,28 @@ export class SearchComponent implements OnInit {
}
}
checkJobtags() {
this.jobtag_sum= Number(this.jobtag_bool[0]) + Number(this.jobtag_bool[1])*2 + Number(this.jobtag_bool[2])*4 + Number(this.jobtag_bool[3])*8 + Number(this.jobtag_bool[4])*16;
if ( this.selected_jobtag_option == "or" ) {
var jobtag_arr:number[] = [];
for ( let i = 0; i < 5; i++ ) {
if ( this.jobtag_bool[i] ) {
jobtag_arr.push(Math.pow(2,i));
}
}
this.jobtag_value = jobtag_arr.join(" ");
}
else {
this.jobtag_value= (Number(this.jobtag_bool[0]) + Number(this.jobtag_bool[1])*2 + Number(this.jobtag_bool[2])*4 + Number(this.jobtag_bool[3])*8 + Number(this.jobtag_bool[4])*16).toString();
}
var jobtag_display;
if ( this.jobtag_bool[0] ) {
jobtag_display = "memory-bound";
} else if ( this.jobtag_bool[1] ){
} else if ( this.jobtag_bool[1] ) {
jobtag_display = "compute-bound";
} else if ( this.jobtag_bool[4] ){
} else if ( this.jobtag_bool[4] ) {
jobtag_display = "gpu-bound";
} else if ( this.jobtag_bool[2] ){
} else if ( this.jobtag_bool[2] ) {
jobtag_display = "io-heavy";
} else if ( this.jobtag_bool[3] ){
} else if ( this.jobtag_bool[3] ) {
jobtag_display = "network-heavy";
}
var jobtag_num;
......@@ -611,8 +622,8 @@ export class SearchComponent implements OnInit {
localStorage.setItem('JTAG_4', this.jobtag_bool[2].toString());
localStorage.setItem('JTAG_8', this.jobtag_bool[3].toString());
localStorage.setItem('JTAG_16', this.jobtag_bool[4].toString());
if ( this.jobtag_sum && this.jobtag_sum != 0 ) {
this.monitoringservice.addFilterItem('TAGS', this.jobtag_sum.toString());
if ( this.jobtag_value && this.jobtag_value != "0" ) {
this.monitoringservice.addFilterItem('TAGS', this.jobtag_value);
}
if ( this.selected_jobtags ) {
localStorage.setItem('SELECTED_JTG', this.selected_jobtags);
......
Markdown is supported
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