Skip to content

Commit

Permalink
fix to edit doc
Browse files Browse the repository at this point in the history
  • Loading branch information
antonkorotkov committed Dec 22, 2020
1 parent 8558674 commit 271f3c8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/store/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,10 @@ export const search = store => {
data
)

if (get(response, 'result') === 'updated') {
if (
get(response, 'result') === 'updated' ||
get(response, '_id', false)
) {
store.dispatch('notification/add', {
type: 'success',
message: `Document with id '${_id}' in index '${_index}' was successfully reindexed`,
Expand Down Expand Up @@ -119,7 +122,10 @@ export const search = store => {
data
)

if (get(response, 'result') === 'updated') {
if (
get(response, 'result') === 'updated' ||
get(response, '_id', false)
) {
store.dispatch('notification/add', {
type: 'success',
message: `Document with id '${_id}' in index '${_index}' was successfully updated`,
Expand Down
4 changes: 3 additions & 1 deletion src/workspace/search/profiling/Collector.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
{profiling.collector(collector).getName($server.version.number)}
<small
class="ui label"
style="background-color:{getTimeColor(timeInNanos, collectors)}">
style="background-color:{getTimeColor(timeInNanos, collectors.map(c =>
profiling.collector(c).getNanos($server.version.number)
))}">
{getTimeMillis(timeInNanos || 0)}ms
</small>
</div>
Expand Down
4 changes: 3 additions & 1 deletion src/workspace/search/profiling/Query.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
</small>
<small
class="ui label"
style="background-color:{getTimeColor(timeInNanos, queries)}">
style="background-color:{getTimeColor(timeInNanos, queries.map(q =>
profiling.query(q).getNanos($server.version.number)
))}">
{getTimeMillis(timeInNanos || 0)}ms
</small>
</div>
Expand Down
2 changes: 1 addition & 1 deletion src/workspace/search/profiling/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ export const getTimeMillis = time => time / 1000000
export const getTimeColor = (time, times) => {
let total = 0
if (times && times.length) {
total = times.reduce((sum, item) => sum + item.time_in_nanos, 0)
total = times.reduce((sum, item) => sum + item, 0)
}
return PercentToHex([time / total, 70, 60])
}
Expand Down

0 comments on commit 271f3c8

Please sign in to comment.