Compare commits
No commits in common. "a682aabb0b334e69dda278d1332a16f9eec55839" and "1bf4b0eee144f3d43dda61d4951906605c05ac0d" have entirely different histories.
a682aabb0b
...
1bf4b0eee1
|
@ -23,10 +23,6 @@ const props = defineProps({
|
|||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
resetKey: {
|
||||
type: String,
|
||||
default: '',
|
||||
},
|
||||
offsetKey: {
|
||||
type: String,
|
||||
default: '',
|
||||
|
@ -148,17 +144,6 @@ watch(
|
|||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.resetKey,
|
||||
async () => {
|
||||
if (editorNode != null) {
|
||||
editorNode.setValue(props.content)
|
||||
await nextTick(() => emit('reset', props.content))
|
||||
updateScroll()
|
||||
}
|
||||
},
|
||||
)
|
||||
|
||||
watch(
|
||||
() => props.offsetKey,
|
||||
() => {
|
||||
|
|
|
@ -178,8 +178,8 @@ const onListLimitChanged = (limit) => {
|
|||
<n-form-item :label="$t('slog.limit')">
|
||||
<n-input-number
|
||||
v-model:value="data.listLimit"
|
||||
:max="9999"
|
||||
:min="1"
|
||||
:max="9999"
|
||||
style="width: 120px"
|
||||
@update:value="onListLimitChanged" />
|
||||
</n-form-item>
|
||||
|
|
|
@ -71,7 +71,6 @@ const viewAs = reactive({
|
|||
})
|
||||
|
||||
const editingContent = ref('')
|
||||
const resetKey = ref('')
|
||||
|
||||
const enableSave = computed(() => {
|
||||
return editingContent.value !== viewAs.value && !props.loading
|
||||
|
@ -111,7 +110,6 @@ const onFormatChanged = async (decode = '', format = '') => {
|
|||
viewAs.decode = decode || retDecode
|
||||
viewAs.format = format || retFormat
|
||||
browserStore.setSelectedFormat(props.name, props.keyPath, props.db, viewAs.format, viewAs.decode)
|
||||
resetKey.value = Date.now().toString()
|
||||
} finally {
|
||||
converting.value = false
|
||||
}
|
||||
|
@ -209,7 +207,6 @@ defineExpose({
|
|||
:language="viewLanguage"
|
||||
:loading="props.loading"
|
||||
:offset-key="props.keyPath"
|
||||
:reset-key="resetKey"
|
||||
class="flex-item-expand"
|
||||
keep-offset
|
||||
style="height: 100%"
|
||||
|
|
|
@ -14,7 +14,6 @@ import useDialogStore from 'stores/dialog.js'
|
|||
import { useI18n } from 'vue-i18n'
|
||||
import ContentToolbar from '@/components/content_value/ContentToolbar.vue'
|
||||
import ContentValueJson from '@/components/content_value/ContentValueJson.vue'
|
||||
import { isMacOS } from '@/utils/platform.js'
|
||||
|
||||
const themeVars = useThemeVars()
|
||||
const browserStore = useBrowserStore()
|
||||
|
@ -127,35 +126,6 @@ const onReload = async (selDecode, selFormat) => {
|
|||
}
|
||||
}
|
||||
|
||||
const onKeyShortcut = (e) => {
|
||||
// console.log(e)
|
||||
switch (e.key) {
|
||||
case 'Delete':
|
||||
onDelete()
|
||||
return
|
||||
|
||||
case 'd':
|
||||
if (e.metaKey) {
|
||||
onDelete()
|
||||
}
|
||||
return
|
||||
|
||||
case 'F5':
|
||||
onReload()
|
||||
return
|
||||
|
||||
case 'r':
|
||||
if (e.metaKey && isMacOS()) {
|
||||
onReload()
|
||||
}
|
||||
return
|
||||
|
||||
case 'F2':
|
||||
onRename()
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
const onRename = () => {
|
||||
const { name, db, keyPath } = data.value
|
||||
if (binaryKey.value) {
|
||||
|
@ -219,8 +189,6 @@ watch(() => data.value?.keyPath, initContent)
|
|||
<!-- FIXME: keep alive may cause virtual list null value error. -->
|
||||
<!-- <keep-alive v-else> -->
|
||||
<component
|
||||
tabindex="0"
|
||||
@keydown="onKeyShortcut"
|
||||
:is="valueComponents[data.type]"
|
||||
v-else
|
||||
ref="contentRef"
|
||||
|
|
|
@ -197,6 +197,7 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.addFieldsDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:negative-button-props="{ size: 'medium' }"
|
||||
:negative-text="$t('common.cancel')"
|
||||
|
@ -204,11 +205,9 @@ const onClose = () => {
|
|||
:positive-text="$t('common.confirm')"
|
||||
:show-icon="false"
|
||||
:title="title ? $t(title) : ''"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
style="width: 600px"
|
||||
transform-origin="center"
|
||||
@esc="onClose"
|
||||
@positive-click="onAdd"
|
||||
@negative-click="onClose">
|
||||
<n-scrollbar style="max-height: 500px">
|
||||
|
|
|
@ -329,15 +329,14 @@ const pasteFromClipboard = async () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.connDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:on-after-leave="resetForm"
|
||||
:show-icon="false"
|
||||
:title="isEditMode ? $t('dialogue.connection.edit_title') : $t('dialogue.connection.new_title')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
style="width: 600px"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-spin :show="closingConnection">
|
||||
<n-tabs
|
||||
v-model:value="tab"
|
||||
|
|
|
@ -75,6 +75,7 @@ const onClose = () => {}
|
|||
<n-modal
|
||||
v-model:show="dialogStore.decodeDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:negative-button-props="{ focusable: false, size: 'medium' }"
|
||||
:negative-text="$t('common.cancel')"
|
||||
|
@ -82,10 +83,8 @@ const onClose = () => {}
|
|||
:positive-text="$t('common.confirm')"
|
||||
:show-icon="false"
|
||||
:title="editName ? $t('dialogue.decoder.edit_name') : $t('dialogue.decoder.name')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose"
|
||||
@positive-click="onAddOrUpdate"
|
||||
@negative-click="onClose">
|
||||
<n-form :model="decoderForm" :show-require-mark="false" label-align="left" label-placement="top">
|
||||
|
|
|
@ -93,13 +93,12 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.deleteKeyDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:show-icon="false"
|
||||
:title="$t('interface.batch_delete_key')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-spin :show="loading">
|
||||
<n-form :model="deleteForm" :show-require-mark="false" label-placement="top">
|
||||
<n-grid :x-gap="10">
|
||||
|
|
|
@ -64,13 +64,12 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.exportKeyDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:show-icon="false"
|
||||
:title="$t('dialogue.export.name')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-spin :show="loading">
|
||||
<n-form :model="exportKeyForm" :show-require-mark="false" label-placement="top">
|
||||
<n-grid :x-gap="10">
|
||||
|
|
|
@ -54,13 +54,12 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.flushDBDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:show-icon="false"
|
||||
:title="$t('interface.flush_db')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-spin :show="loading">
|
||||
<n-form :model="flushForm" :show-require-mark="false" label-placement="top">
|
||||
<n-form-item :label="$t('dialogue.key.server')">
|
||||
|
|
|
@ -89,6 +89,7 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.groupDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:negative-button-props="{ size: 'medium' }"
|
||||
:negative-text="$t('common.cancel')"
|
||||
|
@ -96,10 +97,8 @@ const onClose = () => {
|
|||
:positive-text="$t('common.confirm')"
|
||||
:show-icon="false"
|
||||
:title="isRenameMode ? $t('dialogue.group.rename') : $t('dialogue.group.new')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose"
|
||||
@positive-click="onConfirm"
|
||||
@negative-click="onClose">
|
||||
<n-form
|
||||
|
|
|
@ -103,13 +103,12 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.importKeyDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:show-icon="false"
|
||||
:title="$t('dialogue.import.name')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-spin :show="loading">
|
||||
<n-form :model="importKeyForm" :show-require-mark="false" label-placement="top">
|
||||
<n-grid :x-gap="10">
|
||||
|
|
|
@ -47,6 +47,7 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.keyFilterDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:negative-button-props="{ size: 'medium' }"
|
||||
:negative-text="$t('common.cancel')"
|
||||
|
@ -54,11 +55,9 @@ const onClose = () => {
|
|||
:positive-text="$t('common.confirm')"
|
||||
:show-icon="false"
|
||||
:title="$t('dialogue.filter.set_key_filter')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
style="width: 450px"
|
||||
transform-origin="center"
|
||||
@esc="onClose"
|
||||
@positive-click="onConfirm"
|
||||
@negative-click="onClose">
|
||||
<n-form
|
||||
|
|
|
@ -191,14 +191,13 @@ const onImport = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.newKeyDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:show-icon="false"
|
||||
:title="$t('dialogue.key.new')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
style="width: 600px"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-scrollbar ref="scrollRef" style="max-height: 500px">
|
||||
<n-form
|
||||
ref="newFormRef"
|
||||
|
|
|
@ -192,14 +192,13 @@ const onClose = () => {
|
|||
v-model:show="dialogStore.preferencesDialogVisible"
|
||||
:auto-focus="false"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:show-icon="false"
|
||||
:title="$t('preferences.name')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
style="width: 640px"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<!-- FIXME: set loading will slow down appear animation of dialog in linux -->
|
||||
<!-- <n-spin :show="loading"> -->
|
||||
<n-tabs
|
||||
|
|
|
@ -53,6 +53,7 @@ const onClose = () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.renameDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:negative-button-props="{ focusable: false, size: 'medium' }"
|
||||
:negative-text="$t('common.cancel')"
|
||||
|
@ -60,10 +61,8 @@ const onClose = () => {
|
|||
:positive-text="$t('common.confirm')"
|
||||
:show-icon="false"
|
||||
:title="$t('interface.rename_key')"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose"
|
||||
@positive-click="onRename"
|
||||
@negative-click="onClose">
|
||||
<n-form
|
||||
|
|
|
@ -93,6 +93,7 @@ const onConfirm = async () => {
|
|||
<n-modal
|
||||
v-model:show="dialogStore.ttlDialogVisible"
|
||||
:closable="false"
|
||||
:close-on-esc="false"
|
||||
:mask-closable="false"
|
||||
:negative-button-props="{ focusable: false, size: 'medium' }"
|
||||
:negative-text="$t('common.cancel')"
|
||||
|
@ -102,10 +103,8 @@ const onConfirm = async () => {
|
|||
:positive-text="$t('common.save')"
|
||||
:show-icon="false"
|
||||
:title="title"
|
||||
close-on-esc
|
||||
preset="dialog"
|
||||
transform-origin="center"
|
||||
@esc="onClose">
|
||||
transform-origin="center">
|
||||
<n-form :model="ttlForm" :show-require-mark="false" label-placement="top">
|
||||
<n-form-item v-if="!isBatchAction" :label="$t('common.key')">
|
||||
<n-input :value="ttlForm.key" readonly />
|
||||
|
|
|
@ -598,7 +598,6 @@ defineExpose({
|
|||
check-strategy="child"
|
||||
class="fill-height"
|
||||
virtual-scroll
|
||||
@keydown.delete="handleSelectContextMenu('value_remove')"
|
||||
@update:selected-keys="onUpdateSelectedKeys"
|
||||
@update:expanded-keys="onUpdateExpanded"
|
||||
@update:checked-keys="onUpdateCheckedKeys" />
|
||||
|
|
|
@ -204,7 +204,11 @@ const exThemeVars = computed(() => {
|
|||
</div>
|
||||
|
||||
<!-- wechat official modal -->
|
||||
<n-modal v-model:show="showWechat" close-on-esc mask-closable transform-origin="center">
|
||||
<n-modal
|
||||
:show="showWechat"
|
||||
transform-origin="center"
|
||||
@close="showWechat = false"
|
||||
@mask-click="showWechat = false">
|
||||
<n-image :src="wechatUrl" :width="400" preview-disabled />
|
||||
</n-modal>
|
||||
</div>
|
||||
|
|
|
@ -244,11 +244,7 @@ const useTabStore = defineStore('tab', {
|
|||
if (!!!reset && typeof value === 'object') {
|
||||
if (value instanceof Array) {
|
||||
tabData.value = tabData.value || []
|
||||
// direct deconstruction leads to 'Maximum call stack size exceeded'?
|
||||
// tabData.value.push(...value)
|
||||
for (let i = 0; i < value.length; i++) {
|
||||
tabData.value.push(value[i])
|
||||
}
|
||||
tabData.value.push(...value)
|
||||
} else {
|
||||
tabData.value = assign(value, tabData.value || {})
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue