peek-elasticsearch 0.1.2 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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
- primaries = context.primaries
6
- replicas = context.replicas
7
- $('#elasticsearch-active-tooltip').
8
- attr('title', "Primaries: #{primaries}; Replicas: #{replicas}").
9
- tipsy()
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 data-defer-to="<%= view.defer_key %>-status">...</span> / <span id="elasticsearch-active-tooltip"><span data-defer-to="<%= view.defer_key %>-active">...</span> active</span> / <span data-defer-to="<%= view.defer_key %>-inactive">...</span> inactive</strong> elasticsearch
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
- :primaries => active_primary_shards,
43
- :replicas => active_replica_shards,
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "peek-elasticsearch"
5
- spec.version = "0.1.2"
5
+ spec.version = "0.2.0"
6
6
  spec.authors = ["Will Farrington"]
7
7
  spec.email = ["wfarr@github.com"]
8
8
  spec.description = %q{Take a peek into your Elasticsearch indices.}
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: peek-elasticsearch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.2.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: