فینورا پرو - سامانه جامع حسابداری و صدور فاکتور
feat(a02): show native SQL, LocalDB and free-space readiness without modifying host
davoodmehraban89 committed
Oct 30, 2026 at 17:08 UTC
5d4cda808756353095e1d6f445a7d5982495fd58
1 file changed
+45
src/views/SettingsView.js
+45
@@ -486,10 +486,55 @@ class SettingsViewImpl {
486
' </div>',
487
' <p style="font-size:12px;line-height:1.9;color:var(--text-muted)">این مرحله فقط ساختار بسته ZIP را شناسایی میکند. بازیابی SQL Server، انتقال اطلاعات و تأیید صحت حسابداری هنوز پیادهسازی نشدهاند.</p>',
488
' <button class="btn btn-secondary" onclick="window.SettingsView.openHolooBackupProbe()">انتخاب بکاپ هلو و بررسی اولیه</button>',
489
+ ' <button class="btn btn-secondary" style="margin-top:8px" onclick="window.SettingsView.checkHolooMigrationReadiness()">بررسی پیشنیازهای رایانه برای انتقال از هلو</button>',
490
'</div>'
491
].join('');
492
}
493
494
+ // Native read-only system diagnostics; never installs or configures SQL Server.
495
+ async checkHolooMigrationReadiness() {
496
+ if (!Auth.isAdmin()) {
497
+ Toast.error('فقط مدیر میتواند پیشنیازهای مهاجرت را بررسی کند');
498
+ return;
499
+ }
500
+ const invoke = globalThis.__TAURI_INTERNALS__?.invoke;
501
+ if (typeof invoke !== 'function') {
502
+ Toast.warning('بررسی پیشنیازها فقط در نسخه نصبشده ویندوز امکانپذیر است');
503
+ return;
504
+ }
505
+ try {
506
+ const report = await invoke('migration_system_readiness');
507
+ const fmtCount = value => Number.isInteger(value) && value >= 0
508
+ ? (value === 0 ? 'یافت نشد' : Formatters.number(value) + ' مورد شناسایی شد')
509
+ : 'امکان تشخیص وجود ندارد';
510
+ const body = [
511
+ '<p>این بررسی فقط وضعیت رایانه را میخواند؛ چیزی نصب یا تغییر داده نمیشود.</p>',
512
+ '<div style="font-size:12.5px;line-height:2.2">',
513
+ '<div>ویندوز ۶۴ بیتی: <strong>' + (report.windowsX64 ? 'شناسایی شد' : 'شناسایی نشد') + '</strong></div>',
514
+ '<div>نمونههای SQL Server: <strong>' + fmtCount(report.sqlInstanceCount) + '</strong></div>',
515
+ '<div>نسخههای LocalDB: <strong>' + fmtCount(report.localdbVersionCount) + '</strong></div>',
516
+ '<div>فضای آزاد درایو داده کاربر: <strong>' +
517
+ (Number.isSafeInteger(report.freeGibAtUserAppData)
518
+ ? Formatters.number(report.freeGibAtUserAppData) + ' گیگابایت'
519
+ : 'قابل تشخیص نیست') + '</strong></div>',
520
+ '</div>',
521
+ '<div class="backup-warning" style="margin-top:12px">',
522
+ '⚠️ شناسایی SQL به معنی سازگاری آن با بکاپ هلو نیست. ',
523
+ 'هنوز SQL Server نصب نشده، فایل هلو بازیابی نشده و ورود اطلاعات مالی فعال نیست.',
524
+ '</div>'
525
+ ].join('');
526
+ Modal.open({
527
+ title: 'وضعیت پیشنیازهای مهاجرت هلو — فقط خواندنی',
528
+ body,
529
+ footer: '<button class="btn" onclick="FINORA.Modal.close()">بستن</button>',
530
+ size: 'md'
531
+ });
532
+ } catch {
533
+ // Avoid exposing native exception text or local configuration details.
534
+ Toast.error('بررسی پیشنیازها انجام نشد؛ هیچ تغییری در سیستم ایجاد نشد');
535
+ }
536
+ }
537
+
538
openHolooBackupProbe() {
539
if (!Auth.isAdmin()) {
540
Toast.error('فقط مدیر میتواند بررسی بکاپ هلو را آغاز کند');