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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
.block#block-tables
.content
%h2.title Status
.inner
%table.table
%thead
%tr
%th.first Node Name
%th Platform
%th FQDN
%th IP Address
%th Uptime
%th Last Check-in
%th.last Run List
%tbody
- if @status.empty?
%tr
%td{:colspan => 7}= "You appear to have no nodes #{session[:environment].nil? ? '' : "in the #{session[:environment]} environment"} - try connecting one, or creating or editing a #{link_to('client', clients_path)}".html_safe
- else
- @status.sort.each_with_index do |node, index|
%tr{:class => "#{index % 2 == 1 ? 'odd' : 'even'}"}
%td= link_to(node[1].name, node_path(node[1].name))
%td= "#{node[1]["platform"]} #{node[1]["platform_version"]}"
%td= node[1]["fqdn"]
%td= node[1]["ipaddress"]
%td
.accordion
-unless node[1]["uptime"].nil?
= link_to(node[1]["uptime"].split(" ")[0..1].join(" ") , "#", :class => 'tooltip')
.tooltip
%table.table.tooltip
%tbody
%tr
%td= node[1]["uptime"]
- unless node[1]["ohai_time"].nil?
- current_time = Time.now.to_f
- ohai_time = Time.at(node[1]["ohai_time"])
- hours, minutes, seconds = time_difference_in_hms(ohai_time)
- hours_text = "#{hours} hour#{hours == 1 ? '' : 's'}"
- minutes_text = "#{minutes} minute#{minutes == 1 ? '' : 's'}"
%td.flash
- status_class = ""
- if hours > 24
- status_class = "message error"
- elsif hours > 1
- status_class = "message warning"
%div{ :class => status_class }
.accordion
- if hours > 48
- status_msg = "> #{hours/24} days ago"
- elsif hours > 0
- status_msg = "> #{hours_text} ago"
- elsif minutes < 1
- status_msg = "< 1 minute ago"
- else
- status_msg = "#{minutes_text} ago"
= link_to(status_msg, "#", :class=> 'tooltip')
.tooltip
%table.table.tooltip
%tbody
%tr
%td
= ohai_time
%br/
- if hours == 0
= "#{minutes_text} ago"
- else
= "#{hours_text}, #{minutes_text} ago"
- else
%td Not Checked In
- unless node[1].run_list.nil?
%td
.accordion
= link_to("Run List", "#", :class => 'tooltip')
.tooltip
%table.table.tooltip
%thead
%tr
%th.first Position
%th Name
%th Version
%th.last Type
%tbody
- if node[1].run_list.empty?
%tr
%td{:colspan => 2} This node has no roles or recipes applied.
- else
-node[1].run_list.each_with_index do |run_list_item, i|
%tr
%td.position= i
%td= run_list_item.name
%td= run_list_item.version
%td= run_list_item.type
|