summaryrefslogtreecommitdiff
path: root/lib/oxidized/api/web/views
diff options
context:
space:
mode:
Diffstat (limited to 'lib/oxidized/api/web/views')
-rw-r--r--lib/oxidized/api/web/views/default.haml4
-rw-r--r--lib/oxidized/api/web/views/head.haml3
-rw-r--r--lib/oxidized/api/web/views/node.haml6
-rw-r--r--lib/oxidized/api/web/views/nodes.haml27
4 files changed, 40 insertions, 0 deletions
diff --git a/lib/oxidized/api/web/views/default.haml b/lib/oxidized/api/web/views/default.haml
new file mode 100644
index 0000000..1ff1f4b
--- /dev/null
+++ b/lib/oxidized/api/web/views/default.haml
@@ -0,0 +1,4 @@
+%html
+ !=haml :head
+ %body
+ =@data
diff --git a/lib/oxidized/api/web/views/head.haml b/lib/oxidized/api/web/views/head.haml
new file mode 100644
index 0000000..1619512
--- /dev/null
+++ b/lib/oxidized/api/web/views/head.haml
@@ -0,0 +1,3 @@
+%head
+ %title oxidized
+ %link{:rel=>'stylesheet', :href=>'/css/oxidized.css'}
diff --git a/lib/oxidized/api/web/views/node.haml b/lib/oxidized/api/web/views/node.haml
new file mode 100644
index 0000000..6c68e07
--- /dev/null
+++ b/lib/oxidized/api/web/views/node.haml
@@ -0,0 +1,6 @@
+%html
+ !=haml :head
+ %body
+ -out='';PP.pp(@data,out)
+ %pre
+ =out
diff --git a/lib/oxidized/api/web/views/nodes.haml b/lib/oxidized/api/web/views/nodes.haml
new file mode 100644
index 0000000..4bc0b14
--- /dev/null
+++ b/lib/oxidized/api/web/views/nodes.haml
@@ -0,0 +1,27 @@
+%html
+ !=haml :head
+ %body
+ %a(href="/reload") reload list of nodes
+ %table
+ %tr
+ %th Name
+ %th IP
+ %th Group
+ %th Last Status
+ %th Last Time
+ %th Config
+ %th Update
+ -trclass = %w(even odd)
+ -@data.sort_by{|e|e[:name]}.each do |node|
+ -klass = trclass.rotate!.first
+ %tr{:class=>klass}
+ %td
+ %a(href="/node/show/#{node[:name]}") #{node[:name]}
+ %td= node[:ip]
+ %td= node[:group]
+ %td= node[:status]
+ %td= node[:time]
+ %td
+ %a(href="/node/fetch/#{node[:full_name]}") config
+ %td
+ %a(href="/node/next/#{node[:full_name]}") update