Merge branch 'master' of github.com:warpc/rosa-build
This commit is contained in:
commit
8f3ffbe827
|
@ -17,6 +17,9 @@ class BuildListsController < ApplicationController
|
|||
end
|
||||
@action_url = all_build_lists_path
|
||||
|
||||
@build_server_status = BuildServer.get_status
|
||||
#@build_server_status = {:client_count => '1', :count_new_task => '2', :count_build_task => 3}
|
||||
|
||||
render :action => 'index'
|
||||
end
|
||||
|
||||
|
|
|
@ -17,9 +17,13 @@ class UsersController < ApplicationController
|
|||
|
||||
def new
|
||||
@user = User.new
|
||||
@global_roles = Role.by_acter(User).by_target(:system) + Role.by_acter(:all).by_target(:system)
|
||||
@global_roles.map! {|role| [role.name, role.id]}
|
||||
end
|
||||
|
||||
def edit
|
||||
@global_roles = Role.by_acter(User).by_target(:system) + Role.by_acter(:all).by_target(:system)
|
||||
@global_roles.map! {|role| [role.name, role.id]}
|
||||
end
|
||||
|
||||
def create
|
||||
|
@ -34,6 +38,7 @@ class UsersController < ApplicationController
|
|||
end
|
||||
|
||||
def update
|
||||
puts params[:user].inspect
|
||||
if @user.update_attributes(params[:user])
|
||||
flash[:notice] = t('flash.user.saved')
|
||||
redirect_to users_path
|
||||
|
|
|
@ -30,7 +30,7 @@ class User < ActiveRecord::Base
|
|||
errors.add(:uname, I18n.t('flash.user.group_uname_exists')) if Group.exists? :uname => uname
|
||||
}
|
||||
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :login, :name, :ssh_key, :uname
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me, :login, :name, :ssh_key, :uname, :global_role_id
|
||||
attr_readonly :uname
|
||||
attr_accessor :login
|
||||
|
||||
|
|
|
@ -6,6 +6,18 @@
|
|||
%li.active= link_to t("layout.build_lists.all"), project_build_lists_path(@project)
|
||||
|
||||
.content
|
||||
- if controller.action_name == 'all'
|
||||
.inner
|
||||
%h2= t('layout.build_lists.build_server_status.header')
|
||||
.field
|
||||
%span= t('layout.build_lists.build_server_status.client_count') + ":"
|
||||
%span= @build_server_status[:client_count]
|
||||
.field
|
||||
%span= t('layout.build_lists.build_server_status.count_new_task') + ":"
|
||||
%span= @build_server_status[:count_new_task]
|
||||
.field
|
||||
%span= t('layout.build_lists.build_server_status.count_build_task') + ":"
|
||||
%span= @build_server_status[:count_build_task]
|
||||
|
||||
.inner
|
||||
= render :partial => "build_lists/filter", :action_url => @action_url
|
||||
|
|
|
@ -7,6 +7,9 @@
|
|||
.group
|
||||
= f.label :email, t("activerecord.attributes.user.email"), :class => :label
|
||||
= f.text_field :email, :class => 'text_field'
|
||||
.group
|
||||
= f.label :global_role_id, t("activerecord.attributes.user.global_role"), :class => :label
|
||||
= f.select :global_role_id, options_for_select(@global_roles, @user.global_role_id)
|
||||
.group
|
||||
= f.label :ssh_key, t("activerecord.attributes.user.ssh_key"), :class => :label
|
||||
= f.text_area :ssh_key, :class => 'text_area'
|
||||
|
|
|
@ -21,6 +21,11 @@
|
|||
= t("activerecord.attributes.user.email")
|
||||
\:
|
||||
= @user.email
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.user.global_role")
|
||||
\:
|
||||
= @user.global_role.name
|
||||
%p
|
||||
%b
|
||||
= t("activerecord.attributes.user.created_at")
|
||||
|
|
|
@ -229,6 +229,12 @@ ru:
|
|||
cancel_successed: 'Сборка отменена.'
|
||||
cancel_failed: 'При отмене сборки произошла ошибка!'
|
||||
|
||||
build_server_status:
|
||||
header: Статус сборочного сервера
|
||||
client_count: Число клиентов
|
||||
count_new_task: Число заданий в очереди
|
||||
count_build_task: Число выполняемых заданий
|
||||
|
||||
items:
|
||||
statuses:
|
||||
build_error: ошибка сборки
|
||||
|
|
|
@ -314,8 +314,8 @@ API для работы с ACL
|
|||
|
||||
- `can_perform? (target = :system)` -- может ли `current_user` выполнить
|
||||
текущее действие
|
||||
- `check_global_rights` -- делает редирект назад, если пользователь вообще
|
||||
не может совершить текущее действие
|
||||
- `check_global_access` -- делает редирект назад или на главную, если
|
||||
пользователь вообще не может совершить текущее действие
|
||||
- `roles_to(object)` -- возвращает список ролей `current_user`-а по отношению
|
||||
к объекту
|
||||
- `rights_to(object)` -- возвращает список прав `current_user`-а по отношению
|
||||
|
|
|
@ -76,6 +76,10 @@ class BuildServer
|
|||
self.client.call('delete_build_list', idlist)
|
||||
end
|
||||
|
||||
def get_status
|
||||
self.client.call('get_status')
|
||||
end
|
||||
|
||||
def self.freeze platform_name, new_repo_name = nil
|
||||
self.client.call('freeze_platform', platform_name, new_repo_name)
|
||||
end
|
||||
|
|
|
@ -129,7 +129,7 @@ class ActiveRecord::Base
|
|||
h
|
||||
end
|
||||
vis = vis[self.name]
|
||||
return [] if !vis or vis.empty?
|
||||
return where('1=2') if !vis or vis.empty?
|
||||
if vis == self::VISIBILITIES
|
||||
return scoped # all
|
||||
else
|
||||
|
|
Loading…
Reference in New Issue