Skip to content

Commit

Permalink
perf: disable auto decode for list/hash/set/zset (#175 #250)
Browse files Browse the repository at this point in the history
  • Loading branch information
tiny-craft committed May 6, 2024
1 parent d472836 commit 70354c1
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 17 deletions.
11 changes: 6 additions & 5 deletions frontend/src/components/content_value/ContentValueHash.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, h, nextTick, reactive, ref } from 'vue'
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
Expand Down Expand Up @@ -89,7 +89,7 @@ const fieldColumn = computed(() => ({
},
scrollable: true,
},
lineClamp: 10,
lineClamp: 1,
},
filterOptionValue: fieldFilterOption.value,
className: inEdit.value ? 'clickable' : '',
Expand Down Expand Up @@ -121,6 +121,7 @@ const valueColumn = computed(() => ({
},
scrollable: true,
},
lineClamp: 1,
},
// filterOptionValue: valueFilterOption.value,
className: inEdit.value ? 'clickable' : '',
Expand Down Expand Up @@ -185,9 +186,9 @@ const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.key = ''
currentEditRow.value = null
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
// if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
// nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
// }
// currentEditRow.format = formatTypes.RAW
// currentEditRow.decode = decodeTypes.NONE
}
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/content_value/ContentValueList.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, h, nextTick, reactive, ref } from 'vue'
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
Expand Down Expand Up @@ -96,6 +96,7 @@ const valueColumn = computed(() => ({
},
scrollable: true,
},
lineClamp: 1,
},
filterOptionValue: valueFilterOption.value,
className: inEdit.value ? 'clickable' : '',
Expand Down Expand Up @@ -162,9 +163,9 @@ const saveEdit = async (pos, value, decode, format) => {
const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.value = null
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
// if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
// nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
// }
}
const actionColumn = {
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/content_value/ContentValueSet.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, h, nextTick, reactive, ref } from 'vue'
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
Expand Down Expand Up @@ -95,6 +95,7 @@ const valueColumn = computed(() => ({
},
scrollable: true,
},
lineClamp: 1,
},
filterOptionValue: valueFilterOption.value,
className: inEdit.value ? 'clickable' : '',
Expand Down Expand Up @@ -159,9 +160,9 @@ const saveEdit = async (pos, value, decode, format) => {
const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.value = null
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
// if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
// nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
// }
}
const actionColumn = {
Expand Down
9 changes: 5 additions & 4 deletions frontend/src/components/content_value/ContentValueZSet.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup>
import { computed, h, nextTick, reactive, ref } from 'vue'
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NIcon, useThemeVars } from 'naive-ui'
Expand Down Expand Up @@ -144,6 +144,7 @@ const valueColumn = computed(() => ({
},
scrollable: true,
},
lineClamp: 1,
},
filterOptionValue: valueFilterOption.value,
className: inEdit.value ? 'clickable' : '',
Expand Down Expand Up @@ -206,9 +207,9 @@ const resetEdit = () => {
currentEditRow.no = 0
currentEditRow.score = 0
currentEditRow.value = null
if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
}
// if (currentEditRow.format !== props.format || currentEditRow.decode !== props.decode) {
// nextTick(() => onFormatChanged(currentEditRow.decode, currentEditRow.format))
// }
}
const actionColumn = {
Expand Down

0 comments on commit 70354c1

Please sign in to comment.