[% USE CPSort -%] [% USE JSON -%] [% USE cycle = Cycle( 'tdshade1', 'tdshade2' ) %]
[%- FOREACH s IN services; NEXT IF !s.suboptions; SET checked_state = 'checked'; IF s.disabled == 0; SET checked_state = ''; END; SET enabled_onclick = ''; IF s.name == 'tailwatchd'; SET enabled_onclick = 'onclick="toggle_monitoring_available( this )"'; END; -%]
[% s.name FILTER html %]
[%- FOREACH suboption IN s.suboptions -%] [%- SET sub_disabled_state = '' -%] [%- SET sub_checked_state = 'checked' -%] [%- IF !suboption.managed -%] [%- SET sub_disabled_state = 'disabled="disabled"' -%] [%- END -%] [%- IF suboption.disabled -%] [%- SET sub_checked_state = '' -%] [%- END -%] [%- SET sub_onclick = '' -%] [%- IF suboption.name == 'ChkServd' -%] [%- SET sub_onclick = 'onclick="toggle_monitoring_available( this )"' -%] [%- END -%] [%- END -%]
[% locale.maketext('Enabled') %]   [% s.subopt_heading FILTER html %]
[% IF !suboption.managed && !sub_disabled_state %] [% END %]   [%- suboption.name FILTER html -%]
[%- suboption.description FILTER html -%]
[%- END -%]
[% locale.maketext("Deselect a service to disable it.") %]
[%- FOREACH s IN services.cpsort('group','name') -%] [%- NEXT IF s.suboptions -%] [%- SET monitored_state = '' %] [%- IF s.monitored == 1 && !s.always_unmonitored -%] [%- SET monitored_state = 'checked' -%] [%- END -%] [%- SET checked_state = 'checked' -%] [%- IF s.disabled == 0 && !s.always_enabled || s.always_disabled -%] [%- SET checked_state = '' -%] [%- END -%] [%- SET disabled_state = '' -%] [%- SET tooltip = locale.maketext('Service “[_1]” may be disabled.', s.name.html()) -%] [%- IF s.always_enabled -%] [%- SET disabled_state = 'disabled' -%] [%- SET tooltip = locale.maketext('Normal operation requires “[_1]” and it cannot be disabled.', s.name.html()) -%] [%- ELSIF s.always_disabled -%] [%- SET disabled_state = 'disabled' -%] [%- SET tooltip = locale.maketext('This service is enabled and disabled elsewhere.') -%] [%- END -%] [%- END -%]
[% locale.maketext('Enabled') %] [% locale.maketext('Monitor[comment,to observe]') %] [% locale.maketext('Service Information') %]
[% IF s.monitored == -1 %]   [% ELSIF s.always_unmonitored == 1 %] [% END %] [% s.display_name # prefiltered %]
[%- SET desc_key = s.exists("description_" _ s.altname) ? "description_" _ s.altname : "description" -%] [%- s.$desc_key %] [%- IF s.setting %]
[% s.note FILTER html %] [%- END -%]
[% IF s.$desc_key == "PowerDNS" %]
[% END %]
[%- IF extraservices.size() -%]
[% locale.maketext("Additional Services") %]
[%- FOREACH s IN extraservices -%] [%- SET monitored_state = '' %] [%- IF s.monitored == 1 -%] [%- SET monitored_state = 'checked' -%] [%- END -%] [%- SET checked_state = 'checked' -%] [%- IF s.disabled == 0 -%] [%- SET checked_state = '' -%] [%- END -%] [%- END -%]
[% locale.maketext('Enabled') %] [% locale.maketext('Monitor[comment,to observe]') %] [% locale.maketext('Service Information') %]
[% s.name FILTER html %]
[%- END -%]