@lesliechan721/aw 0.1.0-beta.62 → 0.1.0-beta.64
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/tui/console-app-v4.js +19 -10
- package/dist/src/tui/console-app-v4.js.map +1 -1
- package/dist/src/tui/controller-runtime.js +56 -12
- package/dist/src/tui/controller-runtime.js.map +1 -1
- package/dist/src/utils/plugin-config-references.d.ts +2 -0
- package/dist/src/utils/plugin-config-references.js +10 -5
- package/dist/src/utils/plugin-config-references.js.map +1 -1
- package/package.json +3 -3
|
@@ -524,26 +524,31 @@ function configUnavailableCanRecoverSource(route) {
|
|
|
524
524
|
}
|
|
525
525
|
function configUnavailableDiagnostic(route) {
|
|
526
526
|
const invalidLayer = (route.invalidStores?.length ?? 0) > 0;
|
|
527
|
+
const memoryExhausted = route.diagnosticCode === 'configValidationMemoryExhausted';
|
|
527
528
|
const invalidLayerLabel = route.invalidStores?.map((store) => store.scope === 'user' ? '个人默认' : '当前项目').join('、');
|
|
528
529
|
return {
|
|
529
530
|
severity: 'error',
|
|
530
|
-
title: invalidLayer ? '设置层无效,已阻止编辑'
|
|
531
|
+
title: invalidLayer ? '设置层无效,已阻止编辑'
|
|
532
|
+
: memoryExhausted ? '设置校验内存不足' : '插件定义或来源不可用',
|
|
531
533
|
userMessage: invalidLayer
|
|
532
534
|
? '高优先级设置层无效,不能静默使用较低层或默认值。'
|
|
533
|
-
: '
|
|
535
|
+
: memoryExhausted ? '配置校验引擎的内存已耗尽,当前不能继续校验设置。'
|
|
536
|
+
: '当前无法取得可信的字段定义,因此不能验证新值。',
|
|
534
537
|
impact: [
|
|
535
538
|
{ state: 'blocked', message: invalidLayer
|
|
536
539
|
? `${invalidLayerLabel}设置层、普通 unset 和渲染都已阻止。`
|
|
537
|
-
: '
|
|
540
|
+
: memoryExhausted ? '重新启动 AW 前,不能编辑这个插件的字段设置。'
|
|
541
|
+
: '恢复可信字段定义前,不能编辑这个插件的字段设置。' },
|
|
538
542
|
{ state: 'preserved', message: invalidLayer
|
|
539
543
|
? '较低层或默认值只可作为预览;当前无效层仍保持不变。'
|
|
540
544
|
: '已保存的设置保持不变。' },
|
|
541
545
|
],
|
|
542
546
|
nextStep: invalidLayer
|
|
543
547
|
? '确认后重置整个目标设置层;不会创建备份。'
|
|
544
|
-
:
|
|
545
|
-
|
|
546
|
-
|
|
548
|
+
: memoryExhausted ? '退出并重新启动 AW,然后再次打开设置。'
|
|
549
|
+
: configUnavailableCanRecoverSource(route)
|
|
550
|
+
? '重新检查来源,然后再次打开设置。'
|
|
551
|
+
: '查看技术详情,确认字段定义不可用的原因。',
|
|
547
552
|
technical: {
|
|
548
553
|
code: safeDiagnosticCode(route.diagnosticCode, 'configUnavailable'),
|
|
549
554
|
stage: safeDiagnosticCode(route.diagnosticStage, 'read-config'),
|
|
@@ -555,7 +560,8 @@ function configUnavailableDiagnostic(route) {
|
|
|
555
560
|
],
|
|
556
561
|
checks: invalidLayer
|
|
557
562
|
? ['只删除所选 user 或 project 设置层。', '重置后重新读取继承值和默认值。']
|
|
558
|
-
: ['
|
|
563
|
+
: memoryExhausted ? ['退出并重新启动 AW。', '若问题再次出现,升级 AW 后重试。']
|
|
564
|
+
: ['恢复插件来源和可信插件定义。', '重新检查来源后再次打开设置。'],
|
|
559
565
|
},
|
|
560
566
|
};
|
|
561
567
|
}
|
|
@@ -1571,6 +1577,7 @@ export function ConsoleAppV4(props) {
|
|
|
1571
1577
|
}, [configRoute?.pluginId, configRoute?.layer.scope, props.controller]);
|
|
1572
1578
|
useEffect(() => {
|
|
1573
1579
|
if (route.name !== 'configUnavailable'
|
|
1580
|
+
|| route.diagnosticCode === 'configValidationMemoryExhausted'
|
|
1574
1581
|
|| (!route.invalidStores?.length && !route.storedScopes?.length && !route.layer)) {
|
|
1575
1582
|
setConfigResetAvailability({});
|
|
1576
1583
|
return;
|
|
@@ -1602,6 +1609,7 @@ export function ConsoleAppV4(props) {
|
|
|
1602
1609
|
props.controller,
|
|
1603
1610
|
route.name,
|
|
1604
1611
|
route.name === 'configUnavailable' ? route.pluginId : '',
|
|
1612
|
+
route.name === 'configUnavailable' ? route.diagnosticCode : '',
|
|
1605
1613
|
route.name === 'configUnavailable'
|
|
1606
1614
|
? route.invalidStores?.map((store) => `${store.scope}:${store.code}`).join('|') ?? ''
|
|
1607
1615
|
: '',
|
|
@@ -6557,9 +6565,10 @@ export function ConsoleAppV4(props) {
|
|
|
6557
6565
|
const canRecoverSource = configUnavailableCanRecoverSource(route);
|
|
6558
6566
|
title = diagnostic.title;
|
|
6559
6567
|
description = '';
|
|
6560
|
-
const resetScopes = route.
|
|
6561
|
-
|
|
6562
|
-
|
|
6568
|
+
const resetScopes = route.diagnosticCode === 'configValidationMemoryExhausted' ? []
|
|
6569
|
+
: route.invalidStores?.map(({ scope }) => scope)
|
|
6570
|
+
?? route.storedScopes
|
|
6571
|
+
?? (route.layer ? [route.layer.scope] : []);
|
|
6563
6572
|
actions = [
|
|
6564
6573
|
...resetScopes.flatMap((scope) => {
|
|
6565
6574
|
const availability = configResetAvailability[scope];
|