mirror of
https://github.com/Evolix/chexpire.git
synced 2024-04-29 15:30:49 +02:00
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:
commit
321f92b045
|
@ -81,8 +81,9 @@ class ChecksController < ApplicationController
|
||||||
end
|
end
|
||||||
|
|
||||||
def check_params(*others)
|
def check_params(*others)
|
||||||
params.require(:check).permit(:domain, :domain_created_at, :comment, :vendor, *others,
|
params.require(:check)
|
||||||
notifications_attributes: [:id, :channel, :recipient, :interval])
|
.permit(:domain, :domain_created_at, :comment, :vendor, :round_robin, *others,
|
||||||
|
notifications_attributes: [:id, :channel, :recipient, :interval])
|
||||||
end
|
end
|
||||||
|
|
||||||
def build_empty_notification
|
def build_empty_notification
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Jeremy Lecour <jlecour@evolix.fr>, 2018 Evolix <info@evolix.fr>
|
# 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)
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: checks
|
# Table name: checks
|
||||||
|
@ -16,6 +15,7 @@
|
||||||
# kind :integer not null
|
# kind :integer not null
|
||||||
# last_run_at :datetime
|
# last_run_at :datetime
|
||||||
# last_success_at :datetime
|
# last_success_at :datetime
|
||||||
|
# round_robin :boolean default(TRUE)
|
||||||
# vendor :string(255)
|
# vendor :string(255)
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
|
|
|
@ -12,7 +12,11 @@
|
||||||
|
|
||||||
<%= f.input :comment %>
|
<%= f.input :comment %>
|
||||||
<%= f.input :vendor %>
|
<%= f.input :vendor %>
|
||||||
|
|
||||||
|
<% if check.ssl? %>
|
||||||
|
<%= f.input :round_robin %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if check.persisted? %>
|
<% if check.persisted? %>
|
||||||
<%= f.input :active %>
|
<%= f.input :active %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
7
db/migrate/20180724075445_add_roundrobin_to_checks.rb
Normal file
7
db/migrate/20180724075445_add_roundrobin_to_checks.rb
Normal 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
|
|
@ -38,6 +38,7 @@ ActiveRecord::Schema.define(version: 2018_08_01_072038) do
|
||||||
t.boolean "active", default: true, null: false
|
t.boolean "active", default: true, null: false
|
||||||
t.datetime "created_at", null: false
|
t.datetime "created_at", null: false
|
||||||
t.datetime "updated_at", null: false
|
t.datetime "updated_at", null: false
|
||||||
|
t.boolean "round_robin", default: true
|
||||||
t.integer "consecutive_failures", default: 0, null: false
|
t.integer "consecutive_failures", default: 0, null: false
|
||||||
t.index ["user_id"], name: "index_checks_on_user_id"
|
t.index ["user_id"], name: "index_checks_on_user_id"
|
||||||
end
|
end
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
||||||
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: checks
|
# Table name: checks
|
||||||
|
@ -16,6 +15,7 @@
|
||||||
# kind :integer not null
|
# kind :integer not null
|
||||||
# last_run_at :datetime
|
# last_run_at :datetime
|
||||||
# last_success_at :datetime
|
# last_success_at :datetime
|
||||||
|
# round_robin :boolean default(TRUE)
|
||||||
# vendor :string(255)
|
# vendor :string(255)
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
# Copyright (C) 2018 Colin Darie <colin@darie.eu>, 2018 Evolix <info@evolix.fr>
|
||||||
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
# License: GNU AGPL-3+ (see full text in LICENSE file)
|
||||||
|
|
||||||
# == Schema Information
|
# == Schema Information
|
||||||
#
|
#
|
||||||
# Table name: checks
|
# Table name: checks
|
||||||
|
@ -16,6 +15,7 @@
|
||||||
# kind :integer not null
|
# kind :integer not null
|
||||||
# last_run_at :datetime
|
# last_run_at :datetime
|
||||||
# last_success_at :datetime
|
# last_success_at :datetime
|
||||||
|
# round_robin :boolean default(TRUE)
|
||||||
# vendor :string(255)
|
# vendor :string(255)
|
||||||
# created_at :datetime not null
|
# created_at :datetime not null
|
||||||
# updated_at :datetime not null
|
# updated_at :datetime not null
|
||||||
|
|
Loading…
Reference in a new issue