forked from element-plus/element-plus
-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: enhance dependency management with status tracking and UI impro…
…vements - Added a new DependencyStatusTag component to visually represent the status of dependencies. - Updated DependencyLogsDialog to include active target name and status, improving context in the logs view. - Enhanced state management in the dependency module to track active target name and status. - Refactored useDependencyList and SpiderDetailTabDependencies to utilize the new status tracking, improving user feedback and interaction. - Improved UI elements to display dependency statuses more clearly, enhancing overall user experience. These changes provide better visibility and management of dependency statuses, streamlining user interactions with the dependency management system.
- Loading branch information
Marvin Zhang
committed
Dec 30, 2024
1 parent
0bda66d
commit 78fc149
Showing
7 changed files
with
171 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
<script setup lang="ts"> | ||
import { computed } from 'vue'; | ||
import { TagProps } from '@/components/ui/tag/types'; | ||
import { translate } from '@/utils'; | ||
const props = defineProps<{ | ||
status?: DependencyStatus; | ||
size?: BasicSize; | ||
clickDisabled?: boolean; | ||
}>(); | ||
const emit = defineEmits<{ | ||
(e: 'click'): void; | ||
}>(); | ||
const t = translate; | ||
const tagProps = computed<TagProps>(() => { | ||
const { status, size, clickDisabled } = props; | ||
let tagProps: TagProps; | ||
switch (status) { | ||
case 'installed': | ||
tagProps = { | ||
icon: ['fa', 'check'], | ||
type: 'success', | ||
clickable: true, | ||
}; | ||
break; | ||
case 'installing': | ||
case 'uninstalling': | ||
tagProps = { | ||
icon: ['fa', 'spinner'], | ||
type: 'warning', | ||
spinning: true, | ||
clickable: true, | ||
}; | ||
break; | ||
case 'error': | ||
case 'abnormal': | ||
tagProps = { | ||
icon: ['fa', 'times'], | ||
type: 'danger', | ||
clickable: true, | ||
}; | ||
break; | ||
default: | ||
tagProps = { | ||
icon: ['fa', 'question'], | ||
type: 'info', | ||
clickable: false, | ||
}; | ||
} | ||
if (status) { | ||
tagProps.label = t(`views.env.deps.dependency.status.${status}`); | ||
} else { | ||
tagProps.label = t('common.status.unknown'); | ||
} | ||
if (clickDisabled) { | ||
tagProps.clickable = false; | ||
} | ||
if (typeof size !== 'undefined') { | ||
tagProps.size = size; | ||
} | ||
return tagProps; | ||
}); | ||
defineOptions({ name: 'ClDependencyStatusTag' }); | ||
</script> | ||
|
||
<template> | ||
<cl-tag | ||
:label="tagProps.label" | ||
:icon="tagProps.icon" | ||
:type="tagProps.type" | ||
:size="tagProps.size" | ||
:spinning="tagProps.spinning" | ||
:clickable="tagProps.clickable" | ||
@click="emit('click')" | ||
/> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.