mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-05-06 08:26:45 -03:00
feat(ui): add setting to toggle version name display on model cards (#916)
This commit is contained in:
@@ -507,6 +507,11 @@
|
||||
font-size: 0.75em;
|
||||
}
|
||||
|
||||
/* Hide civitai version name when setting is disabled */
|
||||
body.hide-card-version .civitai-version {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Prevent text selection on cards and interactive elements */
|
||||
.model-card,
|
||||
.model-card *,
|
||||
|
||||
@@ -645,7 +645,7 @@ export function createModelCard(model, modelType) {
|
||||
<div class="model-info">
|
||||
<span class="model-name" title="${getDisplayName(model).replace(/"/g, '"')}">${getDisplayName(model)}</span>
|
||||
<div>
|
||||
${model.civitai?.name ? `<span class="version-name">${model.civitai.name}</span>` : ''}
|
||||
${model.civitai?.name ? `<span class="version-name civitai-version">${model.civitai.name}</span>` : ''}
|
||||
${hasUsageCount ? `<span class="version-name" title="${translate('modelCard.usage.timesUsed', {}, 'Times used')}">${model.usage_count}×</span>` : ''}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -879,6 +879,12 @@ export class SettingsManager {
|
||||
modelCardFooterActionSelect.value = state.global.settings.model_card_footer_action || 'example_images';
|
||||
}
|
||||
|
||||
// Set show version on card
|
||||
const showVersionOnCardCheckbox = document.getElementById('showVersionOnCard');
|
||||
if (showVersionOnCardCheckbox) {
|
||||
showVersionOnCardCheckbox.checked = state.global.settings.show_version_on_card !== false;
|
||||
}
|
||||
|
||||
// Set model name display setting
|
||||
const modelNameDisplaySelect = document.getElementById('modelNameDisplay');
|
||||
if (modelNameDisplaySelect) {
|
||||
@@ -2890,6 +2896,10 @@ export class SettingsManager {
|
||||
const cardInfoDisplay = state.global.settings.card_info_display || 'always';
|
||||
document.body.classList.toggle('hover-reveal', cardInfoDisplay === 'hover');
|
||||
|
||||
// Apply show version on card setting
|
||||
const showVersionOnCard = state.global.settings.show_version_on_card !== false;
|
||||
document.body.classList.toggle('hide-card-version', !showVersionOnCard);
|
||||
|
||||
const shouldShowSidebar = state.global.settings.show_folder_sidebar !== false;
|
||||
if (sidebarManager && typeof sidebarManager.setSidebarEnabled === 'function') {
|
||||
sidebarManager.setSidebarEnabled(shouldShowSidebar).catch((error) => {
|
||||
|
||||
@@ -38,6 +38,7 @@ const DEFAULT_SETTINGS_BASE = Object.freeze({
|
||||
show_folder_sidebar: true,
|
||||
model_name_display: 'model_name',
|
||||
model_card_footer_action: 'example_images',
|
||||
show_version_on_card: true,
|
||||
include_trigger_words: false,
|
||||
compact_mode: false,
|
||||
priority_tags: { ...DEFAULT_PRIORITY_TAG_CONFIG },
|
||||
|
||||
Reference in New Issue
Block a user