Skip to content

Commit

Permalink
job page is functional
Browse files Browse the repository at this point in the history
  • Loading branch information
jvilalta committed Apr 15, 2015
1 parent 2a0e81b commit 8f1d9c7
Show file tree
Hide file tree
Showing 8 changed files with 98 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Quartz.FeaturePack.NancyWebApi/JobsModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ public JobsModule()
}
}
}

return JsonConvert.SerializeObject(jobs);
var response = Response.AsJson(jobs);
response.Headers.Add("Access-Control-Allow-Origin", "*");
return response;
};

Put[""] = parameters =>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@
<Content Include="Web\protractor.conf.js" />
<Content Include="Web\src\app.html" />
<Content Include="Web\src\app.js" />
<Content Include="Web\src\jobs.html" />
<Content Include="Web\src\jobs.js" />
<Content Include="Web\src\scheduler.html" />
<Content Include="Web\src\scheduler.js" />
<Content Include="Web\src\index.html" />
Expand Down
4 changes: 2 additions & 2 deletions Quartz.FeaturePack.NancyWebApi/Web/dist/app.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions Quartz.FeaturePack.NancyWebApi/Web/dist/jobs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<section>
<div class="container">
<h2>Job Data</h2>
<table>
<thead><tr><td>Job Type</td><td>Job Description</td></tr></thead>
<tbody>
<tr repeat.for="job of jobs"><td>${job.jobType}</td><td>${job.description}</td></tr>
</tbody>
</table>
</section>
</template>
48 changes: 48 additions & 0 deletions Quartz.FeaturePack.NancyWebApi/Web/dist/jobs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion Quartz.FeaturePack.NancyWebApi/Web/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ export class App {
{
config.title = 'Quartz.Net Manager';
config.map([
{ route: ['','scheduler'], moduleId: './scheduler', nav: true, title:'Scheduler' }
{ route: ['','scheduler'], moduleId: './scheduler', nav: true, title:'Scheduler' },
{ route: 'jobs', moduleId: './jobs', nav: true, title:'Jobs' }
]);
});
}
Expand Down
12 changes: 12 additions & 0 deletions Quartz.FeaturePack.NancyWebApi/Web/src/jobs.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<template>
<section>
<div class="container">
<h2>Job Data</h2>
<table>
<thead><tr><td>Job Type</td><td>Job Description</td></tr></thead>
<tbody>
<tr repeat.for="job of jobs"><td>${job.jobType}</td><td>${job.description}</td></tr>
</tbody>
</table>
</section>
</template>
17 changes: 17 additions & 0 deletions Quartz.FeaturePack.NancyWebApi/Web/src/jobs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import {HttpClient} from 'aurelia-http-client';
import {inject} from 'aurelia-framework';

export class Jobs {

static inject() {return [HttpClient]};
constructor(http) {
this.http = http;

};
activate(){
return this.http.get("http://localhost:8888/api/jobs").then(response=>{
this.jobs=response.content;
console.log(this.jobs);
})
}
}

0 comments on commit 8f1d9c7

Please sign in to comment.