diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts index fdeb7b1480..4943857939 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts @@ -1660,6 +1660,15 @@ function describe(tool: string, values: Values, result: unknown, names: AiDetail return {hood, blocks: [...(rows.length ? [{type: 'facts' as const, rows}] : []), ...(warnings.length ? [{type: 'list' as const, label: text('widget-warnings'), rows: warnings.slice(0, MAX_ROWS)}] : [])]}; } + case 'create_scada_symbol_widget': { + const raw = typeof result === 'string' && result.startsWith('OK: ') ? aiParse(result.slice(4)) : result; + const name = (isObject(raw) ? str(raw.name) : undefined) ?? str(values.name) ?? '—'; + if (!isObject(raw)) { + return {hood: text('create-scada-symbol-widget', {name}), blocks: generic(raw, 'result')}; + } + const rows = facts(raw, ['widgetTypeId']); + return {hood: text('create-scada-symbol-widget', {name}), blocks: rows.length ? [{type: 'facts', rows}] : []}; + } case 'check_scada_symbol': { if (!isObject(result)) { return {hood: text('check-scada-symbol'), blocks: generic(result, 'result')}; diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts b/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts index e8d866cb0a..fea0d637ad 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action.models.ts @@ -106,6 +106,7 @@ const TOOL_WORDS: Record = { create_scada_symbol: 'copy-scada-symbol', update_scada_symbol: 'update-scada-symbol', check_scada_symbol: 'check-scada-symbol', + create_scada_symbol_widget: 'create-scada-symbol-widget', save_two_factor_settings: 'save-two-factor-settings', save_oauth2_domain: 'save-oauth2-domain', read_my_account: 'read-my-account', diff --git a/ui-ngx/src/assets/locale/locale.constant-en_US.json b/ui-ngx/src/assets/locale/locale.constant-en_US.json index 1c950a30ce..c511047359 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -985,6 +985,7 @@ "copy-scada-symbol": "Copied the SCADA symbol as {{name}}", "change-scada-symbol": "Changed the SCADA symbol {{name}}", "check-scada-symbol": "Ran the SCADA symbol", + "create-scada-symbol-widget": "Added {{name}} to the widgets library", "scada-symbol-check-clean": "Rendered without errors", "scada-symbol-check-not-rendered": "The symbol did not render", "scada-symbol-behaviors": "Behaviors", @@ -1647,6 +1648,10 @@ "run": "Running the SCADA symbol", "done": "Ran the SCADA symbol" }, + "create-scada-symbol-widget": { + "run": "Adding the symbol to the widgets library", + "done": "Added the symbol to the widgets library" + }, "read-widget-parts": { "run": "Reading the widget's {{parts}}", "done": "Read the widget's {{parts}}" @@ -2234,6 +2239,7 @@ "scada-tags": "Search tags", "scada-copyOf": "Copy of", "scada-changed": "Changed", + "scada-bundle": "Bundle", "format": "Format", "templateType": "Template type", "added": "Added",