Page Menu
Home
GRNET
Search
Configure Global Search
Log In
Files
F461148
hosts_helper.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
Sat, May 17, 11:25 PM
Size
1 KB
Mime Type
text/x-ruby
Expires
Mon, May 19, 11:25 PM (5 h, 46 m)
Engine
blob
Format
Raw Data
Handle
220155
Attached To
rARCHIVING archiving
hosts_helper.rb
View Options
module
HostsHelper
# Returns an html span with the host's status
def
host_status_label
(
host
)
return
unless
host
case
when
host
.
pending?
klass
=
"default"
msg
=
'Client is not configured yet. No backups available'
when
host
.
configured?
klass
=
"warning"
msg
=
'Client is configured. Configuration not yet sent to the backup server. No backups available'
when
host
.
dispatched?
klass
=
"info"
msg
=
'Client is configured. Configuration not yet sent to the backup server. No backups available'
when
host
.
deployed?
klass
=
"success"
msg
=
'Client is OK'
when
host
.
updated?
klass
=
"info"
msg
=
'Client has new configuration, not yet transmitted to the server. Backups are available for the previous config'
when
host
.
redispatched?
klass
=
"primary"
msg
=
'Client has new configuration, not yet transmitted to the server. Backups are available for the previous config'
when
host
.
for_removal?
klass
=
"danger"
msg
=
'Client will be removed'
when
host
.
inactive?
klass
=
"warning"
msg
=
'Client is not yet verified'
when
host
.
blocked?
klass
=
"warning"
msg
=
'Client is blocked by an administrator. No backups available'
end
content_tag
(
:small
,
'data-toggle'
=>
'tooltip'
,
title
:
msg
)
do
content_tag
(
:span
,
class
:
"label label-
#{
klass
}
"
)
{
host
.
human_status_name
.
upcase
}
end
end
end
Event Timeline
Log In to Comment