peek-elasticsearch 0.1.2 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
@@ -2,8 +2,15 @@ $(document).on 'peek:update', ->
|
|
2
2
|
elasticsearchContext = $('#peek-context-elasticsearch')
|
3
3
|
if elasticsearchContext.size()
|
4
4
|
context = elasticsearchContext.data('context')
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
5
|
+
index = context.index
|
6
|
+
primary = context.primary
|
7
|
+
replica = context.replica
|
8
|
+
inactive_primary = context.inactive_primary
|
9
|
+
inactive_replica = context.inactive_replica
|
10
|
+
$('#elasticsearch-status-tooltip').
|
11
|
+
attr('title', "<strong>Index:</strong> #{index}<br>
|
12
|
+
<strong>Primary Shards:</strong> #{primary}<br>
|
13
|
+
<strong>Replica Shards:</strong> #{replica}<br>
|
14
|
+
<strong>Inactive Prim. Shards:</strong> #{inactive_primary}<br>
|
15
|
+
<strong>Inactive Repl. Shards:</strong> #{inactive_replica}").
|
16
|
+
tipsy({html: true})
|
@@ -1 +1 @@
|
|
1
|
-
<strong><span
|
1
|
+
<strong><span id="elasticsearch-status-tooltip"><span data-defer-to="<%= view.defer_key %>-status">...</span></span></strong> elasticsearch
|
@@ -39,17 +39,16 @@ module Peek
|
|
39
39
|
|
40
40
|
def context
|
41
41
|
{
|
42
|
-
:
|
43
|
-
:
|
42
|
+
:index => @index,
|
43
|
+
:primary => active_primary_shards,
|
44
|
+
:replica => active_replica_shards,
|
45
|
+
:inactive_primary => (number_of_shards - active_primary_shards),
|
46
|
+
:inactive_replica => (number_of_replicas - active_replica_shards),
|
44
47
|
}
|
45
48
|
end
|
46
49
|
|
47
50
|
def results
|
48
|
-
{
|
49
|
-
:active => active_shards,
|
50
|
-
:inactive => (number_of_shards + number_of_replicas - active_shards),
|
51
|
-
:status => status
|
52
|
-
}
|
51
|
+
{ :status => status }
|
53
52
|
end
|
54
53
|
|
55
54
|
private
|
data/peek-elasticsearch.gemspec
CHANGED