Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F887819
pools_controller.rb
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Aug 10, 5:40 AM
Size
1 KB
Mime Type
text/x-ruby
Expires
Tue, Aug 12, 5:40 AM (12 h, 39 m)
Engine
blob
Format
Raw Data
Handle
243741
Attached To
rARCHIVING archiving
pools_controller.rb
View Options
class
Admin
::
PoolsController
<
Admin
::
BaseController
before_action
:fetch_pool
,
only
:
[
:show
,
:edit
,
:update
]
# GET /admin/pools
def
index
@pools
=
Pool
.
all
end
# GET /admin/pools/new
def
new
@pool
=
Pool
.
new
end
# GET /admin/pools/:id/edit
def
edit
;
end
# GET /admin/pools/:id
def
show
;
end
# POST /admin/pools
def
create
@pool
=
Pool
.
new
(
fetch_params
)
if
@pool
.
submit_to_bacula
flash
[
:success
]
=
'Pool created succesfully'
redirect_to
admin_pools_path
else
flash
[
:alert
]
=
'Pool not created'
render
:new
end
end
# PATCH /admin/pools/:id
def
update
if
@pool
.
update_attributes
(
fetch_params
)
flash
[
:success
]
=
'Pool updated succesfully'
redirect_to
admin_pools_path
else
flash
[
:alert
]
=
'Pool not updated'
render
:edit
end
end
private
def
fetch_pool
@pool
=
Pool
.
find
(
params
[
:id
]
)
end
def
fetch_params
params
.
require
(
:pool
)
.
permit
(
[
:name
,
:name_confirmation
,
:vol_retention
,
:use_once
,
:auto_prune
,
:recycle
,
:max_vols
,
:max_vol_jobs
,
:max_vol_files
,
:max_vol_bytes
,
:label_format
]
)
end
end
Event Timeline
Log In to Comment