Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added prototype for backup function

  • Loading branch information...
commit 0b2a7c87237152621b2075206fb8ccbbbe0c3e54 1 parent aa6e356
@augustf augustf authored
View
2  Gemfile
@@ -56,3 +56,5 @@ gem 'simplecov', :require => false, :group => :test
#Cross-platform monitoring of processes
gem 'sys-proctable'
+
+gem 'rails-backup-migrate'
View
3  Gemfile.lock
@@ -92,6 +92,8 @@ GEM
activesupport (= 3.2.9)
bundler (~> 1.0)
railties (= 3.2.9)
+ rails-backup-migrate (0.0.12)
+ activerecord (>= 2.3)
railties (3.2.9)
actionpack (= 3.2.9)
activesupport (= 3.2.9)
@@ -149,6 +151,7 @@ DEPENDENCIES
json
mysql2
rails (= 3.2.9)
+ rails-backup-migrate
rmagick (>= 2.12.2)
sass-rails (~> 3.2.3)
simplecov
View
2  Rakefile
@@ -4,4 +4,6 @@
require File.expand_path('../config/application', __FILE__)
+require 'rails-backup-migrate'
+
Concerto::Application.load_tasks
View
6 app/controllers/dashboard_controller.rb
@@ -2,7 +2,7 @@ class DashboardController < ApplicationController
#includes for system status functions
require 'sys/proctable'
include Sys
-
+ require 'rake'
# GET /dashboard
def index
authorize! :read, ConcertoConfig
@@ -33,6 +33,10 @@ def update
render :action => :index
end
+ def run_backup
+ #Add rake site:backup to the Delayed Jobs queue for processing
+ end
+
def latest_version
require 'open-uri'
begin
View
2  app/views/dashboard/index.html.erb
@@ -1,3 +1,4 @@
+
<section class="viewblock">
<header class="viewblock-header">
<h1 class="default-padding"><%= t(:admin_dashboard) %></h1>
@@ -13,6 +14,7 @@
<% if @latest_version > Concerto::VERSION::STRING %>
<i class="ficon-exclamation-sign" style="font-size: 1.4em;"></i> <b>A new version (<%= @latest_version %>) is now available.</b>
<% end %>
+ <%= link_to t(:backup), :action => "run_backup" %>
</div>
</div>
<div class="span4">
View
3  config/routes.rb
@@ -83,8 +83,9 @@
resources :tickers, :controller => :contents, :except => [:index, :show], :path => "content"
- #Set a non-restul route to the dashboard
+ #Set a non-restful route to the dashboard
match 'dashboard/' => 'dashboard#index'
+ match 'dashboard/run_backup' => 'dashboard#run_backup'
match 'dashboard/update' => 'dashboard#update', :via => "post"
# The priority is based upon order of creation:
# first created -> highest priority.
Please sign in to comment.
Something went wrong with that request. Please try again.