mirror of
https://github.com/plashchynski/crono.git
synced 2026-07-10 23:02:44 +02:00
Lint web
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
module Crono
|
module Crono
|
||||||
# PerformerProxy is a proxy used in cronotab.rb semantic
|
# Crono::PerformerProxy is a proxy used in cronotab.rb semantic
|
||||||
class PerformerProxy
|
class PerformerProxy
|
||||||
def initialize(performer, scheduler)
|
def initialize(performer, scheduler)
|
||||||
@performer = performer
|
@performer = performer
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ require 'rails/generators/active_record'
|
|||||||
|
|
||||||
module Crono
|
module Crono
|
||||||
module Generators
|
module Generators
|
||||||
|
# rails generate crono:install
|
||||||
class InstallGenerator < ::Rails::Generators::Base
|
class InstallGenerator < ::Rails::Generators::Base
|
||||||
include Rails::Generators::Migration
|
include Rails::Generators::Migration
|
||||||
|
|
||||||
@@ -19,7 +20,8 @@ module Crono
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create_migrations
|
def create_migrations
|
||||||
migration_template 'migrations/create_crono_jobs.rb', 'db/migrate/create_crono_jobs.rb'
|
migration_template 'migrations/create_crono_jobs.rb',
|
||||||
|
'db/migrate/create_crono_jobs.rb'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
+2
-1
@@ -39,9 +39,10 @@ describe Crono::Web do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it 'should show a message about the unhealthy job' do
|
it 'should show a message about the unhealthy job' do
|
||||||
|
message = 'An error occurs during the last execution of this job'
|
||||||
@test_job.update(healthy: false)
|
@test_job.update(healthy: false)
|
||||||
get "/job/#{@test_job.id}"
|
get "/job/#{@test_job.id}"
|
||||||
expect(last_response.body).to include 'An error occurs during the last execution of this job'
|
expect(last_response.body).to include message
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -8,15 +8,15 @@
|
|||||||
%th Last performed at
|
%th Last performed at
|
||||||
%th
|
%th
|
||||||
%th
|
%th
|
||||||
- for job in @jobs
|
- @jobs.each do |job|
|
||||||
%tr
|
%tr
|
||||||
%td= job.job_id
|
%td= job.job_id
|
||||||
%td= job.last_performed_at || "—"
|
%td= job.last_performed_at || '-'
|
||||||
%td
|
%td
|
||||||
- if job.healthy == false
|
- if job.healthy == false
|
||||||
%a{href: url("/job/#{job.id}")}
|
%a{ href: url("/job/#{job.id}") }
|
||||||
%span.label.label-danger Error
|
%span.label.label-danger Error
|
||||||
%td
|
%td
|
||||||
%a{href: url("/job/#{job.id}")}
|
%a{ href: url("/job/#{job.id}") }
|
||||||
Log
|
Log
|
||||||
%span.glyphicon.glyphicon-menu-right
|
%span.glyphicon.glyphicon-menu-right
|
||||||
|
|||||||
+4
-3
@@ -1,13 +1,14 @@
|
|||||||
%ol.breadcrumb
|
%ol.breadcrumb
|
||||||
%li
|
%li
|
||||||
%a{href: url("/")} Home
|
%a{ href: url('/') } Home
|
||||||
%li.active= @job.job_id
|
%li.active= @job.job_id
|
||||||
|
|
||||||
%h2
|
%h2
|
||||||
"#{@job.job_id}" Log:
|
"#{@job.job_id}" Log:
|
||||||
|
|
||||||
- if @job.healthy == false
|
- if @job.healthy == false
|
||||||
.alert.alert-danger{role: "alert"}
|
.alert.alert-danger{ role: 'alert' }
|
||||||
An error occurs during the last execution of this job. Check the log below for details.
|
An error occurs during the last execution of this job.
|
||||||
|
Check the log below for details.
|
||||||
|
|
||||||
%pre= @job.log
|
%pre= @job.log
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
!!! 5
|
!!! 5
|
||||||
%html{lang: "en"}
|
%html{ lang: 'en' }
|
||||||
%head
|
%head
|
||||||
%meta{charset: "utf-8"}
|
%meta{ charset: 'utf-8' }
|
||||||
%meta{"http-equiv" => "X-UA-Compatible", content: "IE=edge"}
|
%meta{ 'http-equiv' => 'X-UA-Compatible', content: 'IE=edge' }
|
||||||
%meta{name: "viewport", content: "width=device-width, initial-scale=1"}
|
%meta{ name: 'viewport', content: 'width=device-width, initial-scale=1' }
|
||||||
|
|
||||||
%title Crono Dashboard
|
%title Crono Dashboard
|
||||||
|
|
||||||
%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.min.css', rel: 'stylesheet' }
|
||||||
%link{href: "https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css", rel: "stylesheet"}
|
%link{ href: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap-theme.min.css', rel: 'stylesheet' }
|
||||||
%link{href: "#{env['SCRIPT_NAME']}/custom.css", rel: "stylesheet"}
|
%link{ href: "#{env['SCRIPT_NAME']}/custom.css", rel: 'stylesheet' }
|
||||||
|
|
||||||
%body
|
%body
|
||||||
%br
|
%br
|
||||||
@@ -21,5 +21,5 @@
|
|||||||
%small Dashboard
|
%small Dashboard
|
||||||
= yield
|
= yield
|
||||||
|
|
||||||
%script{src: "https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"}
|
%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"}
|
%script{ src: 'https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/js/bootstrap.min.js' }
|
||||||
|
|||||||
Reference in New Issue
Block a user