diff --git a/lib/crono/web.rb b/lib/crono/web.rb index f55455f..fd542fb 100644 --- a/lib/crono/web.rb +++ b/lib/crono/web.rb @@ -14,5 +14,10 @@ module Crono @jobs = Crono::CronoJob.all haml :dashboard, format: :html5 end + + get '/jobs/:id' do + @job = Crono::CronoJob.find(params[:id]) + haml :job + end end end diff --git a/web/views/dashboard.haml b/web/views/dashboard.haml index e81971d..5e98776 100644 --- a/web/views/dashboard.haml +++ b/web/views/dashboard.haml @@ -22,6 +22,8 @@ %tr %td= job.job_id %td= job.last_performed_at + %td + %a{href: url("/jobs/#{job.id}")} Log %script{src: "https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"} %script{src: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"} diff --git a/web/views/job.haml b/web/views/job.haml new file mode 100644 index 0000000..3309a14 --- /dev/null +++ b/web/views/job.haml @@ -0,0 +1,24 @@ +!!! 5 +%html{lang: "en"} + %head + %meta{charset: "utf-8"} + %meta{"http-equiv" => "X-UA-Compatible", content: "IE=edge"} + %meta{name: "viewport", content: "width=device-width, initial-scale=1"} + + %title Crono Job #{@job.job_id} + + %link{href: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css", rel: "stylesheet"}/ + %link{href: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css", rel: "stylesheet"}/ + + %body + .container + %ol.breadcrumb + %li + %a{href: url("/")} Home + %li.active= @job.job_id + %h2 + "#{@job.job_id}" Log: + %pre= @job.log + + %script{src: "https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"} + %script{src: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js"}