Skip to content
Snippets Groups Projects
Commit f2415bab authored by Reid Givens's avatar Reid Givens
Browse files

econding pattern such that it can accept '+' rather than treating it as a space

parent aa3e9a36
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,7 @@ export class JobsService {
public getJobRecordCount(epoch: number, queue: string, pattern: string, status: string): Observable<number> {
return this.http.get<number>(this.configService.config.url + this.endPoint + 'byEpoch/' + epoch.toString() + '/byQueue/' + queue +
'/pages?pattern=' + encodeURI(pattern) + '&status=' + encodeURI(status), {observe: 'response'}).pipe(
'/pages?pattern=' + encodeURIComponent(pattern) + '&status=' + encodeURI(status), {observe: 'response'}).pipe(
map(response => {
return response.body;
}));
......@@ -29,7 +29,7 @@ export class JobsService {
public getJobSpecRecordCount(epoch: number, queue: string, pattern: string, status: string): Observable<number> {
return this.http.get<number>(this.configService.config.url + this.endPoint + 'specs/byEpoch/' + epoch.toString() + '/byQueue/' + queue +
'/pages?pattern=' + encodeURI(pattern) + '&status=' + encodeURI(status), {observe: 'response'}).pipe(
'/pages?pattern=' + encodeURIComponent(pattern) + '&status=' + encodeURI(status), {observe: 'response'}).pipe(
map(response => {
return response.body;
}));
......@@ -38,7 +38,7 @@ export class JobsService {
public getJobSpecPage(epoch: number, queue: string, pageId: number, pattern: string, status: string): Observable<Array<JobSpec>> {
let params = new HttpParams();
if (!!pattern) {
params = params.append('pattern', pattern);
params = params.append('pattern', encodeURIComponent(pattern));
}
if (!!status) {
params = params.append('status', status);
......@@ -60,7 +60,7 @@ export class JobsService {
public getJobPage(epoch: number, queue: string, pageId: number, pattern: string, status: string): Observable<Array<Job>> {
let params = new HttpParams();
if (!!pattern) {
params = params.append('pattern', pattern);
params = params.append('pattern', encodeURIComponent(pattern));
}
if (!!status) {
params = params.append('status', status);
......@@ -79,42 +79,6 @@ export class JobsService {
}));
}
/*public getJobs(queue: string, id: string, pattern: string, status: string): Observable<Array<Job>> {
return this.http.get<Array<Job>>(this.configService.config.url + this.endPoint + 'optimized/queues/' + queue, {observe: 'response'}).pipe(
map((response: HttpResponse<Array<Job>>) => {
let reply = response.body;
if (id && id.length > 0) {
reply = reply.filter(job => job.job_id.toString() === id);
} else {
if (pattern && pattern.length > 0) {
reply = reply.filter(job => job.job_name.match(pattern.replace("+", "\\+")));
}
if (status && status.length > 0 && status !== 'ALL') {
reply = reply.filter(job => job.job_status == status);
}
}
return reply;
}));
}
public getJobSpecs(queue: string, id: string, pattern: string, status: string): Observable<Array<Job>> {
return this.http.get<Array<Job>>(this.configService.config.url + this.endPoint + 'optimized/queues/' + queue, {observe: 'response'}).pipe(
map((response: HttpResponse<Array<Job>>) => {
let reply = response.body;
if (id && id.length > 0) {
reply = reply.filter(job => job.jobspec_id.toString() === id);
} else {
if (pattern && pattern.length > 0) {
reply = reply.filter(job => job.jobspec_name.match(pattern.replace("+", "\\+")));
}
if (status && status.length > 0 && status !== 'ALL') {
reply = reply.filter(job => job.job_status == status);
}
}
return reply;
}));
}*/
public getJobSpec(id: number): Observable<JobSpec> {
return this.http.get<JobSpec>(this.configService.config.url + this.endPoint + 'specs/' + id, {observe: 'response'}).pipe(
map(response => {
......
......@@ -21,7 +21,7 @@ export class ProductsService {
public getRecordCount(epoch: number, type: number, pattern: string): Observable<number> {
return this.http.get<number>(this.configService.config.url + this.endPoint + 'byEpoch/' + epoch.toString() + '/byType/' + type.toString() +
'/pages?pattern=' + encodeURI(pattern), {observe: 'response'}).pipe(
'/pages?pattern=' + encodeURIComponent(pattern), {observe: 'response'}).pipe(
map(response => {
return response.body;
}));
......@@ -30,7 +30,7 @@ export class ProductsService {
public getPage(epoch: number, type: number, pageId: number, pattern: string): Observable<Array<Product>> {
let params = new HttpParams();
if (pattern) {
params = params.append('pattern', pattern);
params = params.append('pattern', encodeURIComponent(pattern));
}
const sortName = this.filtersService.getCurrentSetting('PRODUCT_SORT');
......
......@@ -24,6 +24,6 @@ A service in angular will capture this info and add it to a service
/**
* If you need to overwrite this for this server, use the following
*/
// window.__env.configUrl = 'https://webtest.aoc.nrao.edu/VlassMngr/services/configuration';
window.__env.configUrl = 'https://webtest.aoc.nrao.edu/VlassMngr/services/configuration';
}(this));
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