You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@warble.apache.org by hu...@apache.org on 2018/07/01 14:58:22 UTC

[incubator-warble-server] 02/05: start noting when a node hasn't responded in a while

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-warble-server.git

commit 7379a1c45164cff0c114f1e96df957d4d8c4069f
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Sat Jun 30 12:05:58 2018 -0500

    start noting when a node hasn't responded in a while
    
    all nodes should keep in touch with the master at least every 15 minutes
    (preferably every 5!), so if they don't, something is probably wrong
---
 ui/css/warble.min.css                 | 6 ++++++
 ui/js/coffee/warble_clientlist.coffee | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/ui/css/warble.min.css b/ui/css/warble.min.css
index 4bb27c5..395e956 100644
--- a/ui/css/warble.min.css
+++ b/ui/css/warble.min.css
@@ -3110,6 +3110,12 @@ body.error .logo h1 {
     color: #FFF;
 }
 
+.clientcard.red {
+    background: linear-gradient(to bottom, #b21e40 0, #991e39 100%);
+    color: #FFF;
+    
+}
+
 .clientcard input {
     background: rgba(255,255,200,0.45);
     border: 1.5px inset #333;
diff --git a/ui/js/coffee/warble_clientlist.coffee b/ui/js/coffee/warble_clientlist.coffee
index 053dd0e..3f35b18 100644
--- a/ui/js/coffee/warble_clientlist.coffee
+++ b/ui/js/coffee/warble_clientlist.coffee
@@ -211,12 +211,20 @@ clientlist = (json, state) ->
             # node last ping
             line = new HTML('div', {class: 'clientcardline'})
             lp = new Date(source.lastping*1000.0)
+            now = new Date()
             line.inject( [
                 new HTML('b', {}, "Last Active: "),
                 txt(moment(lp).fromNow() + " (" + lp.ISOBare()  + ")")
             ])
             d.inject(line)
             
+            # Check for inactive (dead?) nodes
+            if (moment(now).unix() - moment(lp).unix() > 900)
+                card.setAttribute("class", "clientcard red")
+                line.inject(txt(" - Node dead?!"))
+                lline.inject(txt(" - (no contact for > 15 minutes!)"))
+            
+            
         
     #app(slist, tbl)
     state.widget.inject(slist, true)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@warble.apache.org
For additional commands, e-mail: commits-help@warble.apache.org