-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use Rails plugin generator and adapt
- Loading branch information
Showing
22 changed files
with
385 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,5 @@ | ||
require 'bundler/gem_tasks' | ||
require "bundler/setup" | ||
|
||
require 'rspec/core/rake_task' | ||
RSpec::Core::RakeTask.new('spec') | ||
load "rails/tasks/statistics.rake" | ||
|
||
task default: :spec | ||
require "bundler/gem_tasks" |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
nav { | ||
position: relative; | ||
z-index: 2; | ||
} | ||
nav .brand-logo { | ||
font-size: 1.75em; | ||
letter-spacing: -0.05em; | ||
} | ||
|
||
main { | ||
position: relative; | ||
z-index: 1; | ||
padding: 20px; | ||
} | ||
|
||
main .page-footer { | ||
margin: 0 -20px -20px -20px; | ||
} | ||
|
||
.page-footer > .footer-copyright { | ||
padding: 20px; | ||
} | ||
|
||
.responsive-overflow { | ||
overflow-x: auto; | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module Crono | ||
class ApplicationController < ActionController::Base | ||
protect_from_forgery with: :exception | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module Crono | ||
class JobsController < ApplicationController | ||
def index | ||
@jobs = Crono::CronoJob.all | ||
end | ||
|
||
def show | ||
@job = Crono::CronoJob.find(params[:id]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<header> | ||
<h4>Running Jobs</h4> | ||
</header> | ||
|
||
<div class="responsive-overflow"> | ||
<table id="job_list"> | ||
<tr> | ||
<th>Job</th> | ||
<th>Last performed at</th> | ||
<th>Status</th> | ||
<th></th> | ||
</tr> | ||
<% @jobs.each do |job| %> | ||
<tr> | ||
<td> | ||
<%= job.job_id %> | ||
</td> | ||
<td> | ||
<%= job.last_performed_at || 'Never performed yet' %> | ||
</td> | ||
<td> | ||
<% if job.last_performed_at.nil? %> | ||
<span class="grey-text darken-3" title="This job has never been performed yet."> | ||
<i class="mdi-device-access-time"></i> | ||
Pending | ||
</span> | ||
<% elsif job.healthy %> | ||
<a href="<%= job_path(job) %>"> | ||
<span class="green-text darken-3" title="This job was performed successfully."> | ||
<i class="mdi-action-done"></i> | ||
Success | ||
</span> | ||
</a> | ||
<% else %> | ||
<a href="<%= job_path(job) %>"> | ||
<span class="red-text" title="There were problems with this job. Follow the link to check the log."> | ||
<i class="mdi-alert-warning"></i> | ||
Error | ||
</span> | ||
</a> | ||
<% end %> | ||
</td> | ||
<td> | ||
<% if job.last_performed_at %> | ||
<a href="<%= job_path(job) %>" class="right"> | ||
Log | ||
<i class="mdi-navigation-chevron-right"></i> | ||
</a> | ||
<% end %> | ||
</td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<header class="blue-grey lighten-4 grey-text text-darken-4"> | ||
<a href="<%= root_url %>"> | ||
<i class="mdi-navigation-chevron-left"></i> | ||
‹ Back to Home | ||
</a> | ||
<h4>Last log of <i><%= @job.job_id %></i>:</h4> | ||
</header> | ||
<% if @job.healthy == false %> | ||
<div class="row red-text"> | ||
<div class="s12 center-align"> | ||
<i class="mdi-alert-warning"></i> | ||
An error occurs during the last execution of this job. | ||
Check the log below for details. | ||
</div> | ||
</div> | ||
<% end %> | ||
<pre class="responsive-overflow"><%= @job.log %></pre> |
Oops, something went wrong.