* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2013-11-12 9:21 Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2013-11-12 9:21 UTC (permalink / raw
To: gentoo-commits
commit: e1b1538c893ca1e13505bc763143817c9f44a5c9
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Tue Nov 12 09:19:43 2013 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Tue Nov 12 09:19:43 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=e1b1538c
Implement proper sorting
---
lib/notice_store.rb | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/notice_store.rb b/lib/notice_store.rb
index abb8fb3..efd98f6 100644
--- a/lib/notice_store.rb
+++ b/lib/notice_store.rb
@@ -23,8 +23,7 @@ class NoticeStore
end
end
- # Name your stuff with YYYYMMDD-foo to get the newest notices on top
- @notices.reverse!
+ @notices.sort! { |a, b| b['created_at'] <=> a['created_at'] }
@load_date = DateTime.now
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-01-16 16:43 Alex Legler
2014-01-18 12:10 ` Alex Legler
0 siblings, 1 reply; 18+ messages in thread
From: Alex Legler @ 2014-01-16 16:43 UTC (permalink / raw
To: gentoo-commits
commit: cea2c20159abf54d737735db543d0db82fc57bc0
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Jan 11 11:20:46 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 11:20:46 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=cea2c201
Properly clear the ServiceRegistry cache
---
lib/service_registry.rb | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index 61e51c5..d3980a2 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -65,11 +65,11 @@ module HelperMethods
end
class ServiceRegistry
+ CACHE_SECONDS = 600
StatusSource = File.join(File.dirname(__FILE__), '..', 'data', 'status.json')
include Singleton
include HelperMethods
- attr_reader :services, :status_data
def initialize
end
@@ -78,10 +78,28 @@ class ServiceRegistry
@services[name] = block.call
end
+ def services
+ update?
+ @services
+ end
+
+ def status_data
+ update?
+ @status_data
+ end
+
def update!
@services = {}
@status_data = JSON.parse(File.read(StatusSource))
load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb'))
+ @load_date = DateTime.now
+ end
+
+ private
+ def update?
+ if ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
+ update!
+ end
end
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-01-16 16:43 Alex Legler
2014-01-18 12:10 ` Alex Legler
0 siblings, 1 reply; 18+ messages in thread
From: Alex Legler @ 2014-01-16 16:43 UTC (permalink / raw
To: gentoo-commits
commit: fcd973a11b093d8969f51a3b712900e85a645f92
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Jan 11 13:08:05 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 13:08:05 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=fcd973a1
Fix recursion in update logic
---
lib/service_registry.rb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index 7ac5f85..f21a74a 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -74,6 +74,7 @@ class ServiceRegistry
attr_reader :load_date
def initialize
+ @cache_locked = false
end
def service(name, &block)
@@ -91,15 +92,17 @@ class ServiceRegistry
end
def update!
+ @cache_locked = true
@services = {}
@status_data = JSON.parse(File.read(StatusSource))
load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb'))
@load_date = DateTime.now
+ @cache_locked = false
end
private
def update?
- if not @load_date.nil? and ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
+ if not @load_date.nil? and not @cache_locked and ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
update!
end
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
2014-01-18 12:10 Alex Legler
@ 2014-01-16 16:43 ` Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-01-16 16:43 UTC (permalink / raw
To: gentoo-commits
commit: fc2c6bbe700d91666ae411c54f6ee31462028250
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Jan 11 11:20:46 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 11:26:17 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=fc2c6bbe
Properly clear the ServiceRegistry cache
---
lib/service_registry.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index d3980a2..b1640ff 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -1,5 +1,6 @@
require 'singleton'
require 'json'
+require 'date'
# Defining state constants
module State
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
2014-01-18 12:10 Alex Legler
@ 2014-01-16 16:43 ` Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-01-16 16:43 UTC (permalink / raw
To: gentoo-commits
commit: 0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Tue Jan 14 16:24:24 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Tue Jan 14 16:24:24 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=0d3ec0cb
Rescue JSON parse failures
In case of an error, set a date in the past to retry next request.
---
lib/service_registry.rb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index f21a74a..19734e3 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -98,6 +98,10 @@ class ServiceRegistry
load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb'))
@load_date = DateTime.now
@cache_locked = false
+ rescue Exception
+ @services = {}
+ @load_date = DateTime.new(2000, 1, 1)
+ @cache_locked = false
end
private
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
2014-01-16 16:43 Alex Legler
@ 2014-01-18 12:10 ` Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-01-18 12:10 UTC (permalink / raw
To: gentoo-commits
commit: cea2c20159abf54d737735db543d0db82fc57bc0
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Jan 11 11:20:46 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 11:20:46 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=cea2c201
Properly clear the ServiceRegistry cache
---
lib/service_registry.rb | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index 61e51c5..d3980a2 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -65,11 +65,11 @@ module HelperMethods
end
class ServiceRegistry
+ CACHE_SECONDS = 600
StatusSource = File.join(File.dirname(__FILE__), '..', 'data', 'status.json')
include Singleton
include HelperMethods
- attr_reader :services, :status_data
def initialize
end
@@ -78,10 +78,28 @@ class ServiceRegistry
@services[name] = block.call
end
+ def services
+ update?
+ @services
+ end
+
+ def status_data
+ update?
+ @status_data
+ end
+
def update!
@services = {}
@status_data = JSON.parse(File.read(StatusSource))
load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb'))
+ @load_date = DateTime.now
+ end
+
+ private
+ def update?
+ if ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
+ update!
+ end
end
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-01-18 12:10 Alex Legler
2014-01-16 16:43 ` Alex Legler
0 siblings, 1 reply; 18+ messages in thread
From: Alex Legler @ 2014-01-18 12:10 UTC (permalink / raw
To: gentoo-commits
commit: 0d3ec0cbeb392e1f226ff9b293552c9131b7c6fd
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Tue Jan 14 16:24:24 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Tue Jan 14 16:24:24 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=0d3ec0cb
Rescue JSON parse failures
In case of an error, set a date in the past to retry next request.
---
lib/service_registry.rb | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index f21a74a..19734e3 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -98,6 +98,10 @@ class ServiceRegistry
load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb'))
@load_date = DateTime.now
@cache_locked = false
+ rescue Exception
+ @services = {}
+ @load_date = DateTime.new(2000, 1, 1)
+ @cache_locked = false
end
private
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-01-18 12:10 Alex Legler
2014-01-16 16:43 ` Alex Legler
0 siblings, 1 reply; 18+ messages in thread
From: Alex Legler @ 2014-01-18 12:10 UTC (permalink / raw
To: gentoo-commits
commit: fc2c6bbe700d91666ae411c54f6ee31462028250
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Jan 11 11:20:46 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 11:26:17 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=fc2c6bbe
Properly clear the ServiceRegistry cache
---
lib/service_registry.rb | 1 +
1 file changed, 1 insertion(+)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index d3980a2..b1640ff 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -1,5 +1,6 @@
require 'singleton'
require 'json'
+require 'date'
# Defining state constants
module State
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
2014-01-16 16:43 Alex Legler
@ 2014-01-18 12:10 ` Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-01-18 12:10 UTC (permalink / raw
To: gentoo-commits
commit: fcd973a11b093d8969f51a3b712900e85a645f92
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Jan 11 13:08:05 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Jan 11 13:08:05 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=fcd973a1
Fix recursion in update logic
---
lib/service_registry.rb | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index 7ac5f85..f21a74a 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -74,6 +74,7 @@ class ServiceRegistry
attr_reader :load_date
def initialize
+ @cache_locked = false
end
def service(name, &block)
@@ -91,15 +92,17 @@ class ServiceRegistry
end
def update!
+ @cache_locked = true
@services = {}
@status_data = JSON.parse(File.read(StatusSource))
load(File.join(File.dirname(__FILE__), '..', 'data', 'services.rb'))
@load_date = DateTime.now
+ @cache_locked = false
end
private
def update?
- if not @load_date.nil? and ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
+ if not @load_date.nil? and not @cache_locked and ((DateTime.now - @load_date) * 60 * 60 * 24).to_i > CACHE_SECONDS
update!
end
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-04-17 16:52 Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-04-17 16:52 UTC (permalink / raw
To: gentoo-commits
commit: 9816353aa5ef74b8475a28970cf2700750e4a1f3
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Thu Apr 17 16:52:15 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Thu Apr 17 16:52:15 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=9816353a
Make only active notices apply overrides
---
lib/helpers.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index ec65b37..2b737e9 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -20,7 +20,7 @@ helpers do
def service_info(service)
content = ''
- active_notices = NoticeStore.instance.visible_notices_for(service)
+ active_notices = NoticeStore.instance.active_notices_for(service)
unless (forced_state = get_forced_state(active_notices)) == nil
content << status_icon(forced_state)
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-04-17 16:59 Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-04-17 16:59 UTC (permalink / raw
To: gentoo-commits
commit: c0b3436592c5ed7471949c3b65240014f00d9b42
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Thu Apr 17 16:59:24 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Thu Apr 17 16:59:24 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=c0b34365
...but all visible notices count when calculating the number of items
---
lib/helpers.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index 2b737e9..7693239 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -21,6 +21,7 @@ helpers do
def service_info(service)
content = ''
active_notices = NoticeStore.instance.active_notices_for(service)
+ visible_notices = NoticeStore.instance.visible_notices_for(service)
unless (forced_state = get_forced_state(active_notices)) == nil
content << status_icon(forced_state)
@@ -37,7 +38,7 @@ helpers do
end
end
- content << '<span class="badge" style="margin-right: 1em;" title="There are notices (%s) below regarding this service.">%s</span>' % [active_notices.count, active_notices.count] if active_notices.count > 0
+ content << '<span class="badge" style="margin-right: 1em;" title="There are notices (%s) below regarding this service.">%s</span>' % [visible_notices.count, visible_notices.count] if visible_notices.count > 0
content
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-04-26 14:35 Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-04-26 14:35 UTC (permalink / raw
To: gentoo-commits
commit: bd69c347389e01b910b6b8f34f7f164e0e47823b
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Sat Apr 26 14:34:43 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Sat Apr 26 14:34:43 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=bd69c347
Fix tooltip location to avoid :last-child bugs
---
lib/helpers.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index 85c62e0..9b37c49 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -24,7 +24,7 @@ helpers do
services.each do |service|
content << "
<a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{status_text(service_status(service))}\"
- data-toggle=\"tooltip\" data-placement=\"top\"
+ data-toggle=\"tooltip\" data-placement=\"top\" data-container=\"body\"
data-service=\"#{service}\" data-service-name=\"#{ServiceRegistry.instance.services[service][:name].gsub '"', "'"}\">
#{service_info service}
#{ServiceRegistry.instance.services[service][:name]}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-04-30 12:12 Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-04-30 12:12 UTC (permalink / raw
To: gentoo-commits
commit: 38945e1b33ea90486f495681a6c7c2ba6e3a0fd7
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Wed Apr 30 12:12:25 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Wed Apr 30 12:12:25 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=38945e1b
Be more resilient to status.json update failures
---
lib/helpers.rb | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index 9b37c49..b321f0a 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -35,6 +35,7 @@ helpers do
end
def service_status(service)
+ return 'na' unless ServiceRegistry.instance.services.has_key? service
active_notices = NoticeStore.instance.active_notices_for(service)
unless (forced_state = get_forced_state(active_notices)) == nil
@@ -130,4 +131,4 @@ helpers do
end
}.compact.reverse.join(' ')
end
-end
\ No newline at end of file
+end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-05-12 14:59 Alex Legler
0 siblings, 0 replies; 18+ messages in thread
From: Alex Legler @ 2014-05-12 14:59 UTC (permalink / raw
To: gentoo-commits
commit: 45d9d907f809c246d635c09b95635282a3dd5140
Author: Alex Legler <alex <AT> a3li <DOT> li>
AuthorDate: Mon May 12 15:00:01 2014 +0000
Commit: Alex Legler <a3li <AT> gentoo <DOT> org>
CommitDate: Mon May 12 15:00:01 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=45d9d907
Return NA when a service has no data for a given host.
---
lib/service_registry.rb | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/lib/service_registry.rb b/lib/service_registry.rb
index e374f1f..c6d208a 100644
--- a/lib/service_registry.rb
+++ b/lib/service_registry.rb
@@ -7,6 +7,7 @@ module State
UP=1
DOWN=2
WARNING=3
+ NA=0
end
module HelperMethods
@@ -44,6 +45,10 @@ module HelperMethods
status_data['services'][host][service]['is_flapping'] != 0
end
+ def has_service?(host, service)
+ status_data['services'][host].has_key?(service)
+ end
+
def default(host, service = nil)
if service == nil
if host_flapping? host
@@ -54,6 +59,8 @@ module HelperMethods
State::DOWN
end
else
+ return State::NA unless has_service? host, service
+
if service_flapping? host, service
State::WARNING
elsif service_up? host, service
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-08-03 18:37 Robin H. Johnson
0 siblings, 0 replies; 18+ messages in thread
From: Robin H. Johnson @ 2014-08-03 18:37 UTC (permalink / raw
To: gentoo-commits
commit: 87d447ac63ffe56b419350a9740c21c7e1554ebb
Author: Robin H. Johnson <robbat2 <AT> orbis-terrarum <DOT> net>
AuthorDate: Sun Aug 3 18:37:18 2014 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 3 18:37:18 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=87d447ac
Refactor to find a nil.
Signed-off-by: Robin H. Johnson <robbat2 <AT> orbis-terrarum.net>
---
lib/helpers.rb | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index b321f0a..4ef27d4 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -22,12 +22,15 @@ helpers do
content = '<div class="list-group">'
services.each do |service|
+ service_info_txt = service_info(service)
+ service_name = ServiceRegistry.instance.services[service][:name]
+ data_service_name = service_name.gsub('"', "'")
content << "
<a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{status_text(service_status(service))}\"
data-toggle=\"tooltip\" data-placement=\"top\" data-container=\"body\"
- data-service=\"#{service}\" data-service-name=\"#{ServiceRegistry.instance.services[service][:name].gsub '"', "'"}\">
- #{service_info service}
- #{ServiceRegistry.instance.services[service][:name]}
+ data-service=\"#{service}\" data-service-name=\"#{data_service_name}\">
+ #{service_info_txt}
+ #{service_name}
</a>"
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-08-03 18:41 Robin H. Johnson
0 siblings, 0 replies; 18+ messages in thread
From: Robin H. Johnson @ 2014-08-03 18:41 UTC (permalink / raw
To: gentoo-commits
commit: 032d028cb3dcca4ae7cf2f2faf624fdd205160d0
Author: Robin H. Johnson <robbat2 <AT> orbis-terrarum <DOT> net>
AuthorDate: Sun Aug 3 18:41:28 2014 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 3 18:41:28 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=032d028c
More refactoring.
Signed-off-by: Robin H. Johnson <robbat2 <AT> orbis-terrarum.net>
---
lib/helpers.rb | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index 4ef27d4..c6081bb 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -22,14 +22,16 @@ helpers do
content = '<div class="list-group">'
services.each do |service|
- service_info_txt = service_info(service)
+ _service_status = service_status(service)
+ _status_text = status_text(_service_status)
+ _service_info = service_info(service)
service_name = ServiceRegistry.instance.services[service][:name]
data_service_name = service_name.gsub('"', "'")
content << "
- <a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{status_text(service_status(service))}\"
+ <a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{_status_text)}\"
data-toggle=\"tooltip\" data-placement=\"top\" data-container=\"body\"
data-service=\"#{service}\" data-service-name=\"#{data_service_name}\">
- #{service_info_txt}
+ #{_service_info}
#{service_name}
</a>"
end
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-08-03 18:43 Robin H. Johnson
0 siblings, 0 replies; 18+ messages in thread
From: Robin H. Johnson @ 2014-08-03 18:43 UTC (permalink / raw
To: gentoo-commits
commit: caa1829ce24ca425c4eb02f22c4f48b3af6fd2a3
Author: Robin H. Johnson <robbat2 <AT> orbis-terrarum <DOT> net>
AuthorDate: Sun Aug 3 18:43:38 2014 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 3 18:43:38 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=caa1829c
Fix typo.
Signed-off-by: Robin H. Johnson <robbat2 <AT> orbis-terrarum.net>
---
lib/helpers.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index c6081bb..129f9d1 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -28,7 +28,7 @@ helpers do
service_name = ServiceRegistry.instance.services[service][:name]
data_service_name = service_name.gsub('"', "'")
content << "
- <a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{_status_text)}\"
+ <a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{_status_text}\"
data-toggle=\"tooltip\" data-placement=\"top\" data-container=\"body\"
data-service=\"#{service}\" data-service-name=\"#{data_service_name}\">
#{_service_info}
^ permalink raw reply related [flat|nested] 18+ messages in thread
* [gentoo-commits] proj/infra-status:master commit in: lib/
@ 2014-08-03 18:48 Robin H. Johnson
0 siblings, 0 replies; 18+ messages in thread
From: Robin H. Johnson @ 2014-08-03 18:48 UTC (permalink / raw
To: gentoo-commits
commit: dd38ab70df3a402708252e05a7b678138e2f5ebc
Author: Robin H. Johnson <robbat2 <AT> orbis-terrarum <DOT> net>
AuthorDate: Sun Aug 3 18:48:51 2014 +0000
Commit: Robin H. Johnson <robbat2 <AT> gentoo <DOT> org>
CommitDate: Sun Aug 3 18:48:51 2014 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/infra-status.git;a=commit;h=dd38ab70
More debug.
Signed-off-by: Robin H. Johnson <robbat2 <AT> orbis-terrarum.net>
---
lib/helpers.rb | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/lib/helpers.rb b/lib/helpers.rb
index 129f9d1..6b16616 100644
--- a/lib/helpers.rb
+++ b/lib/helpers.rb
@@ -25,7 +25,9 @@ helpers do
_service_status = service_status(service)
_status_text = status_text(_service_status)
_service_info = service_info(service)
- service_name = ServiceRegistry.instance.services[service][:name]
+ #service_name = ServiceRegistry.instance.services[service][:name]
+ service_array = ServiceRegistry.instance.services[service]
+ service_name = service_array.nil? ? 'UNKNOWN NAME' : service_array[:name]
data_service_name = service_name.gsub('"', "'")
content << "
<a class=\"list-group-item has-tooltip notice-link\" href=\"#notices\" title=\"#{_status_text}\"
^ permalink raw reply related [flat|nested] 18+ messages in thread
end of thread, other threads:[~2014-08-03 18:49 UTC | newest]
Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-17 16:59 [gentoo-commits] proj/infra-status:master commit in: lib/ Alex Legler
-- strict thread matches above, loose matches on Subject: below --
2014-08-03 18:48 Robin H. Johnson
2014-08-03 18:43 Robin H. Johnson
2014-08-03 18:41 Robin H. Johnson
2014-08-03 18:37 Robin H. Johnson
2014-05-12 14:59 Alex Legler
2014-04-30 12:12 Alex Legler
2014-04-26 14:35 Alex Legler
2014-04-17 16:52 Alex Legler
2014-01-18 12:10 Alex Legler
2014-01-16 16:43 ` Alex Legler
2014-01-18 12:10 Alex Legler
2014-01-16 16:43 ` Alex Legler
2014-01-16 16:43 Alex Legler
2014-01-18 12:10 ` Alex Legler
2014-01-16 16:43 Alex Legler
2014-01-18 12:10 ` Alex Legler
2013-11-12 9:21 Alex Legler
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox