diff --git a/frontend/src/components/common/RedisTypeTag.vue b/frontend/src/components/common/RedisTypeTag.vue index f567c7e..596add1 100644 --- a/frontend/src/components/common/RedisTypeTag.vue +++ b/frontend/src/components/common/RedisTypeTag.vue @@ -3,6 +3,8 @@ import { computed } from 'vue' import { typesBgColor, typesColor, typesShortName } from '@/consts/support_redis_type.js' import Binary from '@/components/icons/Binary.vue' import { get, toUpper } from 'lodash' +import { useThemeVars } from 'naive-ui' +import Loading from '@/components/icons/Loading.vue' const props = defineProps({ type: { @@ -20,21 +22,24 @@ const props = defineProps({ }, round: Boolean, inverse: Boolean, + loading: Boolean, }) +const themeVars = useThemeVars() + const fontColor = computed(() => { if (props.inverse) { - return typesBgColor[props.type] + return props.loading ? themeVars.value.tagColor : typesBgColor[props.type] } else { - return typesColor[props.type] + return props.loading ? themeVars.value.textColorBase : typesColor[props.type] } }) const backgroundColor = computed(() => { if (props.inverse) { - return typesColor[props.type] + return props.loading ? themeVars.value.textColorBase : typesColor[props.type] } else { - return typesBgColor[props.type] + return props.loading ? themeVars.value.tagColor : typesBgColor[props.type] } }) @@ -49,6 +54,7 @@ const label = computed(() => {