Commit 976bb3b9 authored by gubala's avatar gubala

user service testing code

parent 3a0b0223
......@@ -46,21 +46,21 @@ class User < ActiveRecord::Base
begin
GFTP::Exists.new.exists "/people/#{user.login}/", user.proxy do |test|
logger.info "ZEUS DIR CHECK: #{test} (the test took: #{Time.now - t})"
# TODO FIXME set zeus to true
user.zeus_enabled = test
end
rescue
logger.info "ZEUS DIR CHECK: false (the test took: #{Time.now - t})"
# TODO FIXME set zeus to false
user.zeus_enabled = false
end
begin
GFTP::Exists.new.exists "gsiftp://#{Plgdata::Application.config.prometheus_gridftp_host}/net/people/#{user.login}/", user.proxy do |test|
logger.info "PROM DIR CHECK: #{test} (the test took: #{Time.now - t})"
# TODO FIXME set prom to true
user.prometheus_enabled = test
end
rescue
logger.info "PROM DIR CHECK: false (the test took: #{Time.now - t})"
# TODO FIXME set prom to false
user.prometheus_enabled = false
end
user.save
......
......@@ -12,22 +12,23 @@
- if current_user.present?
%li.dropdown
%a.navbar-btn.dropdown-toggle(href="#" data-toggle="dropdown")
= t('folder_shortcuts') + ' Zeus'
%b.caret
%ul.dropdown-menu
%li
= link_to 'Home', folder_path(path: "/people/#{current_user.login}/")
%li
= link_to 'Storage', folder_path(path: "/mnt/gpfs/work/people/#{current_user.login}/")
%li
= link_to 'Scratch', folder_path(path: "/mnt/lustre/scratch2/people/#{current_user.login}/")
- current_user.user_teams.each do |user_team|
- if current_user.zeus_enabled
%li.dropdown
%a.navbar-btn.dropdown-toggle(href="#" data-toggle="dropdown")
= t('folder_shortcuts') + ' Zeus'
%b.caret
%ul.dropdown-menu
%li
= link_to user_team.name, folder_path(path: "/mnt/gpfs/work/plgrid/groups/#{user_team.shortname}/")
= link_to 'Home', folder_path(path: "/people/#{current_user.login}/")
%li
= link_to 'Storage', folder_path(path: "/mnt/gpfs/work/people/#{current_user.login}/")
%li
= link_to 'Scratch', folder_path(path: "/mnt/lustre/scratch2/people/#{current_user.login}/")
- current_user.user_teams.each do |user_team|
%li
= link_to user_team.name, folder_path(path: "/mnt/gpfs/work/plgrid/groups/#{user_team.shortname}/")
- if current_user.beta?
- if current_user.prometheus_enabled
%li.dropdown
%a.navbar-btn.dropdown-toggle(href="#" data-toggle="dropdown")
= t('folder_shortcuts') + ' Prometheus'
......
class AddServiceFlagsToUsers < ActiveRecord::Migration
def change
add_column :users, :zeus_enabled, :boolean, null: false, default: false
add_column :users, :prometheus_enabled, :boolean, null: false, default: false
end
end
......@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20141128090807) do
ActiveRecord::Schema.define(version: 20160223145049) do
create_table "api_clients", force: true do |t|
t.string "ip", default: "", null: false
......@@ -64,25 +64,27 @@ ActiveRecord::Schema.define(version: 20141128090807) do
end
create_table "users", force: true do |t|
t.string "login", null: false
t.string "name", default: "", null: false
t.string "surname", default: "", null: false
t.string "login", null: false
t.string "name", default: "", null: false
t.string "surname", default: "", null: false
t.text "proxy"
t.datetime "not_before"
t.datetime "not_after"
t.string "dn"
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "email", default: "", null: false
t.string "encrypted_password", default: "", null: false
t.string "reset_password_token"
t.datetime "reset_password_sent_at"
t.datetime "remember_created_at"
t.integer "sign_in_count", default: 0, null: false
t.integer "sign_in_count", default: 0, null: false
t.datetime "current_sign_in_at"
t.datetime "last_sign_in_at"
t.string "current_sign_in_ip"
t.string "last_sign_in_ip"
t.datetime "created_at"
t.datetime "updated_at"
t.boolean "zeus_enabled", default: false, null: false
t.boolean "prometheus_enabled", default: false, null: false
end
add_index "users", ["email"], name: "index_users_on_email", unique: true, using: :btree
......
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