configuration_content.rb
817 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
class MezuroPlugin::ConfigurationContent < Article
def self.short_description
'Kalibro configuration'
end
def self.description
'Sets of thresholds to interpret metrics'
end
settings_items :description, :metrics
include ActionView::Helpers::TagHelper
def to_html(options = {})
lambda do
render :file => 'content_viewer/show_configuration.rhtml'
end
end
def configuration #FIXME invalid method name
Kalibro::Client::ConfigurationClient.configuration(name)
end
after_save :send_configuration_to_service
after_destroy :remove_configuration_from_service
private
def send_configuration_to_service
Kalibro::Client::ConfigurationClient.save(self)
end
def remove_configuration_from_service
Kalibro::Client::ConfigurationClient.remove(name)
end
end