mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-08 09:00:05 +00:00
[Manager] Fix primevue severity in status messages (#3324)
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
import Button from 'primevue/button'
|
||||
import ProgressSpinner from 'primevue/progressspinner'
|
||||
|
||||
import { VueSeverity } from '@/types/primeVueTypes'
|
||||
import { PrimeVueSeverity } from '@/types/primeVueTypes'
|
||||
|
||||
const {
|
||||
disabled,
|
||||
@@ -41,7 +41,7 @@ const {
|
||||
} = defineProps<{
|
||||
disabled?: boolean
|
||||
outlined?: boolean
|
||||
severity?: VueSeverity
|
||||
severity?: PrimeVueSeverity
|
||||
}>()
|
||||
|
||||
// Model
|
||||
|
||||
@@ -20,15 +20,16 @@ import Message from 'primevue/message'
|
||||
import { computed } from 'vue'
|
||||
|
||||
import { components } from '@/types/comfyRegistryTypes'
|
||||
import { VueSeverity } from '@/types/primeVueTypes'
|
||||
|
||||
type PackVersionStatus = components['schemas']['NodeVersionStatus']
|
||||
type PackStatus = components['schemas']['NodeStatus']
|
||||
type Status = PackVersionStatus | PackStatus
|
||||
|
||||
type MessageProps = InstanceType<typeof Message>['$props']
|
||||
type MessageSeverity = MessageProps['severity']
|
||||
type StatusProps = {
|
||||
label: string
|
||||
severity: VueSeverity
|
||||
severity: MessageSeverity
|
||||
}
|
||||
|
||||
const { statusType } = defineProps<{
|
||||
@@ -46,7 +47,7 @@ const statusPropsMap: Record<Status, StatusProps> = {
|
||||
},
|
||||
NodeStatusBanned: {
|
||||
label: 'banned',
|
||||
severity: 'danger'
|
||||
severity: 'error'
|
||||
},
|
||||
NodeVersionStatusActive: {
|
||||
label: 'active',
|
||||
@@ -62,11 +63,11 @@ const statusPropsMap: Record<Status, StatusProps> = {
|
||||
},
|
||||
NodeVersionStatusFlagged: {
|
||||
label: 'flagged',
|
||||
severity: 'danger'
|
||||
severity: 'error'
|
||||
},
|
||||
NodeVersionStatusBanned: {
|
||||
label: 'banned',
|
||||
severity: 'danger'
|
||||
severity: 'error'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ import { computed, ref } from 'vue'
|
||||
|
||||
import { useMaintenanceTaskStore } from '@/stores/maintenanceTaskStore'
|
||||
import type { MaintenanceTask } from '@/types/desktop/maintenanceTypes'
|
||||
import { VueSeverity } from '@/types/primeVueTypes'
|
||||
import { PrimeVueSeverity } from '@/types/primeVueTypes'
|
||||
import { useMinLoadingDurationRef } from '@/utils/refUtil'
|
||||
|
||||
import TaskListStatusIcon from './TaskListStatusIcon.vue'
|
||||
@@ -64,7 +64,7 @@ defineEmits<{
|
||||
}>()
|
||||
|
||||
// Binding
|
||||
const severity = computed<VueSeverity>(() =>
|
||||
const severity = computed<PrimeVueSeverity>(() =>
|
||||
runner.value.state === 'error' || runner.value.state === 'warning'
|
||||
? 'primary'
|
||||
: 'secondary'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { VueSeverity } from '../primeVueTypes'
|
||||
import type { PrimeVueSeverity } from '../primeVueTypes'
|
||||
|
||||
interface MaintenanceTaskButton {
|
||||
/** The text to display on the button. */
|
||||
@@ -32,7 +32,7 @@ export interface MaintenanceTask {
|
||||
/** Called by onClick to run the actual task. */
|
||||
execute: (args?: unknown[]) => boolean | Promise<boolean>
|
||||
/** Show the button with `severity="danger"` */
|
||||
severity?: VueSeverity
|
||||
severity?: PrimeVueSeverity
|
||||
/** Whether this task should display the terminal window when run. */
|
||||
usesTerminal?: boolean
|
||||
/** If `true`, successful completion of this task will refresh install validation and automatically continue if successful. */
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/** Button, Tag, etc severity type is 'string' instead of this list. */
|
||||
export type VueSeverity =
|
||||
export type PrimeVueSeverity =
|
||||
| 'primary'
|
||||
| 'secondary'
|
||||
| 'success'
|
||||
|
||||
Reference in New Issue
Block a user