Browse Source

feat: the details of drawing SCADA pipes name the equipment and sides a line joins

pull/16833/head
Igor Kulikov 2 weeks ago
parent
commit
581a0fb075
  1. 6
      ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts

6
ui-ngx/src/app/modules/home/components/ai/ai-action-detail.models.ts

@ -1150,8 +1150,10 @@ function describe(tool: string, values: Values, result: unknown, names: AiDetail
}
case 'add_scada_connectors': {
const rows = (Array.isArray(values.lines) ? values.lines : []).filter(isObject)
.map((line, index) => `${str(line.name) ?? 'Line ' + (index + 1)} · ${Array.isArray(line.points) ? line.points.length : 0} points`
+ (isObject(line.flow) ? ' · flow' : ''));
.map((line, index) => `${str(line.name) ?? 'Line ' + (index + 1)} · ${isObject(line.from) && isObject(line.to)
? `${names.get(str(line.from.widgetId) ?? '')?.name ?? str(line.from.widgetId) ?? '—'} ${str(line.from.side) ?? ''} → `
+ `${names.get(str(line.to.widgetId) ?? '')?.name ?? str(line.to.widgetId) ?? '—'} ${str(line.to.side) ?? ''}`
: `${Array.isArray(line.points) ? line.points.length : 0} points`}` + (isObject(line.flow) ? ' · flow' : ''));
return {hood: text('add-scada-connectors', {count: rows.length, entity: dashboard}), blocks: rows.length ? [{type: 'list', rows}] : generic(result, 'result')};
}
case 'update_dashboard_widget':

Loading…
Cancel
Save