Skip to content

Commit

Permalink
fix #92
Browse files Browse the repository at this point in the history
  • Loading branch information
cars10 committed Mar 20, 2022
1 parent 78a3454 commit 2e8c23a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@

*Please check the [releases](https://github.com/cars10/elasticvue/releases) page if you need version release dates.*

# 0.40.0

* [fix]: fix shards overview, fixes [#92][i92]
* [feat]: change url to include cluster the id. This makes it much easier to work with different clusters in different
browser tabs.

[i92]: https://github.com/cars10/elasticvue/issues/92

# 0.39.0

* [fix]: improve elasticsearch 8 support, fixes [#93][i93]
Expand Down
10 changes: 2 additions & 8 deletions src/views/Shards.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
import ShardsTable from '@/components/Shards/ShardsTable'
import Loader from '@/components/shared/Loader'
import { useElasticsearchRequest } from '@/mixins/RequestComposition'
import { onMounted, ref, watch } from '@vue/composition-api'
import { debounce } from '@/helpers'
import { onMounted, ref } from '@vue/composition-api'
import { convertSource } from '@/models/Shards'
export default {
Expand All @@ -44,23 +43,18 @@
}
const { callElasticsearch } = useElasticsearchRequest()
const filter = ref('')
const shards = ref({})
const load = async () => {
const indices = await callElasticsearch('catIndices', {
h: ['index', 'health', 'pri', 'rep', 'status'],
s: ['index']
})
const indexNames = indices.filter(i => i.status === 'open').map(i => i.index)
const rawShards = await callElasticsearch('catShards', CAT_METHOD_PARAMS, indexNames.join(','))
const rawShards = await callElasticsearch('catShards', CAT_METHOD_PARAMS, '*')
shards.value = convertSource(rawShards, indices)
}
onMounted(load)
const debouncedFilterTable = debounce(load, 250)
watch(filter, debouncedFilterTable)
return {
shards,
load
Expand Down

0 comments on commit 2e8c23a

Please sign in to comment.