mirror of
https://github.com/willmiao/ComfyUI-Lora-Manager.git
synced 2026-03-25 15:15:44 -03:00
feat(localization): update toast messages for improved user feedback and localization support across various components
This commit is contained in:
@@ -587,17 +587,6 @@
|
|||||||
"recipes": "Loading recipes...",
|
"recipes": "Loading recipes...",
|
||||||
"examples": "Loading examples..."
|
"examples": "Loading examples..."
|
||||||
},
|
},
|
||||||
"tags": {
|
|
||||||
"messages": {
|
|
||||||
"updated": "Tags updated successfully",
|
|
||||||
"updateFailed": "Failed to update tags"
|
|
||||||
},
|
|
||||||
"validation": {
|
|
||||||
"maxLength": "Tag should not exceed 30 characters",
|
|
||||||
"maxCount": "Maximum 30 tags allowed",
|
|
||||||
"duplicate": "This tag already exists"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"recipeTab": {
|
"recipeTab": {
|
||||||
"noRecipesFound": "No recipes found that use this Lora.",
|
"noRecipesFound": "No recipes found that use this Lora.",
|
||||||
"loadingRecipes": "Loading recipes...",
|
"loadingRecipes": "Loading recipes...",
|
||||||
@@ -716,11 +705,6 @@
|
|||||||
"finalizing": "Finalizing..."
|
"finalizing": "Finalizing..."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"showcase": {
|
|
||||||
"exampleImages": {
|
|
||||||
"deleteFailed": "Failed to delete example image: {error}"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"duplicates": {
|
"duplicates": {
|
||||||
"found": "Found {count} duplicate groups",
|
"found": "Found {count} duplicate groups",
|
||||||
"showNotification": "Show Duplicates Notification",
|
"showNotification": "Show Duplicates Notification",
|
||||||
@@ -900,7 +884,11 @@
|
|||||||
"renameFailed": "Failed to rename file: {message}",
|
"renameFailed": "Failed to rename file: {message}",
|
||||||
"moveFailed": "Failed to move model(s): {message}",
|
"moveFailed": "Failed to move model(s): {message}",
|
||||||
"pleaseSelectRoot": "Please select a {type} root directory",
|
"pleaseSelectRoot": "Please select a {type} root directory",
|
||||||
"nameTooLong": "Model name is limited to 100 characters"
|
"nameTooLong": "Model name is limited to 100 characters",
|
||||||
|
"verificationAlreadyDone": "This group has already been verified",
|
||||||
|
"verificationCompleteMismatch": "Verification complete. {count} file(s) have different actual hashes.",
|
||||||
|
"verificationCompleteSuccess": "Verification complete. All files are confirmed duplicates.",
|
||||||
|
"verificationFailed": "Failed to verify hashes: {message}"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"atLeastOneOption": "At least one search option must be selected"
|
"atLeastOneOption": "At least one search option must be selected"
|
||||||
@@ -930,17 +918,6 @@
|
|||||||
"cleared": "Filters cleared"
|
"cleared": "Filters cleared"
|
||||||
},
|
},
|
||||||
"downloads": {
|
"downloads": {
|
||||||
"selectVersion": "Please select a version",
|
|
||||||
"versionExists": "This version already exists in your library",
|
|
||||||
"completed": "Download completed successfully",
|
|
||||||
"alreadyInProgress": "Download already in progress",
|
|
||||||
"enterLocationFirst": "Please enter a download location first",
|
|
||||||
"started": "Example images download started",
|
|
||||||
"startFailed": "Failed to start download",
|
|
||||||
"paused": "Download paused",
|
|
||||||
"pauseFailed": "Failed to pause download",
|
|
||||||
"resumed": "Download resumed",
|
|
||||||
"resumeFailed": "Failed to resume download",
|
|
||||||
"imagesCompleted": "Example images {action} completed",
|
"imagesCompleted": "Example images {action} completed",
|
||||||
"imagesFailed": "Example images {action} failed",
|
"imagesFailed": "Example images {action} failed",
|
||||||
"loadError": "Error loading downloads: {message}",
|
"loadError": "Error loading downloads: {message}",
|
||||||
@@ -966,12 +943,6 @@
|
|||||||
"updateFailed": "Failed to update trigger words",
|
"updateFailed": "Failed to update trigger words",
|
||||||
"copyFailed": "Copy failed"
|
"copyFailed": "Copy failed"
|
||||||
},
|
},
|
||||||
"examples": {
|
|
||||||
"pathUpdated": "Example images path updated successfully",
|
|
||||||
"deleted": "Example image deleted",
|
|
||||||
"deleteFailed": "Failed to delete example image",
|
|
||||||
"setPreviewFailed": "Failed to set preview image"
|
|
||||||
},
|
|
||||||
"virtual": {
|
"virtual": {
|
||||||
"loadFailed": "Failed to load items",
|
"loadFailed": "Failed to load items",
|
||||||
"loadMoreFailed": "Failed to load more items",
|
"loadMoreFailed": "Failed to load more items",
|
||||||
@@ -980,19 +951,28 @@
|
|||||||
"bulk": {
|
"bulk": {
|
||||||
"unableToSelectAll": "Unable to select all items"
|
"unableToSelectAll": "Unable to select all items"
|
||||||
},
|
},
|
||||||
"tags": {
|
"duplicates": {
|
||||||
"tagTooLong": "Tag is too long (max {max} characters)",
|
"findFailed": "Failed to find duplicates: {message}",
|
||||||
"tooManyTags": "Too many tags (max {max} tags)",
|
"noDuplicatesFound": "No duplicate {type} found",
|
||||||
"tagAlreadyExists": "Tag already exists"
|
"noItemsSelected": "No {type} selected for deletion",
|
||||||
|
"deleteError": "Error: {message}",
|
||||||
|
"deleteSuccess": "Successfully deleted {count} {type}",
|
||||||
|
"deleteFailed": "Failed to delete {type}: {message}"
|
||||||
},
|
},
|
||||||
"favorites": {
|
"controls": {
|
||||||
"added": "Added to favorites",
|
"reloadFailed": "Failed to reload {pageType}: {message}",
|
||||||
"removed": "Removed from favorites",
|
"refreshFailed": "Failed to {action} {pageType}: {message}",
|
||||||
"updateFailed": "Failed to update favorite status"
|
"fetchMetadataFailed": "Failed to fetch metadata: {message}",
|
||||||
|
"clearFilterFailed": "Failed to clear custom filter: {message}"
|
||||||
},
|
},
|
||||||
"workflow": {
|
"contextMenu": {
|
||||||
"checkpointNotImplemented": "Send checkpoint to workflow - feature to be implemented",
|
"contentRatingSet": "Content rating set to {level}",
|
||||||
"failedToSend": "Failed to send LoRA to workflow"
|
"contentRatingFailed": "Failed to set content rating: {message}",
|
||||||
|
"relinkSuccess": "Model successfully re-linked to Civitai",
|
||||||
|
"relinkFailed": "Error: {message}",
|
||||||
|
"fetchMetadataFirst": "Please fetch metadata from CivitAI first",
|
||||||
|
"noCivitaiInfo": "No CivitAI information available",
|
||||||
|
"missingHash": "Model hash not available"
|
||||||
},
|
},
|
||||||
"exampleImages": {
|
"exampleImages": {
|
||||||
"checkError": "Error checking for example images",
|
"checkError": "Error checking for example images",
|
||||||
|
|||||||
@@ -587,17 +587,6 @@
|
|||||||
"recipes": "正在加载配方...",
|
"recipes": "正在加载配方...",
|
||||||
"examples": "正在加载示例..."
|
"examples": "正在加载示例..."
|
||||||
},
|
},
|
||||||
"tags": {
|
|
||||||
"messages": {
|
|
||||||
"updated": "标签更新成功",
|
|
||||||
"updateFailed": "更新标签失败"
|
|
||||||
},
|
|
||||||
"validation": {
|
|
||||||
"maxLength": "标签长度不能超过30个字符",
|
|
||||||
"maxCount": "最多允许30个标签",
|
|
||||||
"duplicate": "该标签已存在"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"recipeTab": {
|
"recipeTab": {
|
||||||
"noRecipesFound": "未找到使用此 LoRA 的配方。",
|
"noRecipesFound": "未找到使用此 LoRA 的配方。",
|
||||||
"loadingRecipes": "正在加载配方...",
|
"loadingRecipes": "正在加载配方...",
|
||||||
@@ -897,7 +886,11 @@
|
|||||||
"renameFailed": "重命名文件失败:{message}",
|
"renameFailed": "重命名文件失败:{message}",
|
||||||
"moveFailed": "移动模型失败:{message}",
|
"moveFailed": "移动模型失败:{message}",
|
||||||
"pleaseSelectRoot": "请选择 {type} 根目录",
|
"pleaseSelectRoot": "请选择 {type} 根目录",
|
||||||
"nameTooLong": "模型名称限制为100个字符"
|
"nameTooLong": "模型名称限制为100个字符",
|
||||||
|
"verificationAlreadyDone": "This group has already been verified",
|
||||||
|
"verificationCompleteMismatch": "Verification complete. {count} file(s) have different actual hashes.",
|
||||||
|
"verificationCompleteSuccess": "Verification complete. All files are confirmed duplicates.",
|
||||||
|
"verificationFailed": "Failed to verify hashes: {message}"
|
||||||
},
|
},
|
||||||
"search": {
|
"search": {
|
||||||
"atLeastOneOption": "至少需要选择一个搜索选项"
|
"atLeastOneOption": "至少需要选择一个搜索选项"
|
||||||
|
|||||||
@@ -25,10 +25,10 @@ export const ModelContextMenuMixin = {
|
|||||||
try {
|
try {
|
||||||
await this.saveModelMetadata(filePath, { preview_nsfw_level: level });
|
await this.saveModelMetadata(filePath, { preview_nsfw_level: level });
|
||||||
|
|
||||||
showToast(`Content rating set to ${getNSFWLevelName(level)}`, 'success');
|
showToast('toast.contextMenu.contentRatingSet', { level: getNSFWLevelName(level) }, 'success');
|
||||||
this.nsfwSelector.style.display = 'none';
|
this.nsfwSelector.style.display = 'none';
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast(`Failed to set content rating: ${error.message}`, 'error');
|
showToast('toast.contextMenu.contentRatingFailed', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@@ -147,7 +147,7 @@ export const ModelContextMenuMixin = {
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|
||||||
if (data.success) {
|
if (data.success) {
|
||||||
showToast('Model successfully re-linked to Civitai', 'success');
|
showToast('toast.contextMenu.relinkSuccess', {}, 'success');
|
||||||
// Reload the current view to show updated data
|
// Reload the current view to show updated data
|
||||||
await this.resetAndReload();
|
await this.resetAndReload();
|
||||||
} else {
|
} else {
|
||||||
@@ -155,7 +155,7 @@ export const ModelContextMenuMixin = {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error re-linking model:', error);
|
console.error('Error re-linking model:', error);
|
||||||
showToast(`Error: ${error.message}`, 'error');
|
showToast('toast.contextMenu.relinkFailed', { message: error.message }, 'error');
|
||||||
} finally {
|
} finally {
|
||||||
state.loadingManager.hide();
|
state.loadingManager.hide();
|
||||||
}
|
}
|
||||||
@@ -211,10 +211,10 @@ export const ModelContextMenuMixin = {
|
|||||||
if (this.currentCard.querySelector('.fa-globe')) {
|
if (this.currentCard.querySelector('.fa-globe')) {
|
||||||
this.currentCard.querySelector('.fa-globe').click();
|
this.currentCard.querySelector('.fa-globe').click();
|
||||||
} else {
|
} else {
|
||||||
showToast('Please fetch metadata from CivitAI first', 'info');
|
showToast('toast.contextMenu.fetchMetadataFirst', {}, 'info');
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
showToast('No CivitAI information available', 'info');
|
showToast('toast.contextMenu.noCivitaiInfo', {}, 'info');
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
case 'relink-civitai':
|
case 'relink-civitai':
|
||||||
@@ -232,7 +232,7 @@ export const ModelContextMenuMixin = {
|
|||||||
async downloadExampleImages() {
|
async downloadExampleImages() {
|
||||||
const modelHash = this.currentCard.dataset.sha256;
|
const modelHash = this.currentCard.dataset.sha256;
|
||||||
if (!modelHash) {
|
if (!modelHash) {
|
||||||
showToast('Model hash not available', 'error');
|
showToast('toast.contextMenu.missingHash', {}, 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export class DuplicatesManager {
|
|||||||
this.duplicateGroups = data.duplicate_groups || [];
|
this.duplicateGroups = data.duplicate_groups || [];
|
||||||
|
|
||||||
if (this.duplicateGroups.length === 0) {
|
if (this.duplicateGroups.length === 0) {
|
||||||
showToast('No duplicate recipes found', 'info');
|
showToast('toast.duplicates.noDuplicatesFound', { type: 'recipes' }, 'info');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,7 +34,7 @@ export class DuplicatesManager {
|
|||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error finding duplicates:', error);
|
console.error('Error finding duplicates:', error);
|
||||||
showToast('Failed to find duplicates: ' + error.message, 'error');
|
showToast('toast.duplicates.findFailed', { message: error.message }, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -325,7 +325,7 @@ export class DuplicatesManager {
|
|||||||
|
|
||||||
async deleteSelectedDuplicates() {
|
async deleteSelectedDuplicates() {
|
||||||
if (this.selectedForDeletion.size === 0) {
|
if (this.selectedForDeletion.size === 0) {
|
||||||
showToast('No recipes selected for deletion', 'info');
|
showToast('toast.duplicates.noItemsSelected', { type: 'recipes' }, 'info');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -340,7 +340,7 @@ export class DuplicatesManager {
|
|||||||
modalManager.showModal('duplicateDeleteModal');
|
modalManager.showModal('duplicateDeleteModal');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error preparing delete:', error);
|
console.error('Error preparing delete:', error);
|
||||||
showToast('Error: ' + error.message, 'error');
|
showToast('toast.duplicates.deleteError', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -371,7 +371,7 @@ export class DuplicatesManager {
|
|||||||
throw new Error(data.error || 'Unknown error deleting recipes');
|
throw new Error(data.error || 'Unknown error deleting recipes');
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast(`Successfully deleted ${data.total_deleted} recipes`, 'success');
|
showToast('toast.duplicates.deleteSuccess', { count: data.total_deleted, type: 'recipes' }, 'success');
|
||||||
|
|
||||||
// Exit duplicate mode if deletions were successful
|
// Exit duplicate mode if deletions were successful
|
||||||
if (data.total_deleted > 0) {
|
if (data.total_deleted > 0) {
|
||||||
@@ -380,7 +380,7 @@ export class DuplicatesManager {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error deleting recipes:', error);
|
console.error('Error deleting recipes:', error);
|
||||||
showToast('Failed to delete recipes: ' + error.message, 'error');
|
showToast('toast.duplicates.deleteFailed', { type: 'recipes', message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export class ModelDuplicatesManager {
|
|||||||
this.updateDuplicatesBadge(this.duplicateGroups.length);
|
this.updateDuplicatesBadge(this.duplicateGroups.length);
|
||||||
|
|
||||||
if (this.duplicateGroups.length === 0) {
|
if (this.duplicateGroups.length === 0) {
|
||||||
showToast('No duplicate models found', 'info');
|
showToast('toast.duplicates.noDuplicatesFound', { type: this.modelType }, 'info');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -130,7 +130,7 @@ export class ModelDuplicatesManager {
|
|||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error finding duplicates:', error);
|
console.error('Error finding duplicates:', error);
|
||||||
showToast('Failed to find duplicates: ' + error.message, 'error');
|
showToast('toast.duplicates.findFailed', { message: error.message }, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -594,7 +594,7 @@ export class ModelDuplicatesManager {
|
|||||||
|
|
||||||
async deleteSelectedDuplicates() {
|
async deleteSelectedDuplicates() {
|
||||||
if (this.selectedForDeletion.size === 0) {
|
if (this.selectedForDeletion.size === 0) {
|
||||||
showToast('No models selected for deletion', 'info');
|
showToast('toast.duplicates.noItemsSelected', { type: this.modelType }, 'info');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -609,7 +609,7 @@ export class ModelDuplicatesManager {
|
|||||||
modalManager.showModal('modelDuplicateDeleteModal');
|
modalManager.showModal('modelDuplicateDeleteModal');
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error preparing delete:', error);
|
console.error('Error preparing delete:', error);
|
||||||
showToast('Error: ' + error.message, 'error');
|
showToast('toast.duplicates.deleteError', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -640,7 +640,7 @@ export class ModelDuplicatesManager {
|
|||||||
throw new Error(data.error || 'Unknown error deleting models');
|
throw new Error(data.error || 'Unknown error deleting models');
|
||||||
}
|
}
|
||||||
|
|
||||||
showToast(`Successfully deleted ${data.total_deleted} models`, 'success');
|
showToast('toast.duplicates.deleteSuccess', { count: data.total_deleted, type: this.modelType }, 'success');
|
||||||
|
|
||||||
// If models were successfully deleted
|
// If models were successfully deleted
|
||||||
if (data.total_deleted > 0) {
|
if (data.total_deleted > 0) {
|
||||||
@@ -678,7 +678,7 @@ export class ModelDuplicatesManager {
|
|||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error deleting models:', error);
|
console.error('Error deleting models:', error);
|
||||||
showToast('Failed to delete models: ' + error.message, 'error');
|
showToast('toast.duplicates.deleteFailed', { type: this.modelType, message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -745,7 +745,7 @@ export class ModelDuplicatesManager {
|
|||||||
|
|
||||||
// Check if already verified
|
// Check if already verified
|
||||||
if (this.verifiedGroups.has(groupHash)) {
|
if (this.verifiedGroups.has(groupHash)) {
|
||||||
showToast('This group has already been verified', 'info');
|
showToast('toast.models.verificationAlreadyDone', {}, 'info');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -793,14 +793,14 @@ export class ModelDuplicatesManager {
|
|||||||
|
|
||||||
// Show appropriate toast message
|
// Show appropriate toast message
|
||||||
if (mismatchedFiles.length > 0) {
|
if (mismatchedFiles.length > 0) {
|
||||||
showToast(`Verification complete. ${mismatchedFiles.length} file(s) have different actual hashes.`, 'warning');
|
showToast('toast.models.verificationCompleteMismatch', { count: mismatchedFiles.length }, 'warning');
|
||||||
} else {
|
} else {
|
||||||
showToast('Verification complete. All files are confirmed duplicates.', 'success');
|
showToast('toast.models.verificationCompleteSuccess', {}, 'success');
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error verifying hashes:', error);
|
console.error('Error verifying hashes:', error);
|
||||||
showToast('Failed to verify hashes: ' + error.message, 'error');
|
showToast('toast.models.verificationFailed', { message: error.message }, 'error');
|
||||||
} finally {
|
} finally {
|
||||||
// Hide loading state
|
// Hide loading state
|
||||||
state.loadingManager.hide();
|
state.loadingManager.hide();
|
||||||
|
|||||||
@@ -293,7 +293,7 @@ export class PageControls {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error reloading ${this.pageType}:`, error);
|
console.error(`Error reloading ${this.pageType}:`, error);
|
||||||
showToast(`Failed to reload ${this.pageType}: ${error.message}`, 'error');
|
showToast('toast.controls.reloadFailed', { pageType: this.pageType, message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -316,7 +316,7 @@ export class PageControls {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Error ${fullRebuild ? 'rebuilding' : 'refreshing'} ${this.pageType}:`, error);
|
console.error(`Error ${fullRebuild ? 'rebuilding' : 'refreshing'} ${this.pageType}:`, error);
|
||||||
showToast(`Failed to ${fullRebuild ? 'rebuild' : 'refresh'} ${this.pageType}: ${error.message}`, 'error');
|
showToast('toast.controls.refreshFailed', { action: fullRebuild ? 'rebuild' : 'refresh', pageType: this.pageType, message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.modelDuplicatesManager) {
|
if (window.modelDuplicatesManager) {
|
||||||
@@ -338,7 +338,7 @@ export class PageControls {
|
|||||||
await this.api.fetchFromCivitai();
|
await this.api.fetchFromCivitai();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error fetching metadata:', error);
|
console.error('Error fetching metadata:', error);
|
||||||
showToast('Failed to fetch metadata: ' + error.message, 'error');
|
showToast('toast.controls.fetchMetadataFailed', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,7 +374,7 @@ export class PageControls {
|
|||||||
await this.api.clearCustomFilter();
|
await this.api.clearCustomFilter();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error clearing custom filter:', error);
|
console.error('Error clearing custom filter:', error);
|
||||||
showToast('Failed to clear custom filter: ' + error.message, 'error');
|
showToast('toast.controls.clearFilterFailed', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ function getLoraStatusTitle(totalCount, missingCount) {
|
|||||||
*/
|
*/
|
||||||
function copyRecipeSyntax(recipeId) {
|
function copyRecipeSyntax(recipeId) {
|
||||||
if (!recipeId) {
|
if (!recipeId) {
|
||||||
showToast('Cannot copy recipe syntax: Missing recipe ID', 'error');
|
showToast('recipeTab.noRecipeId', {}, 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -177,7 +177,7 @@ function copyRecipeSyntax(recipeId) {
|
|||||||
})
|
})
|
||||||
.catch(err => {
|
.catch(err => {
|
||||||
console.error('Failed to copy: ', err);
|
console.error('Failed to copy: ', err);
|
||||||
showToast('Failed to copy recipe syntax', 'error');
|
showToast('recipeTab.copyFailed', {}, 'error');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -445,7 +445,7 @@ export function initMediaControlHandlers(container) {
|
|||||||
state.virtualScroller.updateSingleItem(result.model_file_path, updateData);
|
state.virtualScroller.updateSingleItem(result.model_file_path, updateData);
|
||||||
} else {
|
} else {
|
||||||
// Show error message
|
// Show error message
|
||||||
showToast('showcase.exampleImages.deleteFailed', { error: result.error }, 'error');
|
showToast('toast.exampleImages.deleteFailed', { error: result.error }, 'error');
|
||||||
|
|
||||||
// Reset button state
|
// Reset button state
|
||||||
this.disabled = false;
|
this.disabled = false;
|
||||||
|
|||||||
@@ -430,7 +430,7 @@ async function handleImportFiles(files, modelHash, importContainer) {
|
|||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error importing examples:', error);
|
console.error('Error importing examples:', error);
|
||||||
showToast(`Failed to import example images: ${error.message}`, 'error');
|
showToast('import.importFailed', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ export class DownloadManager {
|
|||||||
|
|
||||||
this.updateTargetPath();
|
this.updateTargetPath();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast('downloads.loadError', { message: error.message }, 'error');
|
showToast('toast.downloads.loadError', { message: error.message }, 'error');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -418,7 +418,7 @@ export class DownloadManager {
|
|||||||
const config = this.apiClient.apiConfig.config;
|
const config = this.apiClient.apiConfig.config;
|
||||||
|
|
||||||
if (!modelRoot) {
|
if (!modelRoot) {
|
||||||
showToast(`Please select a ${config.displayName} root directory`, 'error');
|
showToast('models.pleaseSelectRoot', { type: config.displayName }, 'error');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -507,7 +507,7 @@ export class DownloadManager {
|
|||||||
await resetAndReload(true);
|
await resetAndReload(true);
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
showToast('downloads.downloadError', { message: error.message }, 'error');
|
showToast('toast.downloads.downloadError', { message: error.message }, 'error');
|
||||||
} finally {
|
} finally {
|
||||||
this.loadingManager.hide();
|
this.loadingManager.hide();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -399,7 +399,7 @@ class ExampleImagesManager {
|
|||||||
|
|
||||||
if (data.status.status === 'completed' && !this.hasShownCompletionToast) {
|
if (data.status.status === 'completed' && !this.hasShownCompletionToast) {
|
||||||
const actionType = this.isMigrating ? 'migration' : 'download';
|
const actionType = this.isMigrating ? 'migration' : 'download';
|
||||||
showToast(`Example images ${actionType} completed`, 'success');
|
showToast('toast.downloads.imagesCompleted', { action: actionType }, 'success');
|
||||||
// Mark as shown to prevent duplicate toasts
|
// Mark as shown to prevent duplicate toasts
|
||||||
this.hasShownCompletionToast = true;
|
this.hasShownCompletionToast = true;
|
||||||
// Reset migration flag
|
// Reset migration flag
|
||||||
@@ -408,7 +408,7 @@ class ExampleImagesManager {
|
|||||||
setTimeout(() => this.hideProgressPanel(), 5000);
|
setTimeout(() => this.hideProgressPanel(), 5000);
|
||||||
} else if (data.status.status === 'error') {
|
} else if (data.status.status === 'error') {
|
||||||
const actionType = this.isMigrating ? 'migration' : 'download';
|
const actionType = this.isMigrating ? 'migration' : 'download';
|
||||||
showToast(`Example images ${actionType} failed`, 'error');
|
showToast('toast.downloads.imagesFailed', { action: actionType }, 'error');
|
||||||
this.isMigrating = false;
|
this.isMigrating = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -447,7 +447,7 @@ async function sendToSpecificNode(nodeIds, loraSyntax, replaceMode, syntaxType)
|
|||||||
} else {
|
} else {
|
||||||
const messageKey = syntaxType === 'recipe' ?
|
const messageKey = syntaxType === 'recipe' ?
|
||||||
'uiHelpers.workflow.recipeFailedToSend' :
|
'uiHelpers.workflow.recipeFailedToSend' :
|
||||||
'toast.workflow.failedToSend';
|
'uiHelpers.workflow.loraFailedToSend';
|
||||||
showToast(messageKey, {}, 'error');
|
showToast(messageKey, {}, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -455,7 +455,7 @@ async function sendToSpecificNode(nodeIds, loraSyntax, replaceMode, syntaxType)
|
|||||||
console.error('Failed to send to workflow:', error);
|
console.error('Failed to send to workflow:', error);
|
||||||
const messageKey = syntaxType === 'recipe' ?
|
const messageKey = syntaxType === 'recipe' ?
|
||||||
'uiHelpers.workflow.recipeFailedToSend' :
|
'uiHelpers.workflow.recipeFailedToSend' :
|
||||||
'toast.workflow.failedToSend';
|
'uiHelpers.workflow.loraFailedToSend';
|
||||||
showToast(messageKey, {}, 'error');
|
showToast(messageKey, {}, 'error');
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user