Commit 2b794673 authored by nazarf's avatar nazarf

add btn set miss all miners

parent 517a2770
...@@ -78,6 +78,14 @@ class MinersController < AdminController ...@@ -78,6 +78,14 @@ class MinersController < AdminController
end end
end end
def set_miners_miss
Miner.update_all(status: 'miss', last_activity: Time.now)
respond_to do |format|
format.html { redirect_to miners_url, notice: 'Miners was set miss' }
format.json { head :no_content }
end
end
private private
# Use callbacks to share common setup or constraints between actions. # Use callbacks to share common setup or constraints between actions.
......
...@@ -40,3 +40,4 @@ ...@@ -40,3 +40,4 @@
%br %br
=link_to "update miner from exel", update_miner_from_exel_path, class: 'btn btn-default btn-xs' =link_to "update miner from exel", update_miner_from_exel_path, class: 'btn btn-default btn-xs'
=link_to "check activity", check_activity_path, class: 'btn btn-default btn-xs' =link_to "check activity", check_activity_path, class: 'btn btn-default btn-xs'
=link_to "set miss", set_miners_miss_path, class: 'btn btn-default btn-xs'
...@@ -36,6 +36,7 @@ Rails.application.routes.draw do ...@@ -36,6 +36,7 @@ Rails.application.routes.draw do
get '/update_miner_activity/:name', to: 'front#update_miner_activity', as: 'update_miner_activity' get '/update_miner_activity/:name', to: 'front#update_miner_activity', as: 'update_miner_activity'
get '/update_miner_from_exel', to: 'miners#update_miner_from_exel', as: 'update_miner_from_exel' get '/update_miner_from_exel', to: 'miners#update_miner_from_exel', as: 'update_miner_from_exel'
get '/check_activity', to: 'miners#check_activity', as: 'check_activity' get '/check_activity', to: 'miners#check_activity', as: 'check_activity'
get '/set_miners_miss', to: 'miners#set_miners_miss', as: 'set_miners_miss'
root 'front#index' root 'front#index'
end end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment