Localize the managed-service resources panel.

Add components.serviceResources and move the resources/scaling panel
(metrics, storage usage/expansion, CPU/memory adjust, dump restore,
upgrade toasts) onto it; route through the locale-aware router.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
keyhan
2026-06-11 21:02:57 +03:30
parent 96d24b50a1
commit deef498f65
4 changed files with 136 additions and 50 deletions
+44
View File
@@ -315,6 +315,50 @@ const en: Dictionary = {
deleteConfirmMessage: 'Delete “{label}”? The dump file will be permanently removed.',
snapStatus: { completed: 'completed', failed: 'failed' },
},
serviceResources: {
title: 'Resources & Scaling',
hide: 'Hide',
monitor: 'Monitor',
deployToView: 'Deploy the service to view metrics and adjust resources.',
loadingMetrics: 'Loading metrics…',
replicas: 'Replicas',
pods: 'Pods',
metrics: 'Metrics',
serviceStopped: 'Service is stopped.',
noMetrics: 'No resource metrics yet.',
storage: 'Storage',
loadingStorage: 'Loading storage…',
used: 'Used',
allocated: 'Allocated',
expansionNote: 'Only expansion is allowed. Use Apply changes below.',
storageChargedNote: ' Additional storage is charged for the remaining billing period.',
storageUnavailable: 'Storage metrics unavailable.',
adjustCpuMem: 'Adjust CPU / memory',
redisResources: 'Redis resources',
rabbitmqResources: 'RabbitMQ resources',
upgradeChargeNote: 'Upgrades that increase cost are charged for the remaining billing period (wallet or invoice), same as applications.',
applying: 'Applying…',
applyChanges: 'Apply changes',
restoreDump: 'Restore database dump',
restoring: 'Restoring database…',
uploadToRestore: 'Upload SQL dump to restore',
uploadFormats: '.sql, .gz, or .dump — max 500MB',
workloads: { database: 'Database', redis: 'Redis', rabbitmq: 'RabbitMQ' },
resourcesUpdated: 'Resources updated',
updateFailed: 'Failed to update resources',
upgradedPaid: 'Resources upgraded! Paid {amount} Toman',
updatedSuccess: 'Resources updated successfully',
upgradeFailed: 'Failed to upgrade resources',
calcFailed: 'Failed to calculate upgrade cost',
invoiceCreated: 'Invoice created. Choose how you want to pay.',
invoiceFailed: 'Failed to create upgrade invoice',
restoredSuccess: 'Database restored successfully',
restoreFailed: 'Database restore failed',
uploadFailed: 'Failed to upload database dump',
invalidFile: 'Please upload a .sql, .dump, or .gz file',
fileTooLarge: 'File size must be less than 500MB',
renewFirst: 'Renew the service before changing resources',
},
},
nav: {
+44
View File
@@ -314,6 +314,50 @@ const fa = {
deleteConfirmMessage: 'حذف «{label}»؟ فایل dump برای همیشه حذف می‌شود.',
snapStatus: { completed: 'کامل', failed: 'ناموفق' },
},
serviceResources: {
title: 'منابع و مقیاس‌بندی',
hide: 'پنهان',
monitor: 'پایش',
deployToView: 'برای دیدن متریک‌ها و تنظیم منابع، سرویس را منتشر کن.',
loadingMetrics: 'در حال بارگذاری متریک‌ها…',
replicas: 'رپلیکاها',
pods: 'پادها',
metrics: 'متریک‌ها',
serviceStopped: 'سرویس متوقف است.',
noMetrics: 'هنوز متریک منابعی نیست.',
storage: 'فضای ذخیره',
loadingStorage: 'در حال بارگذاری فضای ذخیره…',
used: 'مصرف‌شده',
allocated: 'تخصیص‌یافته',
expansionNote: 'فقط افزایش مجاز است. از «اعمال تغییرات» زیر استفاده کن.',
storageChargedNote: ' فضای ذخیرهٔ اضافه برای بازهٔ باقی‌ماندهٔ صورت‌حساب محاسبه می‌شود.',
storageUnavailable: 'متریک فضای ذخیره در دسترس نیست.',
adjustCpuMem: 'تنظیم CPU / حافظه',
redisResources: 'منابع Redis',
rabbitmqResources: 'منابع RabbitMQ',
upgradeChargeNote: 'ارتقاهایی که هزینه را افزایش می‌دهند برای بازهٔ باقی‌ماندهٔ صورت‌حساب (کیف‌پول یا فاکتور) محاسبه می‌شوند، مثل اپلیکیشن‌ها.',
applying: 'در حال اعمال…',
applyChanges: 'اعمال تغییرات',
restoreDump: 'بازیابی dump دیتابیس',
restoring: 'در حال بازیابی دیتابیس…',
uploadToRestore: 'آپلود SQL dump برای بازیابی',
uploadFormats: '.sql، .gz یا .dump — حداکثر ۵۰۰ مگابایت',
workloads: { database: 'دیتابیس', redis: 'Redis', rabbitmq: 'RabbitMQ' },
resourcesUpdated: 'منابع به‌روزرسانی شد',
updateFailed: 'به‌روزرسانی منابع ناموفق بود',
upgradedPaid: 'منابع ارتقا یافت! {amount} تومان پرداخت شد',
updatedSuccess: 'منابع با موفقیت به‌روزرسانی شد',
upgradeFailed: 'ارتقای منابع ناموفق بود',
calcFailed: 'محاسبهٔ هزینهٔ ارتقا ناموفق بود',
invoiceCreated: 'فاکتور ساخته شد. روش پرداخت را انتخاب کن.',
invoiceFailed: 'ساخت فاکتور ارتقا ناموفق بود',
restoredSuccess: 'دیتابیس با موفقیت بازیابی شد',
restoreFailed: 'بازیابی دیتابیس ناموفق بود',
uploadFailed: 'آپلود dump دیتابیس ناموفق بود',
invalidFile: 'لطفاً فایل .sql، .dump یا .gz آپلود کن',
fileTooLarge: 'حجم فایل باید کمتر از ۵۰۰ مگابایت باشد',
renewFirst: 'پیش از تغییر منابع، سرویس را تمدید کن',
},
},
nav: {