Skip to content

Commit

Permalink
renamed tab and other minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
sukhbir-singh committed Jul 28, 2018
1 parent fdc36cc commit 4a4a467
Show file tree
Hide file tree
Showing 7 changed files with 39 additions and 37 deletions.
6 changes: 3 additions & 3 deletions app/controllers/rsnapshot_backups_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ class RsnapshotBackupsController < ApplicationController
before_action :admin_required

def index
@page_title = t('rsnapshot_backups')
@page_title = t('amahi_backups')
RsnapshotHelper.run_init_script if RsnapshotHelper.first_time_setup
@cron_job_status = CronTabHelper.check_status
@dest_path = RsnapshotHelper.get_fields("snapshot_root")
@logs = RsnapshotLogUtil.get_log_output
@logs = @cron_job_status? RsnapshotLogUtil.get_log_output : nil
end

def settings
@page_title = t('rsnapshot_backups')
@page_title = t('amahi_backups')
@dest_path = RsnapshotHelper.get_fields("snapshot_root")
@backup_paths = RsnapshotHelper.get_fields("backup")
@cron_job_status = CronTabHelper.check_status
Expand Down
6 changes: 3 additions & 3 deletions app/views/rsnapshot_backups/index.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
.share-manage.collapsed-div-style.p-3
- if !@cron_job_status
.jumbotron.m-3
p.h6 Rsnapshot based automatic backups is not running.
p.h6 Rsnapshot based Amahi backups is not running.
p.h6 You need to do some configuration changes to make it back to running state.
form.mt-3 action="/tab/rsnapshot_backups/settings"
button.btnn.btn.btn-info type="submit" = "Edit Configurations"
= link_to t('edit_settings'), '/tab/amahi_backups/settings', :class => 'mt-3', :style => 'font-size: 15px; display: inline-block;'

- elsif @logs.blank? or @logs.size == 0
div.alert.alert-info.mt-4 role="alert"
= "No Backups found at backup destination location - #{@dest_path[0][0]}"
Expand Down
52 changes: 26 additions & 26 deletions app/views/rsnapshot_backups/settings.html.slim
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ css:
background: rgb(255,255,153);
}

tr td:first-child{
vertical-align: top;
}

.settings-stretcher
.share-manage.collapsed-div-style
fieldset
legend
| Edit Rsnapshot Settings
| Edit Settings

.settings-fields
table
Expand Down Expand Up @@ -61,57 +65,53 @@ css:

tr
td
label #{"Interval"}
label #{"Repeat Duration"}
td
- unless @cron_job_status
= form_tag rsnapshot_backups_engine.set_interval_path,\
:method => :post,\
:remote => true,\
:id => 'set_interval_form_id',\
:class => 'set_interval_form'
input name="interval" value="daily" type="radio" checked="checked"
input name="interval" value="daily" type="checkbox" checked="checked"
span.position-absolute.pl-2 Daily
br
input name="interval" value="hourly" type="radio"
input name="interval" value="hourly" type="checkbox"
span.position-absolute.pl-2 Hourly
br
input name="interval" value="weekly" type="radio"
input name="interval" value="weekly" type="checkbox"
span.position-absolute.pl-2 Weekly

br
= spinner "start_cron_spinner"
input.p-2.pl-3.pr-3.mt-2#start_backup_button type="submit" style="cursor:pointer;" value="Start Automatic Backups"
br
span#interval_update_messages.messages style="display: none"

- else
= form_tag rsnapshot_backups_engine.stop_automatic_backup_path,\
:method => :post,\
:remote => true,\
:id => 'stop_backup_form_id',\
:class => 'stop_backup_form'
- if @current_interval == "daily"
input name="interval" value="daily" disabled="disabled" type="radio" checked="checked"
input name="interval" value="daily" disabled="disabled" type="checkbox" checked="checked"
- else
input name="interval" value="daily" disabled="disabled" type="radio"
input name="interval" value="daily" disabled="disabled" type="checkbox"
span.position-absolute.pl-2 Daily
br
- if @current_interval == "hourly"
input name="interval" value="hourly" disabled="disabled" type="radio" checked="checked"
- else
input name="interval" value="hourly" disabled="disabled" type="radio"
span.position-absolute.pl-2 Hourly
br
- if @current_interval == "weekly"
input name="interval" value="weekly" disabled="disabled" type="radio" checked="checked"
input name="interval" value="weekly" disabled="disabled" type="checkbox" checked="checked"
- else
input name="interval" value="weekly" disabled="disabled" type="radio"
input name="interval" value="weekly" disabled="disabled" type="checkbox"
span.position-absolute.pl-2 Weekly

br
= spinner "stop_cron_spinner"
input.p-2.pl-3.pr-3.mt-2#stop_backup_button type="submit" style="cursor:pointer;" value="Stop Automatic Backups"
br
span#stop_cron_messages.messages style="display: none"
- if @current_interval == "monthly"
input name="interval" value="monthly" disabled="disabled" type="checkbox" checked="checked"
- else
input name="interval" value="monthly" disabled="disabled" type="checkbox"
span.position-absolute.pl-2 Monthly

div style="margin-left:120px;"
= spinner "stop_cron_spinner"
input.p-2.pl-3.pr-3.mt-2#stop_backup_button type="submit" style="cursor:pointer;" value="Stop Backups"
br
span#stop_cron_messages.messages style="display: none"
br

= javascript_include_tag 'rsnapshot_backups'

4 changes: 2 additions & 2 deletions config/amahi-plugin.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# human readable name (no localization supported yet)
name: RsnapshotBackup
name: AmahiBackups
# class to be mounted
class: RsnapshotBackups
# root url where this plugin will be mounted
url: /tab/rsnapshot_backups
url: /tab/amahi_backups
2 changes: 1 addition & 1 deletion config/initializers/plugin_init.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# plugin initialization
t = Tab.new("rsnapshot_backups", "rsnapshot_backups", "/tab/rsnapshot_backups")
t = Tab.new("rsnapshot_backups", "amahi_backups", "/tab/amahi_backups")
# add any subtabs with what you need. params are controller and the label, for example
t.add("index", "details")
t.add("settings", "settings")
2 changes: 2 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@
# put here your string symbols and translations
hello_world: Hello World! (yay for the Amahi plugins!)
rsnapshot_backups: Rsnapshot Backups
amahi_backups: Amahi Backups
edit_settings: Edit Settings
4 changes: 2 additions & 2 deletions rsnapshot_backups.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ require "rsnapshot_backups/version"

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
s.name = "rsnapshot_backups"
s.name = "amahi_backups"
s.version = RsnapshotBackup::VERSION
s.authors = ["sukhbir singh"]
s.email = ["[email protected]"]
s.homepage = "http://www.amahi.org/apps/yourapp"
s.homepage = "http://www.amahi.org/apps/amahi_backups"
s.license = "AGPLv3"
s.summary = %{Amahi plugin to create incremental backups using rsnaphot periodically.}
s.description = %{This is an Amahi 11 platform plugin that creates periodic backups using rsnapshot tool.}
Expand Down

0 comments on commit 4a4a467

Please sign in to comment.