* fixing bad name in debian scripts from audimxer to audiomixer
This commit is contained in:
parent
660e452996
commit
f79d3bdd70
|
|
@ -0,0 +1,61 @@
|
|||
ActiveAdmin.register JamRuby::MusicSessionHistory, :as => 'Music Session History', :sort_order => 'created_at DESC' do
|
||||
|
||||
config.filters = false
|
||||
config.per_page = 50
|
||||
config.clear_action_items!
|
||||
|
||||
controller do
|
||||
def scoped_collection
|
||||
if params['admin'].blank? || '1' == params['admin']
|
||||
@music_session_histories ||= end_of_association_chain
|
||||
.includes([:user, :band])
|
||||
.order('created_at DESC')
|
||||
else
|
||||
@music_session_histories ||= end_of_association_chain
|
||||
.joins('INNER JOIN users AS uu ON uu.id = music_sessions_history.user_id')
|
||||
.where(['uu.admin = ?','f'])
|
||||
.includes([:user, :band])
|
||||
.order('created_at DESC')
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
index :as => :block do |msh|
|
||||
div :for => msh do
|
||||
h3 "Session ##{msh.music_session_id}: #{msh.created_at.strftime('%b %d %Y, %H:%M')}"
|
||||
h4 "(append URL with ?admin=0 to hide admin sessions)"
|
||||
columns do
|
||||
column do
|
||||
panel 'Session Details' do
|
||||
attributes_table_for(msh) do
|
||||
row :description
|
||||
row :duration do |msh| "#{msh.duration_minutes} minutes" end
|
||||
row :active do |msh| msh.session_removed_at.nil? end
|
||||
row :creator do |msh| auto_link(msh.user, msh.user.try(:email)) end
|
||||
row :band do |msh| auto_link(msh.band, msh.band.try(:name)) end
|
||||
row :genres
|
||||
end
|
||||
end
|
||||
end
|
||||
column do
|
||||
panel 'User Details' do
|
||||
table_for(msuh = msh.music_session_user_histories) do
|
||||
column :user do |msuh| msuh.user_email end
|
||||
column :joined do |msuh| msuh.created_at.strftime('%b %d %Y, %H:%M') end
|
||||
column :duration do |msuh| "#{msuh.duration_minutes} minutes" end
|
||||
column :active do |msuh| msuh.session_removed_at.nil? end
|
||||
column :perf_data do |msuh|
|
||||
unless (uu = msuh.perf_uri).blank?
|
||||
link_to('Data Link', uu)
|
||||
else
|
||||
''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -1,8 +0,0 @@
|
|||
ActiveAdmin.register JamRuby::User do
|
||||
# define routes for "autocomplete :admin_user, :email"
|
||||
collection_action :autocomplete_user_email, :method => :get
|
||||
|
||||
controller do
|
||||
autocomplete :invited_user, :email
|
||||
end
|
||||
end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
desc 'Print out all defined routes in match order, with names. Target specific controller with CONTROLLER=x.'
|
||||
task routes: :environment do
|
||||
all_routes = Rails.application.routes.routes
|
||||
require 'action_dispatch/routing/inspector'
|
||||
inspector = ActionDispatch::Routing::RoutesInspector.new(all_routes)
|
||||
puts inspector.format(ActionDispatch::Routing::ConsoleFormatter.new, ENV['CONTROLLER'])
|
||||
end
|
||||
|
|
@ -21,7 +21,7 @@ chown -R $USER:$GROUP /var/log/$NAME
|
|||
|
||||
|
||||
# do the same for audiomixer-worker
|
||||
NAME="audiomxer-worker"
|
||||
NAME="audiomixer-worker"
|
||||
|
||||
USER="$NAME"
|
||||
GROUP="$NAME"
|
||||
|
|
@ -36,23 +36,4 @@ mkdir -p /var/log/$NAME
|
|||
|
||||
chown -R $USER:$GROUP /var/lib/$NAME
|
||||
chown -R $USER:$GROUP /etc/$NAME
|
||||
chown -R $USER:$GROUP /var/log/$NAME
|
||||
|
||||
|
||||
# do the same for icecast-worker
|
||||
NAME="icecast-worker"
|
||||
|
||||
USER="$NAME"
|
||||
GROUP="$NAME"
|
||||
|
||||
# copy upstart file
|
||||
cp /var/lib/$NAME/script/package/$NAME.conf /etc/init/$NAME.conf
|
||||
|
||||
mkdir -p /var/lib/$NAME/log
|
||||
mkdir -p /var/lib/$NAME/tmp
|
||||
mkdir -p /etc/$NAME
|
||||
mkdir -p /var/log/$NAME
|
||||
|
||||
chown -R $USER:$GROUP /var/lib/$NAME
|
||||
chown -R $USER:$GROUP /etc/$NAME
|
||||
chown -R $USER:$GROUP /var/log/$NAME
|
||||
chown -R $USER:$GROUP /var/log/$NAME
|
||||
|
|
@ -51,28 +51,3 @@ then
|
|||
|
||||
userdel $NAME
|
||||
fi
|
||||
|
||||
|
||||
NAME="icecast-worker"
|
||||
|
||||
set -e
|
||||
if [ "$1" = "remove" ]
|
||||
then
|
||||
set +e
|
||||
# stop the process, if any is found. we don't want this failing to cause an error, though.
|
||||
sudo stop $NAME
|
||||
set -e
|
||||
|
||||
if [ -f /etc/init/$NAME.conf ]; then
|
||||
rm /etc/init/$NAME.conf
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ "$1" = "purge" ]
|
||||
then
|
||||
if [ -d /var/lib/$NAME ]; then
|
||||
rm -rf /var/lib/$NAME
|
||||
fi
|
||||
|
||||
userdel $NAME
|
||||
fi
|
||||
|
|
|
|||
|
|
@ -73,41 +73,3 @@ fi
|
|||
|
||||
# NIS no longer a possible problem; stop ignoring errors
|
||||
set -e
|
||||
|
||||
|
||||
|
||||
# do the same for icecast-worker
|
||||
NAME="icecast-worker"
|
||||
|
||||
set -eu
|
||||
|
||||
HOME="/var/lib/$NAME"
|
||||
USER="$NAME"
|
||||
GROUP="$NAME"
|
||||
|
||||
# if NIS is used, then errors can occur but be non-fatal
|
||||
if which ypwhich >/dev/null 2>&1 && ypwhich >/dev/null 2>&1
|
||||
then
|
||||
set +e
|
||||
fi
|
||||
|
||||
if ! getent group "$GROUP" >/dev/null
|
||||
then
|
||||
addgroup --system "$GROUP" >/dev/null
|
||||
fi
|
||||
|
||||
# creating user if it isn't already there
|
||||
if ! getent passwd "$USER" >/dev/null
|
||||
then
|
||||
adduser \
|
||||
--system \
|
||||
--home $HOME \
|
||||
--shell /bin/false \
|
||||
--disabled-login \
|
||||
--ingroup "$GROUP" \
|
||||
--gecos "$USER" \
|
||||
"$USER" >/dev/null
|
||||
fi
|
||||
|
||||
# NIS no longer a possible problem; stop ignoring errors
|
||||
set -e
|
||||
Loading…
Reference in New Issue