mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-07 17:06:43 -03:00
feat(testing): enhance test configuration and add Vue component tests
- Update package.json test script to run both JS and Vue tests - Simplify LoraCyclerLM output by removing redundant lora name fallback - Extend Vitest config to include TypeScript test files - Add Vue testing dependencies and setup for component testing - Implement comprehensive test suite for BatchQueueSimulator component - Add test setup file with global mocks for ComfyUI modules
This commit is contained in:
@@ -6,15 +6,22 @@
|
||||
|
||||
<!-- Progress Display -->
|
||||
<div class="setting-section progress-section">
|
||||
<div class="progress-display">
|
||||
<div class="progress-display" :class="{ executing: isWorkflowExecuting }">
|
||||
<div class="progress-info">
|
||||
<span class="progress-label">Next LoRA:</span>
|
||||
<span class="progress-label">{{ isWorkflowExecuting ? 'Using LoRA:' : 'Next LoRA:' }}</span>
|
||||
<span class="progress-name" :title="currentLoraFilename">{{ currentLoraName || 'None' }}</span>
|
||||
</div>
|
||||
<div class="progress-counter">
|
||||
<span class="progress-index">{{ currentIndex }}</span>
|
||||
<span class="progress-separator">/</span>
|
||||
<span class="progress-total">{{ totalCount }}</span>
|
||||
|
||||
<!-- Repeat indicator (only shown when repeatCount > 1) -->
|
||||
<div v-if="repeatCount > 1" class="repeat-badge">
|
||||
<span class="repeat-badge-label">Rep</span>
|
||||
<span class="repeat-badge-value">{{ repeatUsed }}/{{ repeatCount }}</span>
|
||||
</div>
|
||||
|
||||
<button
|
||||
class="refresh-button"
|
||||
:disabled="isLoading"
|
||||
@@ -39,10 +46,11 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Starting Index -->
|
||||
<!-- Starting Index with Advanced Controls -->
|
||||
<div class="setting-section">
|
||||
<label class="setting-label">Starting Index</label>
|
||||
<div class="index-input-container">
|
||||
<div class="index-controls-row">
|
||||
<!-- Index input -->
|
||||
<input
|
||||
type="number"
|
||||
class="index-input"
|
||||
@@ -57,6 +65,47 @@
|
||||
@pointerup.stop
|
||||
/>
|
||||
<span class="index-hint">1 - {{ totalCount || 1 }}</span>
|
||||
|
||||
<!-- Repeat control -->
|
||||
<span class="repeat-label">x</span>
|
||||
<input
|
||||
type="number"
|
||||
class="repeat-input"
|
||||
min="1"
|
||||
max="99"
|
||||
:value="repeatCount"
|
||||
@input="onRepeatInput"
|
||||
@blur="onRepeatBlur"
|
||||
@pointerdown.stop
|
||||
@pointermove.stop
|
||||
@pointerup.stop
|
||||
title="Repeat each LoRA this many times"
|
||||
/>
|
||||
<span class="repeat-hint">times</span>
|
||||
|
||||
<!-- Control buttons -->
|
||||
<button
|
||||
class="control-btn"
|
||||
:class="{ active: isPaused }"
|
||||
@click="$emit('toggle-pause')"
|
||||
:title="isPaused ? 'Continue iteration' : 'Pause iteration'"
|
||||
>
|
||||
<svg v-if="isPaused" viewBox="0 0 24 24" fill="currentColor" class="control-icon">
|
||||
<path d="M8 5v14l11-7z"/>
|
||||
</svg>
|
||||
<svg v-else viewBox="0 0 24 24" fill="currentColor" class="control-icon">
|
||||
<path d="M6 4h4v16H6zm8 0h4v16h-4z"/>
|
||||
</svg>
|
||||
</button>
|
||||
<button
|
||||
class="control-btn"
|
||||
@click="$emit('reset-index')"
|
||||
title="Reset to index 1"
|
||||
>
|
||||
<svg viewBox="0 0 24 24" fill="currentColor" class="control-icon">
|
||||
<path d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"/>
|
||||
</svg>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -123,6 +172,11 @@ const props = defineProps<{
|
||||
useCustomClipRange: boolean
|
||||
isClipStrengthDisabled: boolean
|
||||
isLoading: boolean
|
||||
repeatCount: number
|
||||
repeatUsed: number
|
||||
isPaused: boolean
|
||||
isWorkflowExecuting: boolean
|
||||
executingRepeatStep: number
|
||||
}>()
|
||||
|
||||
const emit = defineEmits<{
|
||||
@@ -130,11 +184,15 @@ const emit = defineEmits<{
|
||||
'update:modelStrength': [value: number]
|
||||
'update:clipStrength': [value: number]
|
||||
'update:useCustomClipRange': [value: boolean]
|
||||
'update:repeatCount': [value: number]
|
||||
'toggle-pause': []
|
||||
'reset-index': []
|
||||
'refresh': []
|
||||
}>()
|
||||
|
||||
// Temporary value for input while typing
|
||||
const tempIndex = ref<string>('')
|
||||
const tempRepeat = ref<string>('')
|
||||
|
||||
const onIndexInput = (event: Event) => {
|
||||
const input = event.target as HTMLInputElement
|
||||
@@ -154,6 +212,25 @@ const onIndexBlur = (event: Event) => {
|
||||
}
|
||||
tempIndex.value = ''
|
||||
}
|
||||
|
||||
const onRepeatInput = (event: Event) => {
|
||||
const input = event.target as HTMLInputElement
|
||||
tempRepeat.value = input.value
|
||||
}
|
||||
|
||||
const onRepeatBlur = (event: Event) => {
|
||||
const input = event.target as HTMLInputElement
|
||||
const value = parseInt(input.value, 10)
|
||||
|
||||
if (!isNaN(value)) {
|
||||
const clampedValue = Math.max(1, Math.min(value, 99))
|
||||
emit('update:repeatCount', clampedValue)
|
||||
input.value = clampedValue.toString()
|
||||
} else {
|
||||
input.value = props.repeatCount.toString()
|
||||
}
|
||||
tempRepeat.value = ''
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
@@ -203,6 +280,17 @@ const onIndexBlur = (event: Event) => {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
transition: border-color 0.3s ease;
|
||||
}
|
||||
|
||||
.progress-display.executing {
|
||||
border-color: rgba(66, 153, 225, 0.5);
|
||||
animation: pulse 2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@keyframes pulse {
|
||||
0%, 100% { border-color: rgba(66, 153, 225, 0.3); }
|
||||
50% { border-color: rgba(66, 153, 225, 0.7); }
|
||||
}
|
||||
|
||||
.progress-info {
|
||||
@@ -243,6 +331,9 @@ const onIndexBlur = (event: Event) => {
|
||||
font-weight: 600;
|
||||
color: rgba(66, 153, 225, 1);
|
||||
font-family: 'SF Mono', 'Roboto Mono', monospace;
|
||||
min-width: 4ch;
|
||||
text-align: right;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.progress-separator {
|
||||
@@ -256,6 +347,9 @@ const onIndexBlur = (event: Event) => {
|
||||
font-weight: 500;
|
||||
color: rgba(226, 232, 240, 0.6);
|
||||
font-family: 'SF Mono', 'Roboto Mono', monospace;
|
||||
min-width: 4ch;
|
||||
text-align: left;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.refresh-button {
|
||||
@@ -303,16 +397,43 @@ const onIndexBlur = (event: Event) => {
|
||||
}
|
||||
}
|
||||
|
||||
/* Index Input */
|
||||
.index-input-container {
|
||||
/* Repeat Badge */
|
||||
.repeat-badge {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 4px;
|
||||
margin-left: 8px;
|
||||
padding: 2px 6px;
|
||||
background: rgba(245, 158, 11, 0.15);
|
||||
border: 1px solid rgba(245, 158, 11, 0.3);
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.repeat-badge-label {
|
||||
font-size: 10px;
|
||||
color: rgba(253, 230, 138, 0.7);
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.repeat-badge-value {
|
||||
font-size: 12px;
|
||||
font-family: 'SF Mono', 'Roboto Mono', monospace;
|
||||
color: rgba(253, 230, 138, 1);
|
||||
min-width: 3ch;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* Index Controls Row */
|
||||
.index-controls-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.index-input {
|
||||
width: 80px;
|
||||
padding: 6px 10px;
|
||||
width: 60px;
|
||||
padding: 6px 8px;
|
||||
background: rgba(26, 32, 44, 0.9);
|
||||
border: 1px solid rgba(226, 232, 240, 0.2);
|
||||
border-radius: 6px;
|
||||
@@ -334,6 +455,75 @@ const onIndexBlur = (event: Event) => {
|
||||
.index-hint {
|
||||
font-size: 11px;
|
||||
color: rgba(226, 232, 240, 0.4);
|
||||
min-width: 7ch;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
/* Repeat Controls */
|
||||
.repeat-label {
|
||||
font-size: 13px;
|
||||
color: rgba(226, 232, 240, 0.6);
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.repeat-input {
|
||||
width: 44px;
|
||||
padding: 6px 6px;
|
||||
background: rgba(26, 32, 44, 0.9);
|
||||
border: 1px solid rgba(226, 232, 240, 0.2);
|
||||
border-radius: 6px;
|
||||
color: #e4e4e7;
|
||||
font-size: 13px;
|
||||
font-family: 'SF Mono', 'Roboto Mono', monospace;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.repeat-input:focus {
|
||||
outline: none;
|
||||
border-color: rgba(66, 153, 225, 0.6);
|
||||
}
|
||||
|
||||
.repeat-hint {
|
||||
font-size: 11px;
|
||||
color: rgba(226, 232, 240, 0.4);
|
||||
}
|
||||
|
||||
/* Control Buttons */
|
||||
.control-btn {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
border: 1px solid rgba(255, 255, 255, 0.1);
|
||||
border-radius: 4px;
|
||||
color: rgba(226, 232, 240, 0.6);
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
.control-btn:hover {
|
||||
background: rgba(66, 153, 225, 0.2);
|
||||
border-color: rgba(66, 153, 225, 0.4);
|
||||
color: rgba(191, 219, 254, 1);
|
||||
}
|
||||
|
||||
.control-btn.active {
|
||||
background: rgba(245, 158, 11, 0.2);
|
||||
border-color: rgba(245, 158, 11, 0.5);
|
||||
color: rgba(253, 230, 138, 1);
|
||||
}
|
||||
|
||||
.control-btn.active:hover {
|
||||
background: rgba(245, 158, 11, 0.3);
|
||||
border-color: rgba(245, 158, 11, 0.6);
|
||||
}
|
||||
|
||||
.control-icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
}
|
||||
|
||||
/* Slider Container */
|
||||
|
||||
Reference in New Issue
Block a user