mirror of
https://github.com/plashchynski/crono.git
synced 2026-03-29 22:02:06 +02:00
Use Rails plugin generator and adapt
This commit is contained in:
6
app/assets/javascripts/crono/materialize.min.js
vendored
Normal file
6
app/assets/javascripts/crono/materialize.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
26
app/assets/stylesheets/crono/application.css
Normal file
26
app/assets/stylesheets/crono/application.css
Normal file
@@ -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;
|
||||
}
|
||||
31
app/assets/stylesheets/crono/materialize.min.css
vendored
Normal file
31
app/assets/stylesheets/crono/materialize.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
5
app/controllers/crono/application_controller.rb
Normal file
5
app/controllers/crono/application_controller.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module Crono
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery with: :exception
|
||||
end
|
||||
end
|
||||
11
app/controllers/crono/jobs_controller.rb
Normal file
11
app/controllers/crono/jobs_controller.rb
Normal file
@@ -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
|
||||
54
app/views/crono/jobs/index.html.erb
Normal file
54
app/views/crono/jobs/index.html.erb
Normal file
@@ -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>
|
||||
17
app/views/crono/jobs/show.html.erb
Normal file
17
app/views/crono/jobs/show.html.erb
Normal file
@@ -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>
|
||||
31
app/views/layouts/crono/application.html.erb
Normal file
31
app/views/layouts/crono/application.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8"/>
|
||||
<meta content="IE=edge" http-equiv="X-UA-Compatible"/>
|
||||
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport"/>
|
||||
<title>Crono Dashboard</title>
|
||||
<%= stylesheet_link_tag 'crono/materialize.min.css', media: "all" %>
|
||||
<%= stylesheet_link_tag 'crono/application', media: "all" %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
|
||||
<body class="blue-grey darken-2">
|
||||
<nav class="blue-grey white-text" role="navigation">
|
||||
<a class="brand-logo center" href="<%= root_path %>">
|
||||
<b>Crono</b> Dashboard
|
||||
</a>
|
||||
</nav>
|
||||
<main class="container blue-grey lighten-4">
|
||||
|
||||
<%= yield %>
|
||||
|
||||
<footer class="page-footer blue-grey darken-2">
|
||||
<div class="footer-copyright blue-grey">
|
||||
Crono v<%= Crono::VERSION %>
|
||||
<a class="right" href="https://github.com/plashchynski/crono" target="_blank">Documentation</a>
|
||||
</div>
|
||||
</footer>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user