refactor: use import alias name

This commit is contained in:
tiny-craft 2023-08-02 17:57:39 +08:00
parent 5750170f5e
commit af289319ed
45 changed files with 236 additions and 227 deletions

1
.gitignore vendored
View File

@ -1,5 +1,6 @@
build/bin
node_modules
frontend/dist
frontend/wailsjs
.vscode
.idea

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.4 KiB

After

Width:  |  Height:  |  Size: 40 KiB

View File

@ -17,7 +17,7 @@ import useConnectionStore from './stores/connections.js'
import { useI18n } from 'vue-i18n'
import { darkTheme, lightTheme, useOsTheme } from 'naive-ui'
import KeyFilterDialog from './components/dialogs/KeyFilterDialog.vue'
import { WindowSetDarkTheme, WindowSetLightTheme } from '../wailsjs/runtime/runtime.js'
import { WindowSetDarkTheme, WindowSetLightTheme } from 'wailsjs/runtime/runtime.js'
hljs.registerLanguage('json', json)
hljs.registerLanguage('plaintext', plaintext)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 136 KiB

View File

@ -1,9 +1,9 @@
<script setup>
import IconButton from './IconButton.vue'
import Delete from '../icons/Delete.vue'
import Edit from '../icons/Edit.vue'
import Close from '../icons/Close.vue'
import Save from '../icons/Save.vue'
import Delete from '@/components/icons/Delete.vue'
import Edit from '@/components/icons/Edit.vue'
import Close from '@/components/icons/Close.vue'
import Save from '@/components/icons/Save.vue'
const props = defineProps({
bindKey: String,

View File

@ -1,6 +1,6 @@
<script setup>
import { computed } from 'vue'
import { typesBgColor, typesColor, validType } from '../../consts/support_redis_type.js'
import { typesBgColor, typesColor, validType } from '@/consts/support_redis_type.js'
const props = defineProps({
type: {

View File

@ -1,8 +1,8 @@
<script setup>
import { computed, nextTick, onActivated, reactive, ref } from 'vue'
import IconButton from '../common/IconButton.vue'
import Refresh from '../icons/Refresh.vue'
import useConnectionStore from '../../stores/connections.js'
import IconButton from '@/components/common/IconButton.vue'
import Refresh from '@/components/icons/Refresh.vue'
import useConnectionStore from 'stores/connections.js'
import { map, uniqBy } from 'lodash'
import { useI18n } from 'vue-i18n'
import dayjs from 'dayjs'
@ -132,7 +132,7 @@ onActivated(() => {
</template>
<style scoped lang="scss">
@import 'content';
@import '@/styles/content';
.content-container {
padding: 5px;

View File

@ -1,19 +1,19 @@
<script setup>
import { computed, onMounted, onUnmounted, ref, watch } from 'vue'
import { types } from '../../consts/support_redis_type.js'
import ContentValueHash from '../content_value/ContentValueHash.vue'
import ContentValueList from '../content_value/ContentValueList.vue'
import ContentValueString from '../content_value/ContentValueString.vue'
import ContentValueSet from '../content_value/ContentValueSet.vue'
import ContentValueZset from '../content_value/ContentValueZSet.vue'
import { types } from '@/consts/support_redis_type.js'
import ContentValueHash from '@/components/content_value/ContentValueHash.vue'
import ContentValueList from '@/components/content_value/ContentValueList.vue'
import ContentValueString from '@/components/content_value/ContentValueString.vue'
import ContentValueSet from '@/components/content_value/ContentValueSet.vue'
import ContentValueZset from '@/components/content_value/ContentValueZSet.vue'
import { get, isEmpty, map, toUpper } from 'lodash'
import useTabStore from '../../stores/tab.js'
import useTabStore from 'stores/tab.js'
import { useDialog } from 'naive-ui'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
import { useI18n } from 'vue-i18n'
import { useConfirmDialog } from '../../utils/confirm_dialog.js'
import ContentServerStatus from '../content_value/ContentServerStatus.vue'
import ContentValueStream from '../content_value/ContentValueStream.vue'
import { useConfirmDialog } from '@/utils/confirm_dialog.js'
import ContentServerStatus from '@/components/content_value/ContentServerStatus.vue'
import ContentValueStream from '@/components/content_value/ContentValueStream.vue'
const serverInfo = ref({})
const autoRefresh = ref(false)
@ -183,7 +183,7 @@ const onCloseTab = (tabIndex) => {
</template>
<style lang="scss" scoped>
@import 'content';
@import '@/styles/content';
.content-container {
padding: 5px;

View File

@ -1,6 +1,6 @@
<script setup>
import AddLink from '../icons/AddLink.vue'
import useDialogStore from '../../stores/dialog.js'
import AddLink from '@/components/icons/AddLink.vue'
import useDialogStore from 'stores/dialog.js'
const dialogStore = useDialogStore()
</script>
@ -22,7 +22,7 @@ const dialogStore = useDialogStore()
</template>
<style lang="scss" scoped>
@import 'content';
@import '@/styles/content';
.content-container {
justify-content: center;

View File

@ -1,8 +1,8 @@
<script setup>
import { ref } from 'vue'
import { ConnectionType } from '../../consts/connection_type.js'
import Close from '../icons/Close.vue'
import useConnectionStore from '../../stores/connections.js'
import { ConnectionType } from '@/consts/connection_type.js'
import Close from '@/components/icons/Close.vue'
import useConnectionStore from 'stores/connections.js'
import { useThemeVars } from 'naive-ui'
const emit = defineEmits(['switchTab', 'closeTab', 'update:modelValue'])

View File

@ -1,10 +1,10 @@
<script setup>
import { get, isEmpty, map, mapValues, pickBy, split, sum, toArray, toNumber } from 'lodash'
import { computed, ref } from 'vue'
import Help from '../icons/Help.vue'
import IconButton from '../common/IconButton.vue'
import Filter from '../icons/Filter.vue'
import Refresh from '../icons/Refresh.vue'
import Help from '@/components/icons/Help.vue'
import IconButton from '@/components/common/IconButton.vue'
import Filter from '@/components/icons/Filter.vue'
import Refresh from '@/components/icons/Refresh.vue'
const props = defineProps({
server: String,

View File

@ -1,18 +1,18 @@
<script setup>
import { validType } from '../../consts/support_redis_type.js'
import useDialog from '../../stores/dialog.js'
import Delete from '../icons/Delete.vue'
import Edit from '../icons/Edit.vue'
import Refresh from '../icons/Refresh.vue'
import Timer from '../icons/Timer.vue'
import RedisTypeTag from '../common/RedisTypeTag.vue'
import { validType } from '@/consts/support_redis_type.js'
import useDialog from 'stores/dialog.js'
import Delete from '@/components/icons/Delete.vue'
import Edit from '@/components/icons/Edit.vue'
import Refresh from '@/components/icons/Refresh.vue'
import Timer from '@/components/icons/Timer.vue'
import RedisTypeTag from '@/components/common/RedisTypeTag.vue'
import { useI18n } from 'vue-i18n'
import { useMessage } from 'naive-ui'
import IconButton from '../common/IconButton.vue'
import useConnectionStore from '../../stores/connections.js'
import { useConfirmDialog } from '../../utils/confirm_dialog.js'
import Copy from '../icons/Copy.vue'
import { ClipboardSetText } from '../../../wailsjs/runtime/runtime.js'
import IconButton from '@/components/common/IconButton.vue'
import useConnectionStore from 'stores/connections.js'
import { useConfirmDialog } from '@/utils/confirm_dialog.js'
import Copy from '@/components/icons/Copy.vue'
import { ClipboardSetText } from 'wailsjs/runtime/runtime.js'
const props = defineProps({
server: String,

View File

@ -2,12 +2,12 @@
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '../icons/AddLink.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NCode, NIcon, NInput, useMessage } from 'naive-ui'
import { types, types as redisTypes } from '../../consts/support_redis_type.js'
import EditableTableColumn from '../common/EditableTableColumn.vue'
import useDialogStore from '../../stores/dialog.js'
import useConnectionStore from '../../stores/connections.js'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
import EditableTableColumn from '@/components/common/EditableTableColumn.vue'
import useDialogStore from 'stores/dialog.js'
import useConnectionStore from 'stores/connections.js'
const i18n = useI18n()
@ -120,7 +120,7 @@ const actionColumn = {
props.name,
props.db,
props.keyPath,
row.key
row.key,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
@ -146,7 +146,7 @@ const actionColumn = {
props.keyPath,
row.key,
currentEditRow.value.key,
currentEditRow.value.value
currentEditRow.value.value,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})

View File

@ -2,13 +2,13 @@
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '../icons/AddLink.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NCode, NIcon, NInput, useMessage } from 'naive-ui'
import { size } from 'lodash'
import { types, types as redisTypes } from '../../consts/support_redis_type.js'
import EditableTableColumn from '../common/EditableTableColumn.vue'
import useDialogStore from '../../stores/dialog.js'
import useConnectionStore from '../../stores/connections.js'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
import EditableTableColumn from '@/components/common/EditableTableColumn.vue'
import useDialogStore from 'stores/dialog.js'
import useConnectionStore from 'stores/connections.js'
const i18n = useI18n()
@ -77,7 +77,7 @@ const actionColumn = {
props.name,
props.db,
props.keyPath,
row.no - 1
row.no - 1,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
@ -100,7 +100,7 @@ const actionColumn = {
props.db,
props.keyPath,
currentEditRow.value.no - 1,
currentEditRow.value.value
currentEditRow.value.value,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})

View File

@ -2,13 +2,13 @@
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '../icons/AddLink.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NCode, NIcon, NInput, useMessage } from 'naive-ui'
import { size } from 'lodash'
import useDialogStore from '../../stores/dialog.js'
import { types, types as redisTypes } from '../../consts/support_redis_type.js'
import EditableTableColumn from '../common/EditableTableColumn.vue'
import useConnectionStore from '../../stores/connections.js'
import useDialogStore from 'stores/dialog.js'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
import EditableTableColumn from '@/components/common/EditableTableColumn.vue'
import useConnectionStore from 'stores/connections.js'
const i18n = useI18n()
const props = defineProps({
@ -78,7 +78,7 @@ const actionColumn = {
props.name,
props.db,
props.keyPath,
row.value
row.value,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
@ -99,7 +99,7 @@ const actionColumn = {
props.db,
props.keyPath,
row.value,
currentEditRow.value.value
currentEditRow.value.value,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})

View File

@ -2,12 +2,12 @@
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '../icons/AddLink.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NCode, NIcon, NInput, useMessage } from 'naive-ui'
import { types, types as redisTypes } from '../../consts/support_redis_type.js'
import EditableTableColumn from '../common/EditableTableColumn.vue'
import useDialogStore from '../../stores/dialog.js'
import useConnectionStore from '../../stores/connections.js'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
import EditableTableColumn from '@/components/common/EditableTableColumn.vue'
import useDialogStore from 'stores/dialog.js'
import useConnectionStore from 'stores/connections.js'
import { includes, keys, some, values } from 'lodash'
const i18n = useI18n()

View File

@ -2,17 +2,18 @@
import { computed, onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import Copy from '../icons/Copy.vue'
import Save from '../icons/Save.vue'
import Copy from '@/components/icons/Copy.vue'
import Save from '@/components/icons/Save.vue'
import { useMessage, useThemeVars } from 'naive-ui'
import { types } from '../../consts/value_view_type.js'
import Close from '../icons/Close.vue'
import Edit from '../icons/Edit.vue'
import { IsJson } from '../../utils/check_string_format.js'
import { types as redisTypes } from '../../consts/support_redis_type.js'
import { ClipboardSetText } from '../../../wailsjs/runtime/runtime.js'
import { types } from '@/consts/value_view_type.js'
import Close from '@/components/icons/Close.vue'
import Edit from '@/components/icons/Edit.vue'
import { IsJson } from '@/utils/check_string_format.js'
import { types as redisTypes } from '@/consts/support_redis_type.js'
import { ClipboardSetText } from 'wailsjs/runtime/runtime.js'
import { toLower } from 'lodash'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
const themeVars = useThemeVars()
const props = defineProps({
@ -70,7 +71,7 @@ watch(
() => props.value,
(value) => {
autoDetectFormat()
}
},
)
const keyType = redisTypes.STRING
@ -148,7 +149,7 @@ const onSaveValue = async () => {
props.keyPath,
toLower(keyType),
editValue.value,
-1
-1,
)
if (success) {
await connectionStore.loadKeyValue(props.name, props.db, props.keyPath)

View File

@ -2,13 +2,13 @@
import { computed, h, reactive, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import ContentToolbar from './ContentToolbar.vue'
import AddLink from '../icons/AddLink.vue'
import AddLink from '@/components/icons/AddLink.vue'
import { NButton, NCode, NIcon, NInput, NInputNumber, useMessage } from 'naive-ui'
import { types, types as redisTypes } from '../../consts/support_redis_type.js'
import EditableTableColumn from '../common/EditableTableColumn.vue'
import { isEmpty, replace } from 'lodash'
import useDialogStore from '../../stores/dialog.js'
import useConnectionStore from '../../stores/connections.js'
import { types, types as redisTypes } from '@/consts/support_redis_type.js'
import EditableTableColumn from '@/components/common/EditableTableColumn.vue'
import { isEmpty } from 'lodash'
import useDialogStore from 'stores/dialog.js'
import useConnectionStore from 'stores/connections.js'
const i18n = useI18n()
@ -150,7 +150,7 @@ const actionColumn = {
props.name,
props.db,
props.keyPath,
row.value
row.value,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})
@ -175,7 +175,7 @@ const actionColumn = {
props.keyPath,
row.value,
newValue,
currentEditRow.value.score
currentEditRow.value.score,
)
if (success) {
connectionStore.loadKeyValue(props.name, props.db, props.keyPath).then((r) => {})

View File

@ -1,16 +1,16 @@
<script setup>
import { computed, reactive, watch } from 'vue'
import { types } from '../../consts/support_redis_type'
import useDialog from '../../stores/dialog'
import NewStringValue from '../new_value/NewStringValue.vue'
import NewSetValue from '../new_value/NewSetValue.vue'
import { types } from '@/consts/support_redis_type.js'
import useDialog from 'stores/dialog'
import NewStringValue from '@/components/new_value/NewStringValue.vue'
import NewSetValue from '@/components/new_value/NewSetValue.vue'
import { useI18n } from 'vue-i18n'
import { useMessage } from 'naive-ui'
import AddListValue from '../new_value/AddListValue.vue'
import AddHashValue from '../new_value/AddHashValue.vue'
import AddZSetValue from '../new_value/AddZSetValue.vue'
import useConnectionStore from '../../stores/connections.js'
import NewStreamValue from '../new_value/NewStreamValue.vue'
import AddListValue from '@/components/new_value/AddListValue.vue'
import AddHashValue from '@/components/new_value/AddHashValue.vue'
import AddZSetValue from '@/components/new_value/AddZSetValue.vue'
import useConnectionStore from 'stores/connections.js'
import NewStreamValue from '@/components/new_value/NewStreamValue.vue'
import { size, slice } from 'lodash'
const i18n = useI18n()

View File

@ -2,11 +2,11 @@
import { get, isEmpty, map } from 'lodash'
import { computed, nextTick, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { TestConnection } from '../../../wailsjs/go/services/connectionService.js'
import useDialog from '../../stores/dialog'
import { TestConnection } from 'wailsjs/go/services/connectionService.js'
import useDialog from 'stores/dialog'
import { useMessage } from 'naive-ui'
import Close from '../icons/Close.vue'
import useConnectionStore from '../../stores/connections.js'
import Close from '@/components/icons/Close.vue'
import useConnectionStore from 'stores/connections.js'
/**
* Dialog for new or edit connection
@ -110,7 +110,7 @@ watch(
editName.value = get(dialogStore.connParam, 'name', '')
generalForm.value = dialogStore.connParam || connectionStore.newDefaultConnection()
}
}
},
)
const onTestConnection = async () => {

View File

@ -1,9 +1,9 @@
<script setup>
import { reactive, watch } from 'vue'
import useDialog from '../../stores/dialog'
import useDialog from 'stores/dialog'
import { useMessage } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
import { isEmpty, size } from 'lodash'
const deleteForm = reactive({
@ -29,7 +29,7 @@ watch(
deleteForm.loadingAffected = false
deleteForm.affectedKeys = []
}
}
},
)
const scanAffectedKey = async () => {

View File

@ -1,9 +1,9 @@
<script setup>
import { computed, reactive, ref, watch } from 'vue'
import useDialog from '../../stores/dialog'
import useDialog from 'stores/dialog'
import { useMessage } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
import { isEmpty } from 'lodash'
/**
@ -25,7 +25,7 @@ watch(
if (visible) {
groupForm.name = editGroup.value = dialogStore.editGroup
}
}
},
)
const i18n = useI18n()

View File

@ -1,9 +1,9 @@
<script setup>
import { computed, reactive, ref, watch } from 'vue'
import useDialog from '../../stores/dialog'
import useDialog from 'stores/dialog'
import { useI18n } from 'vue-i18n'
import useConnectionStore from '../../stores/connections.js'
import { types } from '../../consts/support_redis_type.js'
import useConnectionStore from 'stores/connections.js'
import { types } from '@/consts/support_redis_type.js'
const i18n = useI18n()
const filterForm = reactive({
@ -37,7 +37,7 @@ watch(
filterForm.type = type || ''
filterForm.pattern = pattern || '*'
}
}
},
)
const connectionStore = useConnectionStore()

View File

@ -1,18 +1,18 @@
<script setup>
import { computed, h, reactive, ref, watch } from 'vue'
import { types, typesColor } from '../../consts/support_redis_type'
import useDialog from '../../stores/dialog'
import { types, typesColor } from '@/consts/support_redis_type.js'
import useDialog from 'stores/dialog'
import { isEmpty, keys, map } from 'lodash'
import NewStringValue from '../new_value/NewStringValue.vue'
import NewHashValue from '../new_value/NewHashValue.vue'
import NewListValue from '../new_value/NewListValue.vue'
import NewZSetValue from '../new_value/NewZSetValue.vue'
import NewSetValue from '../new_value/NewSetValue.vue'
import NewStringValue from '@/components/new_value/NewStringValue.vue'
import NewHashValue from '@/components/new_value/NewHashValue.vue'
import NewListValue from '@/components/new_value/NewListValue.vue'
import NewZSetValue from '@/components/new_value/NewZSetValue.vue'
import NewSetValue from '@/components/new_value/NewSetValue.vue'
import { useI18n } from 'vue-i18n'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
import { NSpace, useMessage } from 'naive-ui'
import useTabStore from '../../stores/tab.js'
import NewStreamValue from '../new_value/NewStreamValue.vue'
import useTabStore from 'stores/tab.js'
import NewStreamValue from '@/components/new_value/NewStreamValue.vue'
const i18n = useI18n()
const newForm = reactive({

View File

@ -1,8 +1,8 @@
<script setup>
import { ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import useDialog from '../../stores/dialog'
import usePreferencesStore from '../../stores/preferences.js'
import useDialog from 'stores/dialog'
import usePreferencesStore from 'stores/preferences.js'
import { useMessage } from 'naive-ui'
const prefStore = usePreferencesStore()

View File

@ -1,9 +1,9 @@
<script setup>
import { reactive, watch } from 'vue'
import useDialog from '../../stores/dialog'
import useDialog from 'stores/dialog'
import { useMessage } from 'naive-ui'
import { useI18n } from 'vue-i18n'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
const renameForm = reactive({
server: '',
@ -24,7 +24,7 @@ watch(
renameForm.key = key
renameForm.newKey = key
}
}
},
)
const i18n = useI18n()

View File

@ -1,8 +1,8 @@
<script setup>
import { reactive, ref, watch } from 'vue'
import useDialog from '../../stores/dialog'
import useTabStore from '../../stores/tab.js'
import useConnectionStore from '../../stores/connections.js'
import useDialog from 'stores/dialog'
import useTabStore from 'stores/tab.js'
import useConnectionStore from 'stores/connections.js'
const ttlForm = reactive({
ttl: -1,
@ -34,7 +34,7 @@ watch(
currentKey.value = tab.key
}
}
}
},
)
const onClose = () => {

View File

@ -1,9 +1,9 @@
<script setup>
import { ref } from 'vue'
import { flatMap, reject } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
import { useI18n } from 'vue-i18n'
const props = defineProps({
@ -39,7 +39,7 @@ const onUpdate = (val) => {
val = reject(val, { key: '' })
emit(
'update:value',
flatMap(val, (item) => [item.key, item.value])
flatMap(val, (item) => [item.key, item.value]),
)
}
</script>

View File

@ -1,9 +1,9 @@
<script setup>
import { ref } from 'vue'
import { compact } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
import { useI18n } from 'vue-i18n'
const props = defineProps({

View File

@ -1,9 +1,9 @@
<script setup>
import { defineOptions, ref } from 'vue'
import { isEmpty, reject } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
import { useI18n } from 'vue-i18n'
const props = defineProps({

View File

@ -1,9 +1,9 @@
<script setup>
import { ref } from 'vue'
import { flatMap, isEmpty, reject } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,

View File

@ -1,9 +1,9 @@
<script setup>
import { ref } from 'vue'
import { compact, isEmpty } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,

View File

@ -1,9 +1,9 @@
<script setup>
import { ref } from 'vue'
import { compact, isEmpty, uniq } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,

View File

@ -1,9 +1,9 @@
<script setup>
import { defineOptions, ref } from 'vue'
import { flatMap, isEmpty, reject } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,

View File

@ -1,9 +1,9 @@
<script setup>
import { ref } from 'vue'
import { flatMap, isEmpty, reject } from 'lodash'
import Add from '../icons/Add.vue'
import Delete from '../icons/Delete.vue'
import IconButton from '../common/IconButton.vue'
import Add from '@/components/icons/Add.vue'
import Delete from '@/components/icons/Delete.vue'
import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
value: Array,

View File

@ -1,20 +1,19 @@
<script setup>
import { useMessage, useThemeVars } from 'naive-ui'
import AddLink from '../icons/AddLink.vue'
import AddLink from '@/components/icons/AddLink.vue'
import BrowserTree from './BrowserTree.vue'
import IconButton from '../common/IconButton.vue'
import useTabStore from '../../stores/tab.js'
import IconButton from '@/components/common/IconButton.vue'
import useTabStore from 'stores/tab.js'
import { computed, reactive } from 'vue'
import { get } from 'lodash'
import Delete from '../icons/Delete.vue'
import Refresh from '../icons/Refresh.vue'
import useDialogStore from '../../stores/dialog.js'
import { useConfirmDialog } from '../../utils/confirm_dialog.js'
import Delete from '@/components/icons/Delete.vue'
import Refresh from '@/components/icons/Refresh.vue'
import useDialogStore from 'stores/dialog.js'
import { useConfirmDialog } from '@/utils/confirm_dialog.js'
import { useI18n } from 'vue-i18n'
import useConnectionStore from '../../stores/connections.js'
import Filter from '../icons/Filter.vue'
import { types } from '../../consts/support_redis_type.js'
import Search from '../icons/Search.vue'
import useConnectionStore from 'stores/connections.js'
import { types } from '@/consts/support_redis_type.js'
import Search from '@/components/icons/Search.vue'
const themeVars = useThemeVars()
const dialogStore = useDialogStore()

View File

@ -1,28 +1,28 @@
<script setup>
import { computed, h, nextTick, onMounted, reactive, ref } from 'vue'
import { ConnectionType } from '../../consts/connection_type.js'
import { ConnectionType } from '@/consts/connection_type.js'
import { NIcon, NSpace, NTag, useDialog, useMessage } from 'naive-ui'
import Key from '../icons/Key.vue'
import ToggleDb from '../icons/ToggleDb.vue'
import Key from '@/components/icons/Key.vue'
import ToggleDb from '@/components/icons/ToggleDb.vue'
import { find, get, includes, indexOf, isEmpty, remove } from 'lodash'
import { useI18n } from 'vue-i18n'
import Refresh from '../icons/Refresh.vue'
import CopyLink from '../icons/CopyLink.vue'
import Add from '../icons/Add.vue'
import Layer from '../icons/Layer.vue'
import Delete from '../icons/Delete.vue'
import Connect from '../icons/Connect.vue'
import useDialogStore from '../../stores/dialog.js'
import { ClipboardSetText } from '../../../wailsjs/runtime/runtime.js'
import useConnectionStore from '../../stores/connections.js'
import { useConfirmDialog } from '../../utils/confirm_dialog.js'
import ToggleServer from '../icons/ToggleServer.vue'
import Unlink from '../icons/Unlink.vue'
import Filter from '../icons/Filter.vue'
import Close from '../icons/Close.vue'
import { typesBgColor, typesColor } from '../../consts/support_redis_type.js'
import useTabStore from '../../stores/tab.js'
import IconButton from '../common/IconButton.vue'
import Refresh from '@/components/icons/Refresh.vue'
import CopyLink from '@/components/icons/CopyLink.vue'
import Add from '@/components/icons/Add.vue'
import Layer from '@/components/icons/Layer.vue'
import Delete from '@/components/icons/Delete.vue'
import Connect from '@/components/icons/Connect.vue'
import useDialogStore from 'stores/dialog.js'
import { ClipboardSetText } from 'wailsjs/runtime/runtime.js'
import useConnectionStore from 'stores/connections.js'
import { useConfirmDialog } from '@/utils/confirm_dialog.js'
import ToggleServer from '@/components/icons/ToggleServer.vue'
import Unlink from '@/components/icons/Unlink.vue'
import Filter from '@/components/icons/Filter.vue'
import Close from '@/components/icons/Close.vue'
import { typesBgColor, typesColor } from '@/consts/support_redis_type.js'
import useTabStore from 'stores/tab.js'
import IconButton from '@/components/common/IconButton.vue'
const props = defineProps({
server: String,

View File

@ -1,13 +1,13 @@
<script setup>
import useDialogStore from '../../stores/dialog.js'
import useDialogStore from 'stores/dialog.js'
import { NIcon, useThemeVars } from 'naive-ui'
import AddGroup from '../icons/AddGroup.vue'
import AddLink from '../icons/AddLink.vue'
import IconButton from '../common/IconButton.vue'
import Filter from '../icons/Filter.vue'
import AddGroup from '@/components/icons/AddGroup.vue'
import AddLink from '@/components/icons/AddLink.vue'
import IconButton from '@/components/common/IconButton.vue'
import Filter from '@/components/icons/Filter.vue'
import ConnectionTree from './ConnectionTree.vue'
import Unlink from '../icons/Unlink.vue'
import useConnectionStore from '../../stores/connections.js'
import Unlink from '@/components/icons/Unlink.vue'
import useConnectionStore from 'stores/connections.js'
import { ref } from 'vue'
const themeVars = useThemeVars()

View File

@ -1,21 +1,21 @@
<script setup>
import useDialogStore from '../../stores/dialog.js'
import useDialogStore from 'stores/dialog.js'
import { h, nextTick, reactive, ref } from 'vue'
import useConnectionStore from '../../stores/connections.js'
import useConnectionStore from 'stores/connections.js'
import { NIcon, useDialog, useMessage, useThemeVars } from 'naive-ui'
import { ConnectionType } from '../../consts/connection_type.js'
import ToggleFolder from '../icons/ToggleFolder.vue'
import ToggleServer from '../icons/ToggleServer.vue'
import { ConnectionType } from '@/consts/connection_type.js'
import ToggleFolder from '@/components/icons/ToggleFolder.vue'
import ToggleServer from '@/components/icons/ToggleServer.vue'
import { debounce, indexOf, isEmpty } from 'lodash'
import Config from '../icons/Config.vue'
import Delete from '../icons/Delete.vue'
import Unlink from '../icons/Unlink.vue'
import CopyLink from '../icons/CopyLink.vue'
import Connect from '../icons/Connect.vue'
import Config from '@/components/icons/Config.vue'
import Delete from '@/components/icons/Delete.vue'
import Unlink from '@/components/icons/Unlink.vue'
import CopyLink from '@/components/icons/CopyLink.vue'
import Connect from '@/components/icons/Connect.vue'
import { useI18n } from 'vue-i18n'
import useTabStore from '../../stores/tab.js'
import Edit from '../icons/Edit.vue'
import { useConfirmDialog } from '../../utils/confirm_dialog.js'
import useTabStore from 'stores/tab.js'
import Edit from '@/components/icons/Edit.vue'
import { useConfirmDialog } from '@/utils/confirm_dialog.js'
const themeVars = useThemeVars()
const i18n = useI18n()
@ -130,7 +130,7 @@ const renderPrefix = ({ option }) => {
{ size: 20 },
{
default: () => h(ToggleFolder, { modelValue: opened }),
}
},
)
case ConnectionType.Server:
const connected = connectionStore.isConnected(option.name)
@ -139,7 +139,7 @@ const renderPrefix = ({ option }) => {
{ size: 20 },
{
default: () => h(ToggleServer, { modelValue: !!connected }),
}
},
)
}
}
@ -330,7 +330,10 @@ const handleDrop = ({ node, dragNode, dropPosition }) => {
</script>
<template>
<n-empty v-if="isEmpty(connectionStore.connections)" class="empty-content" :description="$t('empty_server_list')" />
<n-tree
v-else
class="fill-height"
:animated="false"
:block-line="true"
:block-node="true"
@ -347,7 +350,6 @@ const handleDrop = ({ node, dragNode, dropPosition }) => {
:render-suffix="renderSuffix"
@drop="handleDrop"
:pattern="props.filterPattern"
class="fill-height"
virtual-scroll
/>
@ -383,4 +385,6 @@ const handleDrop = ({ node, dragNode, dropPosition }) => {
/>
</template>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
@import '@/styles/content';
</style>

View File

@ -1,17 +1,17 @@
<script setup>
import { computed, h } from 'vue'
import { NIcon, useThemeVars } from 'naive-ui'
import ToggleDb from '../icons/ToggleDb.vue'
import ToggleDb from '@/components/icons/ToggleDb.vue'
import { useI18n } from 'vue-i18n'
import ToggleServer from '../icons/ToggleServer.vue'
import IconButton from '../common/IconButton.vue'
import Config from '../icons/Config.vue'
import useDialogStore from '../../stores/dialog.js'
import Github from '../icons/Github.vue'
import { BrowserOpenURL } from '../../../wailsjs/runtime/runtime.js'
import Log from '../icons/Log.vue'
import useConnectionStore from '../../stores/connections.js'
import Help from '../icons/Help.vue'
import ToggleServer from '@/components/icons/ToggleServer.vue'
import IconButton from '@/components/common/IconButton.vue'
import Config from '@/components/icons/Config.vue'
import useDialogStore from 'stores/dialog.js'
import Github from '@/components/icons/Github.vue'
import { BrowserOpenURL } from 'wailsjs/runtime/runtime.js'
import Log from '@/components/icons/Log.vue'
import useConnectionStore from 'stores/connections.js'
import Help from '@/components/icons/Help.vue'
const themeVars = useThemeVars()

View File

@ -132,6 +132,7 @@
"spec_field_required": "\"{key}\" should not be blank",
"nonexist_tab_content": "The selected key does not exist. Please retry",
"empty_server_content": "Connect server from left list",
"empty_server_list": "No redis server",
"reload_when_succ": "Reload immediately after success",
"server": "Server",
"browser": "Browser",

View File

@ -134,6 +134,7 @@
"spec_field_required": "{key} 不能为空",
"nonexist_tab_content": "所选键不存在,请尝试刷新重试",
"empty_server_content": "可以从左边选择并打开连接",
"empty_server_list": "还没添加Redis服务器",
"reload_when_succ": "操作成功后立即重新加载",
"server": "服务器",
"browser": "浏览器",

View File

@ -30,10 +30,10 @@ import {
SetSetItem,
UpdateSetItem,
UpdateZSetValue,
} from '../../wailsjs/go/services/connectionService.js'
import { ConnectionType } from '../consts/connection_type.js'
} from 'wailsjs/go/services/connectionService.js'
import { ConnectionType } from '@/consts/connection_type.js'
import useTabStore from './tab.js'
import { types } from '../consts/support_redis_type.js'
import { types } from '@/consts/support_redis_type.js'
const useConnectionStore = defineStore('connections', {
/**

View File

@ -1,12 +1,12 @@
import { defineStore } from 'pinia'
import { lang } from '../langs/index.js'
import { lang } from '@/langs/index.js'
import { camelCase, clone, find, get, isEmpty, isObject, map, set, snakeCase, split } from 'lodash'
import {
GetFontList,
GetPreferences,
RestorePreferences,
SetPreferences,
} from '../../wailsjs/go/services/preferencesService.js'
} from 'wailsjs/go/services/preferencesService.js'
import { useI18n } from 'vue-i18n'
const usePreferencesStore = defineStore('preferences', {

View File

@ -25,6 +25,8 @@ export default defineConfig({
resolve: {
alias: {
'@': rootPath + 'src',
stores: rootPath + 'src/stores',
wailsjs: rootPath + 'wailsjs',
},
},
})