fix: connection profiles mapping error

This commit is contained in:
tiny-craft 2023-08-29 15:44:33 +08:00
parent cff70bc23c
commit b580fedade
6 changed files with 25 additions and 28 deletions

View File

@ -21,7 +21,7 @@
"naive-ui": "^2.34.4",
"prettier": "^3.0.2",
"unplugin-auto-import": "^0.16.6",
"unplugin-icons": "^0.16.5",
"unplugin-icons": "^0.16.6",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.4.9"
}
@ -1753,18 +1753,18 @@
}
},
"node_modules/unplugin-icons": {
"version": "0.16.5",
"resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.16.5.tgz",
"integrity": "sha512-laCCqMWfng1XZgB9yowGfjBdDhtmz8t8zVnhzRNEMhBNdy26QrVewVmdXk/zsiAQYnEWvIxTjvW1nQXrxdd2+w==",
"version": "0.16.6",
"resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.16.6.tgz",
"integrity": "sha512-jL70sAC7twp4hI/MTfm+vyvTRtHqiEIzf3XOjJz7yzhMEEQnk5Ey5YIXRAU03Mc4BF99ITvvnBzfyRZee86OeA==",
"dev": true,
"dependencies": {
"@antfu/install-pkg": "^0.1.1",
"@antfu/utils": "^0.7.5",
"@iconify/utils": "^2.1.7",
"@antfu/utils": "^0.7.6",
"@iconify/utils": "^2.1.9",
"debug": "^4.3.4",
"kolorist": "^1.8.0",
"local-pkg": "^0.4.3",
"unplugin": "^1.3.2"
"unplugin": "^1.4.0"
},
"peerDependencies": {
"@svgr/core": ">=7.0.0",
@ -3219,18 +3219,18 @@
}
},
"unplugin-icons": {
"version": "0.16.5",
"resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.16.5.tgz",
"integrity": "sha512-laCCqMWfng1XZgB9yowGfjBdDhtmz8t8zVnhzRNEMhBNdy26QrVewVmdXk/zsiAQYnEWvIxTjvW1nQXrxdd2+w==",
"version": "0.16.6",
"resolved": "https://registry.npmmirror.com/unplugin-icons/-/unplugin-icons-0.16.6.tgz",
"integrity": "sha512-jL70sAC7twp4hI/MTfm+vyvTRtHqiEIzf3XOjJz7yzhMEEQnk5Ey5YIXRAU03Mc4BF99ITvvnBzfyRZee86OeA==",
"dev": true,
"requires": {
"@antfu/install-pkg": "^0.1.1",
"@antfu/utils": "^0.7.5",
"@iconify/utils": "^2.1.7",
"@antfu/utils": "^0.7.6",
"@iconify/utils": "^2.1.9",
"debug": "^4.3.4",
"kolorist": "^1.8.0",
"local-pkg": "^0.4.3",
"unplugin": "^1.3.2"
"unplugin": "^1.4.0"
}
},
"unplugin-vue-components": {

View File

@ -22,7 +22,7 @@
"naive-ui": "^2.34.4",
"prettier": "^3.0.2",
"unplugin-auto-import": "^0.16.6",
"unplugin-icons": "^0.16.5",
"unplugin-icons": "^0.16.6",
"unplugin-vue-components": "^0.25.1",
"vite": "^4.4.9"
}

View File

@ -1 +1 @@
d2a1ae5c33eb997098a10aa64e71ab0c
60ee635e898e51cbe90151ee2530f9cc

View File

@ -1,7 +1,6 @@
<script setup>
import { get, isEmpty, map, mapValues, pickBy, split, sum, toArray, toNumber } from 'lodash'
import { computed, ref } from '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'
@ -69,8 +68,6 @@ const totalKeys = computed(() => {
})
return sum(toArray(nums))
})
const infoList = computed(() => map(props.info, (value, key) => ({ value, key })))
const infoTab = ref('')
const infoFilter = ref('')
</script>
@ -122,7 +119,7 @@ const infoFilter = ref('')
<n-grid style="min-width: 500px" x-gap="5">
<n-gi :span="6">
<n-statistic :label="$t('uptime')" :value="uptime[0]">
<template #suffix> {{ $t(uptime[1]) }}</template>
<template #suffix>{{ $t(uptime[1]) }}</template>
</n-statistic>
</n-gi>
<n-gi :span="6">
@ -139,7 +136,7 @@ const infoFilter = ref('')
</n-gi>
<n-gi :span="6">
<n-statistic :label="$t('memory_used')" :value="usedMemory[0]">
<template #suffix> {{ usedMemory[1] }}</template>
<template #suffix>{{ usedMemory[1] }}</template>
</n-statistic>
</n-gi>
</n-grid>

View File

@ -150,6 +150,11 @@ const useConnectionStore = defineStore('connections', {
type: ConnectionType.Server,
// isLeaf: false,
})
profiles[item.name] = {
defaultFilter: item.defaultFilter,
keySeparator: item.keySeparator,
markColor: item.markColor,
}
}
conns.push({
key: conn.name + '/',
@ -157,11 +162,6 @@ const useConnectionStore = defineStore('connections', {
type: ConnectionType.Group,
children,
})
profiles[conn.name] = {
defaultFilter: conn.defaultFilter,
keySeparator: conn.keySeparator,
markColor: conn.markColor,
}
}
this.setKeyFilter(conn.name, -1, conn.defaultFilter)
}

View File

@ -17,9 +17,9 @@ export const themeOverrides = {
// borderRadius: '3px'
},
Tabs: {
tabGapSmallCard: '1px',
tabGapMediumCard: '1px',
tabGapLargeCard: '1px',
tabGapSmallCard: '2px',
tabGapMediumCard: '2px',
tabGapLargeCard: '2px',
},
Form: {
labelFontSizeTopSmall: '12px',