Merge pull request #86 from Evolix/round-robin

Adding round robin checkbox in ssl checks form and in checks table.
This commit is contained in:
Colin Darie 2018-08-30 16:58:33 +02:00 committed by GitHub
commit 321f92b045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 6 deletions

View File

@ -81,8 +81,9 @@ class ChecksController < ApplicationController
end
def check_params(*others)
params.require(:check).permit(:domain, :domain_created_at, :comment, :vendor, *others,
notifications_attributes: [:id, :channel, :recipient, :interval])
params.require(:check)
.permit(:domain, :domain_created_at, :comment, :vendor, :round_robin, *others,
notifications_attributes: [:id, :channel, :recipient, :interval])
end
def build_empty_notification

View File

@ -1,6 +1,5 @@
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
# == Schema Information
#
# Table name: checks
@ -16,6 +15,7 @@
# kind :integer not null
# last_run_at :datetime
# last_success_at :datetime
# round_robin :boolean default(TRUE)
# vendor :string(255)
# created_at :datetime not null
# updated_at :datetime not null

View File

@ -12,7 +12,11 @@
<%= f.input :comment %>
<%= f.input :vendor %>
<% if check.ssl? %>
<%= f.input :round_robin %>
<% end %>
<% if check.persisted? %>
<%= f.input :active %>
<% end %>

View File

@ -0,0 +1,7 @@
# Copyright (C) 2018 Juliette Cougnoux <jcougnoux@evolix.fr>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
class AddRoundrobinToChecks < ActiveRecord::Migration[5.2]
def change
add_column :checks, :round_robin, :boolean, default: true
end
end

View File

@ -38,6 +38,7 @@ ActiveRecord::Schema.define(version: 2018_08_01_072038) do
t.boolean "active", default: true, null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.boolean "round_robin", default: true
t.integer "consecutive_failures", default: 0, null: false
t.index ["user_id"], name: "index_checks_on_user_id"
end

View File

@ -1,6 +1,5 @@
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
# == Schema Information
#
# Table name: checks
@ -16,6 +15,7 @@
# kind :integer not null
# last_run_at :datetime
# last_success_at :datetime
# round_robin :boolean default(TRUE)
# vendor :string(255)
# created_at :datetime not null
# updated_at :datetime not null

View File

@ -1,6 +1,5 @@
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
# License: GNU AGPL-3+ (see full text in LICENSE file)
# == Schema Information
#
# Table name: checks
@ -16,6 +15,7 @@
# kind :integer not null
# last_run_at :datetime
# last_success_at :datetime
# round_robin :boolean default(TRUE)
# vendor :string(255)
# created_at :datetime not null
# updated_at :datetime not null