api cache clean scroller
Showing
3 changed files
with
7 additions
and
6 deletions
@@ -71,7 +71,7 @@ class ApiCache { | @@ -71,7 +71,7 @@ class ApiCache { | ||
71 | if (len === 0) { | 71 | if (len === 0) { |
72 | this.memcached.end(); | 72 | this.memcached.end(); |
73 | let end = new Date(); | 73 | let end = new Date(); |
74 | - this._log(`clean success in ${end.getTime() - begin.getTime()} , all keys: ${count}`) | 74 | + this._log(`>>>>>> clean success in ${end.getTime() - begin.getTime()} , all keys: ${count}`) |
75 | } | 75 | } |
76 | }) | 76 | }) |
77 | }) | 77 | }) |
@@ -112,13 +112,14 @@ | @@ -112,13 +112,14 @@ | ||
112 | 112 | ||
113 | layoutResize(); | 113 | layoutResize(); |
114 | 114 | ||
115 | + var $logWrap = $('.yoho-log-dark'); | ||
115 | 116 | ||
116 | var ws = io(); | 117 | var ws = io(); |
117 | ws.on('connect', function() { | 118 | ws.on('connect', function() { |
118 | ws.on('/api_cache/log', function(data) { | 119 | ws.on('/api_cache/log', function(data) { |
119 | - console.log(data); | ||
120 | - | ||
121 | - $('#api-cache-log').append('<p><span class="host">'+data.host+'</span><span class="message">'+data.msg+'</span></p>') | 120 | + $('#api-cache-log').append('<p><span class="host">'+data.host+'</span><span class="message">'+data.msg+'</span></p>'); |
121 | + | ||
122 | + $logWrap.scrollTop($logWrap[0].scrollHeight); | ||
122 | }); | 123 | }); |
123 | }); | 124 | }); |
124 | ws.on('error', function() { | 125 | ws.on('error', function() { |
@@ -273,9 +273,9 @@ | @@ -273,9 +273,9 @@ | ||
273 | label.text(msg); | 273 | label.text(msg); |
274 | 274 | ||
275 | if (data.total != data.status.online) { | 275 | if (data.total != data.status.online) { |
276 | - label.addClass('label-danger'); | 276 | + label.removeClass('label-success').addClass('label-danger'); |
277 | } else { | 277 | } else { |
278 | - label.addClass('label-success'); | 278 | + label..removeClass('label-danger').addClass('label-success'); |
279 | } | 279 | } |
280 | } | 280 | } |
281 | }); | 281 | }); |
-
Please register or login to post a comment