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/06/27 22:51:03 UTC

[incubator-warble-server] branch master updated (c5a4ade -> d89c91a)

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

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


    from c5a4ade  point to docs instead
     new 77f4b3e  tweak clientcard banner background
     new 5515187  sort nodes in list view by status, then name
     new d89c91a  regen JS

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 ui/css/warble.min.css                 |  2 +-
 ui/js/coffee/warble_clientlist.coffee | 17 ++++++++++++++++-
 ui/js/warble.v1.js                    | 26 ++++++++++++++++++++------
 3 files changed, 37 insertions(+), 8 deletions(-)


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


[incubator-warble-server] 03/03: regen JS

Posted by hu...@apache.org.
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 d89c91a6e5993a2f18e251dfd03e328fc445d13c
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Jun 27 17:50:56 2018 -0500

    regen JS
---
 ui/js/warble.v1.js | 26 ++++++++++++++++++++------
 1 file changed, 20 insertions(+), 6 deletions(-)

diff --git a/ui/js/warble.v1.js b/ui/js/warble.v1.js
index 8b5d0bd..6835c8c 100644
--- a/ui/js/warble.v1.js
+++ b/ui/js/warble.v1.js
@@ -1,5 +1,5 @@
 // Generated by CoffeeScript 1.9.3
-var API, APIVERSION, Chart, HTML, Row, WarbleLogin, WarbleLoginCallback, Widget, aSourceTypes, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, ciexplorer, clientTypes, clientlist, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, da [...]
+var API, APIVERSION, Chart, HTML, Row, WarbleLogin, WarbleLoginCallback, Widget, aSourceTypes, addSourceType, addSources, addorguser, addsources, affiliate, affiliation, affiliationWizard, altemail, app, badModal, bio, chartOnclick, chartToSvg, chartWrapperButtons, charts_donutchart, charts_gaugechart, charts_linechart, charts_linechart_stacked, charts_linked, charts_radarchart, ciexplorer, clientTypes, clientlist, cog, comShow, comstat, copyCSS, currentSources, dataTable, datepicker, da [...]
   indexOf = [].indexOf || function(item) { for (var i = 0, l = this.length; i < l; i++) { if (i in this && this[i] === item) return i; } return -1; };
 
 signup = function(form) {
@@ -4695,6 +4695,24 @@ savedNodeValue = function(json, state) {
   return app(obj, txt(state[state.type]));
 };
 
+nodeStatusSort = (function(_this) {
+  return function(a, b) {
+    if (a.enabled && !b.enabled) {
+      return -1;
+    }
+    if (b.enabled && !a.enabled) {
+      return 1;
+    }
+    if (a.verified && !b.verified) {
+      return -1;
+    }
+    if (b.verified && !a.verified) {
+      return 1;
+    }
+    return a.hostname.localeCompare(b.hostname);
+  };
+})(this);
+
 clientlist = function(json, state) {
   var banner, btn, card, d, hn, len, line, lline, lp, q, retval, rline, slist, source, sources, vlist, vrf;
   slist = mk('div');
@@ -4702,11 +4720,7 @@ clientlist = function(json, state) {
   if (json.nodes) {
     sources = json.nodes;
     sources = sources.sort ? sources : [];
-    sources.sort((function(_this) {
-      return function(a, b) {
-        return a.id - b.id;
-      };
-    })(this));
+    sources.sort(nodeStatusSort);
     for (q = 0, len = sources.length; q < len; q++) {
       source = sources[q];
       card = new HTML('div', {


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


[incubator-warble-server] 01/03: tweak clientcard banner background

Posted by hu...@apache.org.
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 77f4b3e3c9ed72307e7b9327db7237f7612b58c5
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Jun 27 17:50:30 2018 -0500

    tweak clientcard banner background
---
 ui/css/warble.min.css | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ui/css/warble.min.css b/ui/css/warble.min.css
index 34dc545..4bb27c5 100644
--- a/ui/css/warble.min.css
+++ b/ui/css/warble.min.css
@@ -3127,7 +3127,7 @@ body.error .logo h1 {
     font-size: 1.8rem;
     border-bottom: 1px solid #333;
     margin-bottom: 5px;
-    background: rgba(0,0,0,0.1);
+    background: rgba(0,0,0,0.2);
 }
 
 .clientcard kbd {


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


[incubator-warble-server] 02/03: sort nodes in list view by status, then name

Posted by hu...@apache.org.
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 5515187447cc493af89701db50f024224a743be5
Author: Daniel Gruno <hu...@apache.org>
AuthorDate: Wed Jun 27 17:50:51 2018 -0500

    sort nodes in list view by status, then name
---
 ui/js/coffee/warble_clientlist.coffee | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/ui/js/coffee/warble_clientlist.coffee b/ui/js/coffee/warble_clientlist.coffee
index d707d33..3963afc 100644
--- a/ui/js/coffee/warble_clientlist.coffee
+++ b/ui/js/coffee/warble_clientlist.coffee
@@ -85,6 +85,21 @@ savedNodeValue = (json, state) ->
     obj = document.getElementById("node_#{state.type}_#{state.id}")
     obj.innerHTML = ""
     app(obj, txt(state[state.type]))
+
+# Node list sorting
+nodeStatusSort = (a,b) =>
+    # Favor enabled over not enabled
+    return -1 if a.enabled and not b.enabled
+    return 1 if b.enabled and not a.enabled
+    
+    # Favor verified over not verified
+    return -1 if a.verified and not b.verified
+    return 1 if b.verified and not a.verified
+    
+    # Fall back to hostname alpha-sort
+    return a.hostname.localeCompare(b.hostname)
+
+    
     
 clientlist = (json, state) ->
     
@@ -93,7 +108,7 @@ clientlist = (json, state) ->
     if json.nodes
         sources = json.nodes
         sources = if sources.sort then sources else []
-        sources.sort((a,b) => a.id - b.id)
+        sources.sort(nodeStatusSort)
         for source in sources
             
             card = new HTML('div', {class: 'clientcard'} )


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