diff --git a/app/controllers/admin/hosts_controller.rb b/app/controllers/admin/hosts_controller.rb index aab91ac..0afab20 100644 --- a/app/controllers/admin/hosts_controller.rb +++ b/app/controllers/admin/hosts_controller.rb @@ -1,24 +1,20 @@ class Admin::HostsController < Admin::BaseController - before_action :fetch_host, only: [:show, :verify] + before_action :fetch_host, only: [:verify] # GET /admin/hosts/unverified def unverified @hosts = Host.unverified end - # GET /admin/hosts/1 - def show - end - # POST /admin/hosts/1/verify def verify @host.verify(current_user.id) redirect_to unverified_admin_hosts_path end private def fetch_host @host = Host.find(params[:id]) end end diff --git a/app/views/admin/hosts/_host.html.erb b/app/views/admin/hosts/_host.html.erb index c9612a3..e798d74 100644 --- a/app/views/admin/hosts/_host.html.erb +++ b/app/views/admin/hosts/_host.html.erb @@ -1,13 +1,13 @@ - <%= link_to host.name, admin_host_path(host) %> + <%= host.name %> <%= host.fqdn %> <%= host.first_user.display_name %> <%= host.port %> <%= I18n.l(host.created_at, format: :long) %> <%= link_to 'Verify', verify_admin_host_path(host), method: :post, class: "btn btn-success", role: "button", data: { confirm: "Host #{host.name} will be ready to be dispatched to Bacula" } %> diff --git a/config/routes.rb b/config/routes.rb index 1d6b884..d8ececa 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,103 +1,103 @@ Rails.application.routes.draw do root 'application#index' post 'grnet' => 'application#grnet' get 'institutional' => 'application#institutional' match 'vima', to: 'application#vima', :via => [:get, :post] get 'logout' => 'application#logout' resources :clients, only: [:index, :show] do member do get :jobs get :logs get :stats post :stats get :users get :restore post :run_restore post :restore_selected delete :remove_user end collection do post :index end end resources :clients, only: [], param: :client_id do member do get :tree end end resources :invitations, only: [:create] get '/invitations/:host_id/:verification_code/accept' => 'invitations#accept', as: :accept_invitation resources :hosts, only: [:new, :create, :show, :edit, :update, :destroy] do member do post :submit_config post :disable delete :revoke end collection do get :fetch_vima_hosts, to: 'hosts#fetch_vima_hosts', as: :fetch_vima end resources :jobs, only: [:new, :create, :show, :edit, :update, :destroy] do member do patch :toggle_enable post :backup_now end end resources :filesets, only: [:show, :new, :create, :edit, :update, :destroy] resources :schedules, only: [:show, :new, :edit, :create, :update, :destroy] end namespace :admin do match '/', to: 'base#index', via: [:get, :post] get '/login' => 'base#login', as: :login resources :settings, only: [:index, :new, :create, :edit, :update] do member do delete :reset end end resources :clients, only: [:index, :show] do member do get :jobs get :logs get :stats post :stats get :configuration post :disable post :block post :unblock delete :revoke end end - resources :hosts, only: [:show] do + resources :hosts, only: [] do collection do get :unverified end member do post :verify end end resources :users, only: [:index, :new, :create, :show, :edit, :update] do member do patch :ban patch :unban end end resources :pools, only: [:index, :new, :create] end end