| |   |
| 3 | 3 | <% javascript_tag do %> |
| 4 | 4 | $(document).ready(function() { |
| 5 | 5 | |
| $("#services fieldset").each (function(index) { |
| $("#services div.list-fieldset").each (function(index) { |
| 7 | 7 | if ($(this).is(":has(span.status_running)")) { |
| $(this).find("legend .service-icon").attr('class','service-icon running'); |
| $(this).find(".list-fieldset-header .service-icon").attr('class','service-icon status-icon ok'); |
| 9 | 9 | } |
| 10 | 10 | else if ($(this).is(":has(span.status_dead)")) { |
| $(this).find("legend .service-icon").attr('class','service-icon dead'); |
| $(this).find(".list-fieldset-header .service-icon").attr('class','service-icon status-icon error'); |
| 12 | 12 | } |
| 13 | 13 | else { |
| $(this).find("legend .service-icon").attr('class','service-icon unknown'); |
| $(this).find(".list-fieldset-header .service-icon").attr('class','service-icon status-icon unused'); |
| 15 | 15 | } |
| 16 | 16 | }); |
| 17 | 17 | |
| $('#services fieldset').quicksearch({ |
| $('#services div.list-fieldset').quicksearch({ |
| 19 | 19 | attached: '#services', |
| 20 | 20 | loaderText: '', |
| 21 | 21 | labelText: '<%= _("Quick Search")%>', |
| 22 | 22 | delay: 100 |
| 23 | 23 | }); |
| 24 | 24 | |
| $(".accordion").accordion({ |
| autoHeight : false, |
| navigation : true, |
| collapsible: true, |
| header : 'fieldset legend' |
| }); |
|
| $(".accordion").accordion('activate',false); |
| $('.accordion div.list-fieldset:even').addClass('alt-bg'); |
| 33 | 26 | }) |
| 34 | 27 | |
| 35 | 28 | // adapt the status icon of given service |
| 36 | 29 | function toggle_service_info (id) { |
| var heading = $(id).closest('.service-content').siblings('legend'); |
| var heading = $(id).closest('.service-content').siblings('div.list-fieldset-header'); |
| 38 | 31 | if ($(id).is(':has(span.status_running)')) { |
| $(heading).find(".service-icon").attr('class','service-icon running'); |
| $(heading).find(".service-icon").attr('class','service-icon status-icon ok'); |
| 40 | 33 | $(id).siblings('a#start').hide(); |
| 41 | 34 | $(id).siblings('a#stop').show(); |
| 42 | 35 | } |
| 43 | 36 | else if ($(id).is(':has(span.status_dead)')) { |
| $(heading).find(".service-icon").attr('class','service-icon dead'); |
| $(heading).find(".service-icon").attr('class','service-icon status-icon error'); |
| 45 | 38 | $(id).siblings('a#stop').hide(); |
| 46 | 39 | $(id).siblings('a#start').show(); |
| 47 | 40 | } |
| 48 | 41 | else { |
| $(heading).find(".service-icon").attr('class','service-icon unknown'); |
| $(heading).find(".service-icon").attr('class','service-icon status-icon unused'); |
| 50 | 43 | $(id).siblings('a#stop').hide(); |
| 51 | 44 | $(id).siblings('a#start').show(); |
| 52 | 45 | } |
| … | … | |
| 47 | 47 | |
| 48 | 48 | function select_status (val) { |
| 49 | 49 | if (val == "all") { |
| $("#services > fieldset").show(); |
| $("#services > div.list-fieldset").show(); |
| 51 | 51 | } |
| 52 | 52 | else if (val == "not-running") { |
| $('#services > fieldset').each(function(index) { |
| $('#services > div.list-fieldset').each(function(index) { |
| 54 | 54 | if ($(this).is(":has(span.status_not_running)")) { |
| 55 | 55 | $(this).show(); |
| 56 | 56 | } else { |
| … | … | |
| 59 | 59 | }); |
| 60 | 60 | } |
| 61 | 61 | else if (val == "running") { |
| $('#services > fieldset').each(function(index) { |
| $('#services > div.list-fieldset').each(function(index) { |
| 63 | 63 | if ($(this).is(":has(span.status_running)")) { |
| 64 | 64 | $(this).show(); |
| 65 | 65 | } else { |
| … | … | |
| 68 | 68 | }); |
| 69 | 69 | } |
| 70 | 70 | else if (val == "dead") { |
| $('#services > fieldset').each(function(index) { |
| $('#services > div.list-fieldset').each(function(index) { |
| 72 | 72 | if ($(this).is(":has(span.status_dead)")) { |
| 73 | 73 | $(this).show(); |
| 74 | 74 | } else { |
| … | … | |
| 78 | 78 | }; |
| 79 | 79 | } |
| 80 | 80 | <% end %> |
| <% content_for :before_script do %> |
| <% javascript_tag do %> |
| $(document).ready(function(){ |
| $(".accordion").accordion({ |
| autoHeight : false, |
| navigation : true, |
| collapsible: true, |
| header : 'div.list-fieldset div.list-fieldset-header' |
| }); |
| $(".accordion").accordion('activate',false); |
| }); |
| <% end %> |
| <% end %> |
| 81 | 94 | |
|
| 82 | 96 | <div class='plugin-icon'><img src='/icons/yast-system.png' alt=''/><%= _("System Services") %></div> |
| 83 | 97 | |
| 84 | 98 | <div class="plugin-content grid_12"> |
| … | … | |
| 117 | 117 | <% |
| 118 | 118 | commands = [ "start", "stop", "restart", ] |
| 119 | 119 | @services.each do |service| %> |
| <fieldset class="wrapper with-background"> |
| <div class="list-fieldset"> |
| 121 | 121 | |
| <legend><span class="service-icon"></span><%=service.name %> <em style="position:absolute; left:25%"><%=service.summary%></em></legend> |
| <div class="list-fieldset-header"><span class="service-icon"></span><%=service.name %> <em style="position:absolute; left:25%"><%=service.summary%></em></div> |
| 123 | 123 | |
| <div class='service-content'> |
| <div class='service-content' style="display:none"> |
| 125 | 125 | |
| 126 | 126 | <p class='description'> |
| 127 | 127 | <i><%= service.description ? h(service.description) : _("Description for service is not available") %></i> |
| … | … | |
| 187 | 187 | <%= render :partial => 'result' %> |
| 188 | 188 | </span> |
| 189 | 189 | </div> |
| </fieldset> |
| </div> |
| 191 | 191 | <% end %> |
| 192 | 192 | </div> |
| 193 | 193 | <fieldset> |