diff --git a/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java b/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java index d0c29ff1e0..64610ce271 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java +++ b/dao/src/main/java/org/thingsboard/server/dao/sql/query/DefaultAlarmQueryRepository.java @@ -46,6 +46,9 @@ public class DefaultAlarmQueryRepository implements AlarmQueryRepository { private static final Map alarmFieldColumnMap = new HashMap<>(); + private static final String SEVERITY_RANK = "case a." + ModelConstants.ALARM_SEVERITY_PROPERTY + + " when 'CRITICAL' then 0 when 'MAJOR' then 1 when 'MINOR' then 2 when 'WARNING' then 3 when 'INDETERMINATE' then 4 else 5 end"; + private static final Set ALARM_TABLE_SORT_COLUMNS = Set.of(ModelConstants.CREATED_TIME_PROPERTY, ModelConstants.ALARM_ACK_TS_PROPERTY, ModelConstants.ALARM_CLEAR_TS_PROPERTY, ModelConstants.ALARM_ASSIGN_TS_PROPERTY, ModelConstants.ALARM_END_TS_PROPERTY, ModelConstants.ALARM_START_TS_PROPERTY, ModelConstants.ALARM_ACKNOWLEDGED_PROPERTY, ModelConstants.ALARM_CLEARED_PROPERTY, @@ -211,7 +214,8 @@ public class DefaultAlarmQueryRepository implements AlarmQueryRepository { if ("status".equalsIgnoreCase(sortOrderKey)) { selectPart.append(", a.status as status "); } - sortPart.append(alarmFieldColumnMap.getOrDefault(sortOrderKey, sortOrderKey)) + String sortColumn = alarmFieldColumnMap.getOrDefault(sortOrderKey, sortOrderKey); + sortPart.append(ModelConstants.ALARM_SEVERITY_PROPERTY.equals(sortColumn) ? SEVERITY_RANK : sortColumn) .append(" ").append(sortOrder.getDirection().name()); if (ownerScoped) { sortPart.append(", a.created_time desc, a.id desc"); diff --git a/dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java b/dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java index e4b49b155b..d0c19ec12c 100644 --- a/dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java +++ b/dao/src/test/java/org/thingsboard/server/dao/service/AlarmServiceTest.java @@ -800,6 +800,42 @@ public class AlarmServiceTest extends AbstractServiceTest { Assert.assertTrue(firstPage.hasNext()); } + @Test + public void testSortAlarmDataBySeverityPriority() { + Device device = new Device(); + device.setName("TestSeverityDevice"); + device.setType("default"); + device.setTenantId(tenantId); + device = deviceService.saveDevice(device); + + long ts = System.currentTimeMillis(); + List ids = new ArrayList<>(); + for (AlarmSeverity severity : List.of(AlarmSeverity.INDETERMINATE, AlarmSeverity.CRITICAL, AlarmSeverity.WARNING, AlarmSeverity.MAJOR, AlarmSeverity.MINOR)) { + ids.add(alarmService.createAlarm(AlarmCreateOrUpdateActiveRequest.builder() + .tenantId(tenantId) + .originator(device.getId()) + .type("Severity " + severity) + .severity(severity) + .startTs(ts).build()).getAlarm().getId()); + } + List byPriority = List.of(ids.get(1), ids.get(3), ids.get(4), ids.get(2), ids.get(0)); + + AlarmDataPageLink pageLink = new AlarmDataPageLink(); + pageLink.setPage(0); + pageLink.setPageSize(10); + pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "severity"), EntityDataSortOrder.Direction.ASC)); + AlarmDataQuery ownerQuery = new AlarmDataQuery(null, pageLink, null, null, null, Collections.emptyList()); + + Assert.assertEquals(byPriority, alarmService.findAlarmDataByQuery(tenantId, null, mergedUserPermissions, ownerQuery) + .getData().stream().map(AlarmData::getId).toList()); + Assert.assertEquals(byPriority, alarmService.findAlarmDataByQueryForEntities(tenantId, mergedUserPermissions, toQuery(pageLink), List.of(device.getId())) + .getData().stream().map(AlarmData::getId).toList()); + + pageLink.setSortOrder(new EntityDataSortOrder(new EntityKey(EntityKeyType.ALARM_FIELD, "severity"), EntityDataSortOrder.Direction.DESC)); + Assert.assertEquals(byPriority.reversed(), alarmService.findAlarmDataByQuery(tenantId, null, mergedUserPermissions, ownerQuery) + .getData().stream().map(AlarmData::getId).toList()); + } + private AlarmDataQuery toQuery(AlarmDataPageLink pageLink) { return toQuery(pageLink, Collections.emptyList()); } diff --git a/ui-ngx/src/app/core/http/ai-chat.service.ts b/ui-ngx/src/app/core/http/ai-chat.service.ts index 645ab4a114..3a91763c7f 100644 --- a/ui-ngx/src/app/core/http/ai-chat.service.ts +++ b/ui-ngx/src/app/core/http/ai-chat.service.ts @@ -50,10 +50,6 @@ export class AiChatService { return this.http.get>(`/api/ai/chats/${chatId}/messages`, defaultHttpOptionsFromConfig(config)) } - public generateDashboard(deviceId: string, timeseriesKeys?: string[], config?: RequestConfig): Observable { - return this.http.post(`/api/ai/devices/${deviceId}/dashboard`, { timeseriesKeys }, defaultHttpOptionsFromConfig(config)); - } - public resolveToolApproval(result: ApprovalResult, config?: RequestConfig): Observable { return this.http.post('/api/ai/tools/resolve-approval', result, defaultHttpOptionsFromConfig(config)) } diff --git a/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts b/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts index e0d3028f40..32d2b7fb33 100644 --- a/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts +++ b/ui-ngx/src/app/core/services/ai-assistant-panel.service.ts @@ -215,6 +215,9 @@ export class AiAssistantPanelService implements OnDestroy { } toggle(): void { + if (this._suppressed() && !this._open()) { + return; + } this._restored.set(false); this._open.update(open => !open); } @@ -317,6 +320,37 @@ export class AiAssistantPanelService implements OnDestroy { } }); + private static readonly STARTED_KEY = 'tb-ai-panel-started'; + private static readonly STARTED_MAX = 20; + + private _startedByContext = signal>(AiAssistantPanelService.readStarted()); + + private static readStarted(): Record { + try { + const stored = JSON.parse(AiAssistantPanelService.readSession(AiAssistantPanelService.STARTED_KEY) ?? '{}'); + return stored && typeof stored === 'object' ? stored : {}; + } catch { + return {}; + } + } + + noteStartedHere(chatId: string): void { + const key = this.contextKey(); + if (!key) { + return; + } + this._startedByContext.update(started => { + const next = {...started, [key]: [chatId, ...(started[key] ?? []).filter(id => id !== chatId)].slice(0, AiAssistantPanelService.STARTED_MAX)}; + AiAssistantPanelService.writeSession(AiAssistantPanelService.STARTED_KEY, JSON.stringify(next)); + return next; + }); + } + + chatsStartedHere(): string[] { + const key = this.contextKey(); + return key ? this._startedByContext()[key] ?? [] : []; + } + setLastChatId(id: string | undefined): void { const key = this.contextKey(); if (!key) { @@ -341,10 +375,34 @@ export class AiAssistantPanelService implements OnDestroy { } openPanel(): void { + if (this._suppressed()) { + return; + } this._restored.set(false); this._open.set(true); } + private _composed = signal<{text: string; fresh: boolean} | null>(null); + readonly composed = this._composed.asReadonly(); + + compose(text: string): void { + if (this._suppressed()) { + return; + } + this._composed.set({text, fresh: !this._open()}); + this.openPanel(); + } + + composesFresh(): boolean { + return !!this._composed()?.fresh; + } + + takeComposed(): {text: string; fresh: boolean} | null { + const composed = this._composed(); + this._composed.set(null); + return composed; + } + setEnabled(enabled: boolean): void { this._enabled.set(enabled); if (enabled) { diff --git a/ui-ngx/src/app/modules/home/components/agent/_agent-shared.scss b/ui-ngx/src/app/modules/home/components/agent/_agent-shared.scss index c44b7923e8..3daf483b7f 100644 --- a/ui-ngx/src/app/modules/home/components/agent/_agent-shared.scss +++ b/ui-ngx/src/app/modules/home/components/agent/_agent-shared.scss @@ -93,10 +93,11 @@ $agent-type-generic-fg: #6a1b9a; display: flex; align-items: center; justify-content: space-between; + gap: 16px; padding: 4px 0; font-size: 13px; - .label { color: $agent-text-secondary; } - .value { color: $agent-text-primary; font-weight: 500; } + .label { flex: none; color: $agent-text-secondary; } + .value { min-width: 0; color: $agent-text-primary; font-weight: 500; text-align: right; overflow-wrap: anywhere; } } } diff --git a/ui-ngx/src/app/modules/home/components/agent/agent-deploy-status.component.scss b/ui-ngx/src/app/modules/home/components/agent/agent-deploy-status.component.scss index 231d0ac663..d4c26d1fe8 100644 --- a/ui-ngx/src/app/modules/home/components/agent/agent-deploy-status.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/agent-deploy-status.component.scss @@ -21,6 +21,12 @@ border: 1px solid $agent-divider-light; border-radius: 10px; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.03); + + @media #{$mat-lt-sm} { + flex-wrap: wrap; + gap: 12px 16px; + padding: 16px; + } } .tb-deploy-card-icon { @@ -33,11 +39,22 @@ justify-content: center; background: color-mix(in srgb, var(--tb-primary-500) 14%, transparent); + @media #{$mat-lt-sm} { + width: 44px; + height: 44px; + } + mat-icon { color: var(--tb-primary-600, var(--tb-primary-500)); font-size: 32px; width: 32px; height: 32px; + + @media #{$mat-lt-sm} { + font-size: 24px; + width: 24px; + height: 24px; + } } } @@ -58,6 +75,10 @@ font-size: 20px; font-weight: 600; color: $agent-text-primary; + + @media #{$mat-lt-sm} { + font-size: 17px; + } } .tb-deploy-card-desc { @@ -85,6 +106,13 @@ align-items: flex-end; gap: 6px; flex-shrink: 0; + + @media #{$mat-lt-sm} { + flex-direction: row; + flex-wrap: wrap; + align-items: center; + width: 100%; + } } .tb-deploy-pill { @@ -181,6 +209,10 @@ transition: border-color 0.15s, box-shadow 0.15s, transform 0.15s; text-align: left; + @media #{$mat-lt-sm} { + padding: 16px; + } + &:hover { border-color: color-mix(in srgb, var(--tb-primary-500) 40%, transparent); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05); diff --git a/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.scss b/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.scss index 891f4f85a5..426cfa045e 100644 --- a/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.scss @@ -8,7 +8,7 @@ tb-agent-compose-diff { .diff-viewer { position: relative; overflow: hidden; - height: clamp(220px, calc(85vh - 280px), 520px); + height: clamp(220px, calc(75vh - 240px), 520px); width: 100%; .acediff__wrap { @@ -32,7 +32,7 @@ tb-agent-compose-diff { .ace_editor { font-family: $agent-mono-font !important; } - .ace_gutter { width: 44px !important; background: #f5f5f5; color: rgba(0, 0, 0, 0.42); } + .ace_gutter { width: 44px !important; background: $agent-surface-soft; color: $agent-ink-42; } .ace_gutter-layer { width: 44px !important; } .acediff__right .ace_gutter { diff --git a/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.ts b/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.ts index 216ceb2e4e..c5495ca4a2 100644 --- a/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.ts +++ b/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.ts @@ -221,15 +221,20 @@ export class AgentComposeDiffComponent implements AfterViewInit, OnChanges, OnDe requestAnimationFrame(() => this.whenReady(cb, frames - 1)); } - private scheduleRebuild(): void { + private scheduleRebuild(frames = 60): void { if (this.rebuildHandle != null || this.destroyed) { return; } this.rebuildHandle = requestAnimationFrame(() => { this.rebuildHandle = null; - if (!this.destroyed) { - this.build(); + if (this.destroyed) { + return; } + if (this.differ && !this.ready && frames > 0) { + this.scheduleRebuild(frames - 1); + return; + } + this.build(); }); } diff --git a/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-editor.component.scss b/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-editor.component.scss index a4c87845ac..38a3946a9a 100644 --- a/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-editor.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/component/agent-compose-editor.component.scss @@ -8,7 +8,7 @@ tb-agent-compose-editor { .yaml-editor { width: 100%; box-sizing: border-box; padding: 12px 14px; border: 1px solid $agent-divider; border-radius: 4px; - background: $agent-surface-muted; color: #1f2328; + background: $agent-surface-muted; color: $agent-editor-fg; font-family: $agent-mono-font; font-size: 12px; line-height: 1.55; letter-spacing: 0; tab-size: 2; -moz-tab-size: 2; @@ -16,7 +16,7 @@ tb-agent-compose-editor { .yaml-editor-ace { padding: 0; - height: clamp(220px, calc(85vh - 280px), 520px); + height: clamp(220px, calc(75vh - 240px), 520px); overflow: hidden; overscroll-behavior: contain; .ace_editor { @@ -28,6 +28,6 @@ tb-agent-compose-editor { .ace_content { overscroll-behavior: contain; } - .ace_gutter { background: #f5f5f5; color: rgba(0, 0, 0, 0.42); } + .ace_gutter { background: $agent-surface-soft; color: $agent-ink-42; } } } diff --git a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.html b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.html index 88855e5893..99b0e1a1c5 100644 --- a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.html +++ b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.html @@ -4,18 +4,17 @@ SPDX-License-Identifier: BUSL-1.1 --> - -
-

{{ titleKey | translate }}

-
+ +

{{ titleKey | translate }}

+
-
- -
- +
+ @@ -98,16 +97,6 @@ }
- - @@ -146,16 +135,30 @@ edge.auto-provision-no-script
} - - - +
+ @if (selectedIndex === 0) { +
+ +
+ + } +
+ + @if (selectedIndex > 0) { + + } +
+
diff --git a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.scss b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.scss index c3f58c4989..ffe68e19c0 100644 --- a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.scss @@ -2,14 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 @use '../wizard/agent-wizard' as *; -@include wizard-chrome; - -:host { - display: block; - width: min(800px, 95vw); - min-width: 0; - max-width: 95vw; -} +@include wizard-stepper-dialog(800px); .select-form { display: block; diff --git a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.ts b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.ts index a833397836..395f72bb99 100644 --- a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.ts @@ -58,6 +58,7 @@ export class AgentAutoProvisionDialogComponent searchText = ''; loading = false; + selectedIndex = 0; @ViewChild('stepper', { static: false }) stepper: MatStepper; @ViewChild(MatAutocompleteTrigger) private autocompleteTrigger: MatAutocompleteTrigger; @@ -221,7 +222,7 @@ export class AgentAutoProvisionDialogComponent return this.dialog.open( AgentProfileAssignProfileDialogComponent, { disableClose: true, - panelClass: ['tb-dialog'], + panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'], data: { selectedIds, lockedAppType: this.appType } } ).afterClosed(); diff --git a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.service.ts b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.service.ts index 4283ec6f50..30ab9e23c9 100644 --- a/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.service.ts +++ b/ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.service.ts @@ -20,7 +20,7 @@ export class AgentAutoProvisionDialogService { return this.dialog.open( AgentAutoProvisionDialogComponent, { disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'], + panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'], data: { appType } } ).afterClosed(); diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/_agent-wizard.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/_agent-wizard.scss index b1a57cfd06..85e0b73a8a 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/_agent-wizard.scss +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/_agent-wizard.scss @@ -4,96 +4,76 @@ @forward '../agent-shared'; @use '../agent-shared' as *; -@mixin wizard-chrome { +@mixin wizard-dialog($width) { :host { - display: block; - width: min(1280px, 95vw); - min-width: 0; - max-width: 95vw; + height: 100%; + width: $width; + max-width: 100%; + display: grid; + grid-template-rows: min-content minmax(0, 1fr) min-content; + grid-template-columns: minmax(0, 1fr); } - .tb-install-wizard-toolbar { - display: flex; align-items: center; gap: 8px; - padding: 0 16px; - min-height: 56px; - .tb-install-wizard-toolbar-content { - flex: 1; min-width: 0; - display: flex; flex-direction: row; align-items: center; gap: 8px; - h2 { font-size: 20px; font-weight: 400; margin: 0; color: inherit; } - span { font-size: 20px; font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } + :host-context(.mat-mdc-dialog-container) { + @media #{$mat-gt-xs} { + max-height: calc(100vh - 32px); } - } - .tb-install-wizard-body.tb-install-wizard-embedded { - max-height: none !important; - overflow-y: visible !important; - padding: 8px 0 !important; - } + .mat-mdc-dialog-content { + overscroll-behavior: contain; - .tb-install-wizard-body { - // No vertical padding: the sticky stepper header sits flush at the top and the - // sticky footer flush at the bottom, with the content carrying its own spacing. - padding: 0 24px !important; - // Cap the dialog body to the viewport. Allow vertical scroll so tall step - // content (e.g. update/upgrade step 2 with config sections + summary card + - // info box + footer) can reach its buttons. The ace editors inside are - // clamped so they don't contribute unbounded height, and .acediff__wrap has - // its own overflow killed — so the only outer scrollbar that appears here - // is a legitimate chrome scroll when the step content genuinely overflows. - max-height: 85vh; - overflow-y: auto; - // Contain horizontal overscroll so two-finger trackpad swipes inside the - // ace editors / diff panes don't bubble up to the browser's back/forward - // page navigation. Also block vertical bounce from escaping the dialog. - overscroll-behavior: contain; + @media #{$mat-gt-xs} { + max-height: 75vh; + } + } } +} - :host ::ng-deep .mat-horizontal-stepper-wrapper { - margin-top: 0; - } +@mixin wizard-stepper-dialog($width) { + @include wizard-dialog($width); - :host ::ng-deep .mat-horizontal-stepper-header-container { - margin-top: 0; - // Keep the step indicators (1)…(N) pinned at the top while content scrolls. - position: sticky; - top: 0; - z-index: 5; - background: #fff; + :host { + .dialog-actions-row { + padding: 8px; + } } - :host ::ng-deep .mat-horizontal-stepper-header { - padding: 0 12px; - } + :host-context(.mat-mdc-dialog-container) { + .mat-mdc-dialog-content { + padding: 0; + scrollbar-gutter: stable; + } - :host ::ng-deep .mat-horizontal-content-container { - padding: 12px 0; - // Material defaults this to `overflow: hidden`, which makes it a scroll - // container and anchors the sticky `.step-footer` here (content height, so it - // never sticks). `clip` still clips the sliding steps but is NOT a scroll - // container, so the footer anchors to the scrolling `.tb-install-wizard-body`. - overflow: clip; - max-width: 100%; + .mat-mdc-dialog-actions { + padding: 0; + } } - :host-context(.tb-fullscreen-dialog .mat-mdc-dialog-container) { - max-width: 100%; + :host ::ng-deep { + .mat-horizontal-stepper-header-container { + position: sticky; + top: 0; + z-index: 5; + background: #fff; + } - .tb-install-wizard-body { - max-width: 100%; - overflow-x: hidden; + .mat-horizontal-content-container, + .mat-vertical-content { + padding-top: 4px; } - } - :host ::ng-deep .mat-step-header { - // Kill the hover/focus background — navigation works, but no visual fill. - &:hover, - &.cdk-program-focused, - &.cdk-mouse-focused, - &.cdk-focused { - background-color: transparent !important; + .mat-step-header { + &:hover, + &.cdk-program-focused, + &.cdk-mouse-focused, + &.cdk-focused { + background-color: transparent !important; + } } } +} +@mixin wizard-steps-locked { :host ::ng-deep .tb-steps-locked .mat-step-header[aria-selected="false"] { pointer-events: none; cursor: default; @@ -107,22 +87,6 @@ color: $agent-text-hint !important; } } - - .step-footer { - display: flex; align-items: center; justify-content: flex-end; gap: 8px; - padding: 12px 0; border-top: 1px solid $agent-divider-light; margin-top: 16px; - button mat-icon { font-size: 18px; width: 18px; height: 18px; } - } - - // Pin the footer to the bottom of the scrolling body so its action buttons stay - // visible while tall step content scrolls. Skipped in embedded mode, where the - // body doesn't scroll (the host dialog does) and a sticky footer would misbehave. - .tb-install-wizard-body:not(.tb-install-wizard-embedded) .step-footer { - position: sticky; - bottom: 0; - z-index: 15; - background: #fff; - } } @mixin wizard-step-basics { @@ -172,23 +136,20 @@ mat-icon { font-size: 36px; width: 36px; height: 36px; color: var(--tb-primary-500); margin-bottom: 8px; } h4 { font-size: 16px; font-weight: 500; margin: 0 0 4px; } p { font-size: 13px; color: $agent-text-secondary; margin: 0; } - } -} -@mixin wizard-yaml-editor { - // Defensive: also contain overscroll on the editor hosts themselves, so even - // if a swipe lands directly on an ace editor (not on the body), it won't be - // interpreted as page navigation. - .diff-viewer, - .yaml-editor-ace { - overscroll-behavior: contain; - ::ng-deep .ace_editor, - ::ng-deep .ace_scroller, - ::ng-deep .ace_content { - overscroll-behavior: contain; + @media #{$mat-lt-sm} { + display: grid; + grid-template-columns: 32px minmax(0, 1fr); + column-gap: 12px; + align-items: center; + padding: 12px 16px; + text-align: left; + mat-icon { grid-row: span 2; font-size: 32px; width: 32px; height: 32px; margin: 0; } } } +} +@mixin wizard-yaml-editor { .tb-compose-panel { box-shadow: none !important; border: 1px solid $agent-divider; @@ -198,33 +159,6 @@ } } - .yaml-editor { - width: 100%; box-sizing: border-box; padding: 12px 14px; - border: 1px solid $agent-divider; border-radius: 4px; - background: $agent-surface-muted; color: $agent-editor-fg; - font-family: $agent-mono-font; - font-size: 12px; line-height: 1.55; letter-spacing: 0; - tab-size: 2; -moz-tab-size: 2; - resize: vertical; - &:focus { - outline: none; border-color: var(--tb-primary-400); - box-shadow: 0 0 0 3px color-mix(in srgb, var(--tb-primary-400) 15%, transparent); - } - } - - // Ace-backed single editor (install mode and detail view) sits in the same - // .yaml-editor box but needs padding removed and a fixed height for ace layout. - .yaml-editor-ace { - padding: 0; - height: clamp(220px, calc(85vh - 280px), 520px); - overflow: hidden; - ::ng-deep .ace_editor { - font-family: $agent-mono-font !important; - background: transparent; - } - ::ng-deep .ace_gutter { background: $agent-surface-soft; color: $agent-ink-42; } - } - .pull-images { display: block; margin-top: 12px; } // Compact, content-width toggle (Material defaults the group to full width). @@ -283,6 +217,8 @@ .diff-header { flex: 1 1 50%; box-sizing: border-box; padding: 8px 12px; font-size: 12px; font-weight: 500; letter-spacing: 0.3px; + min-width: 0; overflow-wrap: anywhere; + @media #{$mat-lt-sm} { padding: 6px 8px; font-size: 11px; } & + .diff-header { border-left: 1px solid $agent-divider; padding-right: 36px; } &.added { background: $agent-success-surface; color: $agent-color-success-dark; } &.removed { background: #fce4ec; color: $agent-color-error-dark; } @@ -350,102 +286,6 @@ } } - .diff-viewer { - position: relative; - overflow: hidden; - // Fit within the wizard body (which no longer scrolls). Chrome above/below - // the editor (toolbar + stepper header + name field + footer + padding) is - // roughly 280px; the clamp floors at 220px so very short viewports still - // show a usable editor and cap at 520px on large displays. - height: clamp(220px, calc(85vh - 280px), 520px); - width: 100%; - - // ace-diff ships with `.acediff__wrap { overflow: auto }`. That creates an - // extra scrollbar wrapping the two editors + center gutter — the outer - // scrollbar the user sees. Force it hidden; each ace editor has its own - // internal scrollbar for the YAML content and that's the only one we want. - ::ng-deep .acediff__wrap { - overflow: hidden !important; - } - border: 1px solid $agent-divider; - border-bottom-left-radius: 4px; border-bottom-right-radius: 4px; - background: $agent-surface-muted; - - // ace-diff overrides: narrow center gutter, unified monospace styling, tight gutters. - // flex: 0 0 60px is ace-diff's default — must override flex-basis, not just width, - // otherwise the element stays 60px and its grey background leaks around the arrows. - ::ng-deep .acediff__gutter { - flex: 0 0 40px !important; - width: 40px !important; - background: #ffffff !important; - border-left: 1px solid $agent-divider-light !important; - border-right: 1px solid $agent-divider-light !important; - overflow: visible !important; - contain: layout paint style; - will-change: transform; - svg { width: 40px !important; background: transparent !important; } - } - ::ng-deep .ace_editor { - font-family: $agent-mono-font !important; - } - ::ng-deep .ace_gutter { width: 44px !important; background: $agent-surface-soft; color: $agent-ink-42; } - ::ng-deep .ace_gutter-layer { width: 44px !important; } - - // Flip the right pane's gutter to the right edge. Ace lays out .ace_gutter - // and .ace_scroller with absolute positioning (gutter: left 0; scroller: left - // ). Overriding both moves the line numbers against the outer - // edge of the right pane, mirroring the left pane — numbers end up hugging - // both outside edges, with code meeting in the middle at the copy arrows. - ::ng-deep .acediff__right .ace_gutter { - left: auto !important; - right: 0 !important; - border-left: 1px solid $agent-divider-light; - } - ::ng-deep .acediff__right .ace_scroller { - left: 0 !important; - right: 44px !important; - } - ::ng-deep .acediff__right .ace_scrollbar-v { - right: 44px !important; - } - - // Hide the LEFT pane's vertical scrollbar — it overlaps the center gutter and - // covers ace-diff's copy-arrow circles. ace-diff keeps both editors scroll- - // synced internally, and the right pane still shows its own scrollbar, so - // vertical scrolling remains available via mouse wheel / right-side thumb. - ::ng-deep .acediff__left .ace_scrollbar, - ::ng-deep .acediff__left .ace_scrollbar-v { - display: none !important; - width: 0 !important; - } - // Pull the left pane's scroller flush to its right edge so no blank strip - // remains where the scrollbar used to sit. - ::ng-deep .acediff__left .ace_scroller { - right: 0 !important; - } - // Raise the entire center gutter above the panes so nothing from either - // editor can occlude the copy-arrow SVGs. - ::ng-deep .acediff__gutter { - z-index: 10; - } - ::ng-deep .acediff__gutter svg, - ::ng-deep .acediff__copy { - z-index: 11; - position: relative; - } - // The connector SVG paints over the copy arrows and swallows clicks. - // Make the whole gutter SVG click-through so the copy arrow
s stay hit-testable. - ::ng-deep .acediff__gutter svg { pointer-events: none !important; } - ::ng-deep .acediff__copy, - ::ng-deep .acediff__copy--left, - ::ng-deep .acediff__copy--right, - ::ng-deep .acediff__copy--left div, - ::ng-deep .acediff__copy--right div { - pointer-events: auto !important; - z-index: 12 !important; - } - } - .diff-hint { font-size: 12px; color: $agent-text-secondary; margin: 6px 0 0; } diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.html b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.html index a99468da7f..de4faf9639 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.html +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.html @@ -5,28 +5,33 @@ --> @if (!embedded) { - + @if (showBack) { - } -
-

{{ 'agent.app-install-title' | translate }}@if (agent) {:}

- @if (agent) { - - {{ 'agent.app-install-on-agent' | translate: { name: agent?.name } }} - - } -
+

{{ 'agent.app-install-title' | translate }}@if (agent) {: {{ 'agent.app-install-on-agent' | translate: { name: agent?.name } }}}

+
-
} +@if (embedded) { + + +} @else { +
+ +
+
+ +
+} -
+ @if (checkingManaged) {
@@ -35,7 +40,7 @@ } @if (!checkingManaged && managedApp) { -
+
-
} @if (selectAgent && !embedded && !checkingManaged && !managedApp) { -
+
info_outline agent.deploy-via-agent-desc
@@ -62,302 +61,292 @@ @if (!checkingManaged && !managedApp) { - @if (selectAgent) { - -

agent.deploy-intro

- - - -
- } - @if (!lockedType) { - -

agent.app-install-pick-type

-
- @for (card of typeCards; track card.type) { - - } -
- @if (loadingTemplate) { -
- - agent.app-install-loading-template -
+ @for (step of steps; track step) { + @switch (step) { + @case ('agent') { + +

agent.deploy-intro

+ + +
} - @if (loadError) { -
- error_outline - {{ loadError }} -
+ @case ('type') { + +

agent.app-install-pick-type

+
+ @for (card of typeCards; track card.type) { + + } +
+ @if (loadingTemplate) { +
+ + agent.app-install-loading-template +
+ } + @if (loadError) { +
+ error_outline + {{ loadError }} +
+ } +
} - -
- } - -
- - {{ 'agent.app-install-from-profile' | translate }} - {{ 'agent.app-install-custom-config' | translate }} - -
- - agent.app-install-name - - - @if (canHaveRelatedEntity) { - - - } - @if (useProfile && typesWithoutTemplates.has(selectedType)) { -
- warning_amber - agent.app-no-templates -
- } - @if (useProfile) { - - agent.app-install-select-profile - - @if (profileSelectFormGroup.get('profile').value) { - - } - @if (!profileSelectFormGroup.get('profile').value && canCreateProfileForType) { - - } - - @if (filteredProfiles | async; as profiles) { - @for (p of profiles; track trackKey(p)) { - - {{ p.name }} - @if (isVirtualProfile(p)) { - {{ 'agent.app-install-virtual-profile-badge' | translate }} - } - @if (!isVirtualProfile(p) && p.templateVersion) { - {{ profileTemplateLabel(p) }} + @case ('config') { + +
+ + {{ 'agent.app-install-from-profile' | translate }} + {{ 'agent.app-install-custom-config' | translate }} + +
+ + agent.app-install-name + + + @if (canHaveRelatedEntity) { + + + } + @if (useProfile && typesWithoutTemplates.has(selectedType)) { +
+ warning_amber + agent.app-no-templates +
+ } + @if (useProfile) { + + agent.app-install-select-profile + + @if (profileSelectFormGroup.get('profile').value) { + + } + @if (!profileSelectFormGroup.get('profile').value && canCreateProfileForType) { + + } + + @if (filteredProfiles | async; as profiles) { + @for (p of profiles; track trackKey(p)) { + + {{ p.name }} + @if (isVirtualProfile(p)) { + {{ 'agent.app-install-virtual-profile-badge' | translate }} + } + @if (!isVirtualProfile(p) && p.templateVersion) { + {{ profileTemplateLabel(p) }} + } + + } + @if (!profiles.length) { + +
+ agent.app-install-no-profiles +
+
+ } } -
+
+
+ } + @if (loadingProfiles) { +
+ + agent.app-install-loading-template +
+ } + + @if (useProfile && selectedProfile && !isVirtualProfile(selectedProfile)) { +
+ +
+ } + @if (useProfile && selectedProfile) { + + + agent.app-install-yaml + + + + + + } + @if (mergeError) { +
+ error_outline + {{ mergeError }} +
+ } + @if (!useProfile && !template && loadError) { +
+ error_outline + {{ loadError }} +
+ } @else if (!useProfile) { + @if (composeTypeKeys.length > 1) { + + agent.app-compose-template-select + + @for (key of composeTypeKeys; track key) { + + {{ composeTypeLabel(key) }} + + } + + } - @if (!profiles.length) { - -
- agent.app-install-no-profiles -
-
+ @if (relatedEntityId) { +
+ info_outline + agent.app-compose-creds-overridden-hint +
} +
+
agent.app-install-diff-template
+
agent.app-install-diff-editable
+ +
+ +

agent.app-install-diff-hint

} - - - } - @if (loadingProfiles) { -
- - agent.app-install-loading-template -
- } - - @if (useProfile && selectedProfile && !isVirtualProfile(selectedProfile)) { -
- -
- } - @if (useProfile && selectedProfile) { - - - agent.app-install-yaml - - - - - - } - @if (mergeError) { -
- error_outline - {{ mergeError }} -
- } - @if (!useProfile && !template && loadError) { -
- error_outline - {{ loadError }} -
- } @else if (!useProfile) { - @if (composeTypeKeys.length > 1) { - - agent.app-compose-template-select - - @for (key of composeTypeKeys; track key) { - - {{ composeTypeLabel(key) }} - +
+ } + @case ('summary') { + +
+
+ agent.app-name + {{ appName }} +
+
+ agent.app-type + {{ selectedType }} +
+ @if (template) { +
+ agent.app-template + {{ template.appType }} {{ template.currentVersion }} +
} - - + @if (useProfile && selectedProfile) { +
+ agent.app-install-select-profile + {{ selectedProfile.name }} +
+ } + @if (agent) { +
+ agent.agents + {{ agent.name }} +
+ } +
+
+ info_outline + agent.app-install-confirm-info +
+
} - @if (relatedEntityId) { -
- info_outline - agent.app-compose-creds-overridden-hint -
+ @case ('deploy') { + + + + } -
-
agent.app-install-diff-template
-
agent.app-install-diff-editable
- -
- -

agent.app-install-diff-hint

} - - - -
-
- agent.app-name - {{ appName }} -
-
- agent.app-type - {{ selectedType }} -
- @if (template) { -
- agent.app-template - {{ template.appType }} {{ template.currentVersion }} -
- } - @if (useProfile && selectedProfile) { -
- agent.app-install-select-profile - {{ selectedProfile.name }} -
- } - @if (agent) { -
- agent.agents - {{ agent.name }} -
- } -
-
- info_outline - agent.app-install-confirm-info -
- -
- @if (selectAgent) { - - - - - }
} -
+ + + + @if (!checkingManaged && !managedApp && (canGoBack() || showNext())) { +
+ @if (canGoBack()) { + + } + + @if (showNext()) { + + } +
+ @if (!embedded || canInstall()) { + + } + } + @if (!embedded || canInstall()) { +
+ @if (!embedded) { + + } + @if (canInstall()) { + + } +
+ } +
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss index 1af432721a..95d4951c34 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss @@ -2,10 +2,18 @@ // SPDX-License-Identifier: BUSL-1.1 @use 'agent-wizard' as *; -@include wizard-chrome; +@include wizard-stepper-dialog(1280px); @include wizard-step-basics; @include wizard-type-cards; @include wizard-yaml-editor; @include wizard-diff; @include wizard-summary; @include agent-virtual-profile-badge; +@include wizard-steps-locked; + +:host(.tb-embedded) { + display: block; + width: auto; + height: auto; + max-height: none; +} diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts index 4e42694692..ece77cd194 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts @@ -38,22 +38,28 @@ import { buildVirtualAppProfiles, VIRTUAL_APP_TYPES } from '@home/pages/agent/util/virtual-app-profiles'; -import { - AgentAppProfileWizardComponent, - AgentAppProfileWizardData -} from '@home/pages/agent/wizard/agent-app-profile-wizard.component'; +import { openAgentAppProfileWizard } from '@home/pages/agent/wizard/agent-app-profile-wizard-dialog'; import { UserPermissionsService } from '@core/http/user-permissions.service'; import { Operation, Resource } from '@shared/models/security.models'; import { AgentAppWizardLoaderService } from '@home/pages/agent/wizard/agent-app-wizard-loader.service'; import { AgentAppWizardSubmitService } from '@home/pages/agent/wizard/agent-app-wizard-submit.service'; -import { AgentAppUpgradeResult, AgentAppWizardFinish, AgentTypeCard } from '@home/pages/agent/wizard/agent-app-wizard.models'; +import { + AGENT_APP_INSTALL_STEP_LABELS, + AgentAppInstallStepKey, + AgentAppUpgradeResult, + AgentAppWizardFinish, + AgentTypeCard +} from '@home/pages/agent/wizard/agent-app-wizard.models'; import { EdgeTemplateCompatibilityService } from '@home/pages/agent/util/edge-template-compatibility.service'; @Component({ selector: 'tb-agent-app-install-flow', templateUrl: './agent-app-install-flow.component.html', styleUrls: ['./agent-app-install-flow.component.scss'], - standalone: false + standalone: false, + host: { + '[class.tb-embedded]': 'embedded' + } }) export class AgentAppInstallFlowComponent extends PageComponent implements OnInit { @@ -82,6 +88,9 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni @ViewChild('stepper', { static: false }) stepper: MatStepper; + readonly stepLabels = AGENT_APP_INSTALL_STEP_LABELS; + steps: AgentAppInstallStepKey[] = []; + selectedIndex = 0; bindings: StepBinding[] = []; @@ -207,6 +216,7 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni } ngOnInit() { + this.steps = this.buildSteps(); this.relatedEntityId = this.lockedRelatedEntity || null; if (this.selectAgent && this.lockedRelatedEntity?.id && this.lockedRelatedEntity?.entityType) { this.checkingManaged = true; @@ -402,12 +412,7 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni const appType = this.selectedType || this.lockedType; if (!appType) { return; } const presetName = this.relatedEntityName ? `${this.relatedEntityName} profile` : undefined; - this.dialog.open( - AgentAppProfileWizardComponent, { - disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'], - data: { lockedAppType: appType, presetName } - }).afterClosed().subscribe(saved => { + openAgentAppProfileWizard(this.dialog, { lockedAppType: appType, presetName }).subscribe(saved => { if (saved) { this.availableProfiles = [ ...this.availableProfiles.filter(p => !(isVirtualAppProfile(p) && p.templateVersion === saved.templateVersion)), @@ -421,12 +426,7 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni openEditProfile() { if (!this.selectedProfile || isVirtualAppProfile(this.selectedProfile)) { return; } - this.dialog.open( - AgentAppProfileWizardComponent, { - disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'], - data: { profile: this.selectedProfile } - }).afterClosed().subscribe(saved => { + openAgentAppProfileWizard(this.dialog, { profile: this.selectedProfile }).subscribe(saved => { if (saved) { this.availableProfiles = this.availableProfiles.map(p => p.id?.id === saved.id?.id ? saved : p); this.cacheRealProfiles(saved.appType); @@ -731,4 +731,55 @@ export class AgentAppInstallFlowComponent extends PageComponent implements OnIni cancel() { this.cancelled.emit(null); } + + currentStep(): AgentAppInstallStepKey | undefined { + return this.steps[this.selectedIndex]; + } + + canGoBack(): boolean { + return this.selectedIndex > 0 && !this.installedApplication; + } + + canInstall(): boolean { + return !this.checkingManaged && !this.managedApp && !this.installedApplication; + } + + showNext(): boolean { + const hasNext = this.selectedIndex < this.steps.length - 1; + return hasNext && (this.currentStep() !== 'summary' || !!this.installedApplication); + } + + canGoNext(): boolean { + switch (this.currentStep()) { + case 'agent': + return this.canProceedFromAgent(); + case 'type': + return this.canProceedFromType(); + case 'config': + return this.canSubmit(); + case 'summary': + return !!this.installedApplication; + default: + return false; + } + } + + nextStepLabel(): string { + return this.stepLabels[this.steps[this.selectedIndex + 1]] ?? ''; + } + + private buildSteps(): AgentAppInstallStepKey[] { + const keys: AgentAppInstallStepKey[] = []; + if (this.selectAgent) { + keys.push('agent'); + } + if (!this.lockedType) { + keys.push('type'); + } + keys.push('config', 'summary'); + if (this.selectAgent) { + keys.push('deploy'); + } + return keys; + } } diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts new file mode 100644 index 0000000000..c4d6a400fd --- /dev/null +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts @@ -0,0 +1,22 @@ +// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. +// SPDX-License-Identifier: BUSL-1.1 +import { MatDialog } from '@angular/material/dialog'; +import { Observable } from 'rxjs'; +import { + AgentAppInstallWizardComponent, + AgentAppInstallWizardData, + AgentAppInstallWizardResult +} from '@home/components/agent/wizard/agent-app-install-wizard.component'; + +export function openAgentAppInstallWizard( + dialog: MatDialog, + data: AgentAppInstallWizardData +): Observable { + return dialog.open( + AgentAppInstallWizardComponent, { + disableClose: false, + panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'], + data + } + ).afterClosed(); +} diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss deleted file mode 100644 index d662554d66..0000000000 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss +++ /dev/null @@ -1,5 +0,0 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 -@use 'agent-wizard' as *; - -@include wizard-chrome; diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts index 6b74694329..2a95ed1705 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts @@ -47,7 +47,6 @@ export { isAgentAppUpgradeResult } from '@home/pages/agent/wizard/agent-app-wiza @Component({ selector: 'tb-agent-app-install-wizard', templateUrl: './agent-app-install-wizard.component.html', - styleUrls: ['./agent-app-install-wizard.component.scss'], standalone: false, providers: [AgentAppWizardLoaderService, AgentAppWizardSubmitService] }) diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html index 46c50b18b7..6f42c808d0 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html @@ -5,36 +5,28 @@ --> @if (!embedded) { - + @if (showBack) { - } -
-

{{ 'agent.app-update-wizard-title' | translate }}@if (existingApplication) { - : - }

- @if (existingApplication) { - - {{ 'agent.app-update-on-app' | translate: { name: existingApplication?.name } }} - - } -
+

{{ 'agent.app-update-wizard-title' | translate }}@if (existingApplication) {: {{ 'agent.app-update-on-app' | translate: { name: existingApplication?.name } }}}

+
-
} - -
+
- + agent.app-install-name @@ -124,13 +116,6 @@

agent.app-update-compare-hint

} - -
@@ -171,18 +156,33 @@ info_outline agent.app-install-confirm-info
- -
+
+
+ @if (selectedIndex > 0) { + + } + + @if (selectedIndex === 0) { + + } +
+ +
+ + +
+
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss index 29da806e40..a5d3ab398a 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 @use 'agent-wizard' as *; -@include wizard-chrome; +@include wizard-stepper-dialog(1280px); @include wizard-step-basics; @include wizard-config-section; @include wizard-diff; diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts index 83dc7275e8..481316fb06 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts @@ -23,10 +23,7 @@ import { buildStepInputs, createStepBinding, StepBinding } from '@home/pages/age import { buildUpdateApplication } from '@home/pages/agent/util/agent-app-payloads'; import { buildUpdateMergeDraft } from '@home/pages/agent/util/agent-app-compose-preview'; import { composeTemplateKeys, composeTypeLabelKey, dumpCompose, pickComposeType } from '@home/pages/agent/util/agent-compose-yaml'; -import { - AgentAppProfileWizardComponent, - AgentAppProfileWizardData -} from '@home/pages/agent/wizard/agent-app-profile-wizard.component'; +import { openAgentAppProfileWizard } from '@home/pages/agent/wizard/agent-app-profile-wizard-dialog'; import { AgentAppWizardLoaderService } from '@home/pages/agent/wizard/agent-app-wizard-loader.service'; import { AgentAppWizardSubmitService } from '@home/pages/agent/wizard/agent-app-wizard-submit.service'; import { AgentAppUpgradeResult, AgentAppWizardFinish } from '@home/pages/agent/wizard/agent-app-wizard.models'; @@ -52,6 +49,8 @@ export class AgentAppUpdateFlowComponent extends PageComponent implements OnInit @Output() cancelled = new EventEmitter(); @Output() back = new EventEmitter(); + selectedIndex = 0; + bindings: StepBinding[] = []; proposedYaml = ''; @@ -237,12 +236,7 @@ export class AgentAppUpdateFlowComponent extends PageComponent implements OnInit openEditProfile() { if (!this.profileForCompare) { return; } - this.dialog.open( - AgentAppProfileWizardComponent, { - disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'], - data: { profile: this.profileForCompare } - }).afterClosed().subscribe(saved => { + openAgentAppProfileWizard(this.dialog, { profile: this.profileForCompare }).subscribe(saved => { if (saved) { this.profileForCompare = saved; this.refreshFutureCompare(); diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html index aba02480fa..bf7cfeb2e2 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html @@ -5,30 +5,21 @@ --> @if (!embedded) { - + @if (showBack) { - } -
-

{{ 'agent.app-upgrade-title' | translate }}@if (existingApplication) { - : - }

- @if (existingApplication) { - - {{ 'agent.app-upgrade-heading' | translate: { name: existingApplication?.name, from: fromVersion || '—', to: toVersion || '—' } }} - - } -
+

{{ 'agent.app-upgrade-title' | translate }}@if (existingApplication) {: {{ 'agent.app-upgrade-heading' | translate: { name: existingApplication?.name, from: fromVersion || '—', to: toVersion || '—' } }}}

+
-
} - -
+
@if (loadingTemplate || loadingProfile) {
@@ -45,143 +36,154 @@ @if (!(loadingTemplate || loadingProfile || loadError)) { - @if (showProfileUpgradeStep) { - - @if (loadingProfile) { -
- - agent.app-upgrade-profile-loading -
+ @for (step of steps; track step) { + @switch (step) { + @case ('profile') { + + @if (loadingProfile) { +
+ + agent.app-upgrade-profile-loading +
+ } + @if (!loadingProfile && profileLoadError) { +
+ error_outline + {{ profileLoadError }} +
+ } + @if (!loadingProfile && !profileLoadError && profile && template) { +
+
+ agent.app-upgrade-profile-name + {{ profile.name }} +
+
+ agent.app-upgrade-summary-versions + {{ fromVersion || '—' }} → {{ toVersion || '—' }} +
+
+

agent.app-upgrade-profile-hint

+
+
+ {{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }} +
+
agent.app-upgrade-profile-current
+ @if (profileUpgraded) { +
+ lock + agent.app-diff-read-only +
+ } + +
+ +

agent.app-upgrade-diff-hint

+ } +
} - @if (!loadingProfile && profileLoadError) { -
- error_outline - {{ profileLoadError }} -
+ @case ('config') { + + @if (canHaveRelatedEntity && isProfileBoundUpgrade) { + + + } + + @if (!isProfileBoundUpgrade) { +
+
+ {{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }} +
+
agent.app-upgrade-current
+ +
+ +

agent.app-upgrade-diff-hint

+ } +
} - @if (!loadingProfile && !profileLoadError && profile && template) { -
-
- agent.app-upgrade-profile-name - {{ profile.name }} -
-
- agent.app-upgrade-summary-versions - {{ fromVersion || '—' }} → {{ toVersion || '—' }} + @case ('summary') { + +
+
+ agent.app-name + {{ appName }} +
+
+ agent.app-upgrade-summary-versions + {{ fromVersion || '—' }} → {{ toVersion || '—' }} +
+ @if (hasBackupVolumeInput) { +
+ agent.app-upgrade-summary-volumes-label + + {{ 'agent.app-upgrade-summary-volumes' | translate: { count: selectedBackupVolumeCount } }} + +
+ }
-
-

agent.app-upgrade-profile-hint

-
-
- {{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }} +
+ info_outline + agent.app-upgrade-rollback-info
-
agent.app-upgrade-profile-current
- @if (profileUpgraded) { -
- lock - agent.app-diff-read-only -
- } - -
- -

agent.app-upgrade-diff-hint

+ } - - - } - - @if (canHaveRelatedEntity && isProfileBoundUpgrade) { - - - } - - @if (!isProfileBoundUpgrade) { -
-
- {{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }} -
-
agent.app-upgrade-current
- -
- -

agent.app-upgrade-diff-hint

} - -
- -
-
- agent.app-name - {{ appName }} -
-
- agent.app-upgrade-summary-versions - {{ fromVersion || '—' }} → {{ toVersion || '—' }} -
- @if (hasBackupVolumeInput) { -
- agent.app-upgrade-summary-volumes-label - - {{ 'agent.app-upgrade-summary-volumes' | translate: { count: selectedBackupVolumeCount } }} - -
- } -
-
- info_outline - agent.app-upgrade-rollback-info -
- -
+ } }
+
+ @if (canGoBack() || showNext()) { +
+ @if (canGoBack()) { + + } + + @if (showNext()) { + + } +
+ + } +
+ + @if (currentStep() === 'profile' && !profileUpgraded) { + + } @else { + + } +
+
diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.scss b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.scss index fcbe6cb001..d3ab782e2b 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.scss +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.scss @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 @use 'agent-wizard' as *; -@include wizard-chrome; +@include wizard-stepper-dialog(1280px); @include wizard-step-basics; @include wizard-diff; @include wizard-summary; diff --git a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.ts b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.ts index 12a0e21ae7..133567985a 100644 --- a/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.ts +++ b/ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.ts @@ -29,7 +29,12 @@ import { ActionNotificationShow } from '@core/notification/notification.actions' import * as YAML from 'yaml'; import { AgentAppWizardLoaderService } from '@home/pages/agent/wizard/agent-app-wizard-loader.service'; import { AgentAppWizardSubmitService } from '@home/pages/agent/wizard/agent-app-wizard-submit.service'; -import { AgentAppUpgradeResult, AgentAppWizardFinish } from '@home/pages/agent/wizard/agent-app-wizard.models'; +import { + AGENT_APP_UPGRADE_STEP_LABELS, + AgentAppUpgradeResult, + AgentAppUpgradeStepKey, + AgentAppWizardFinish +} from '@home/pages/agent/wizard/agent-app-wizard.models'; @Component({ selector: 'tb-agent-app-upgrade-flow', @@ -65,10 +70,11 @@ export class AgentAppUpgradeFlowComponent extends PageComponent implements OnIni profileLoadError = ''; profileUpgrading = false; profileUpgraded = false; - showProfileUpgradeStep = false; - @ViewChild('stepper', { static: false }) stepper: MatStepper; + readonly stepLabels = AGENT_APP_UPGRADE_STEP_LABELS; + steps: AgentAppUpgradeStepKey[] = ['config', 'summary']; + selectedIndex = 0; bindings: StepBinding[] = []; @@ -210,7 +216,7 @@ export class AgentAppUpgradeFlowComponent extends PageComponent implements OnIni private maybeInitProfileDiff() { if (!this.needsProfileUpgrade || !this.template || !this.profile || this.profileMergeRequested) { return; } this.profileMergeRequested = true; - this.showProfileUpgradeStep = true; + this.steps = ['profile', 'config', 'summary']; const profileComposeType = dockerComposeConfig(this.profile)?.composeType || undefined; this.profileProposedYaml = dumpRawTemplateCompose(this.template, profileComposeType); const draft = { ...this.profile, templateVersion: this.template.currentVersion } as AgentAppProfile; @@ -354,4 +360,25 @@ export class AgentAppUpgradeFlowComponent extends PageComponent implements OnIni // the caller refresh even when the user backs out before the app upgrade. this.cancelled.emit(this.profileUpgraded ? { profileOnly: true } : null); } + + currentStep(): AgentAppUpgradeStepKey | undefined { + return this.loadingTemplate || this.loadingProfile || this.loadError ? undefined : this.steps[this.selectedIndex]; + } + + canGoBack(): boolean { + return this.selectedIndex > 0 && this.steps[this.selectedIndex - 1] !== 'profile'; + } + + showNext(): boolean { + const step = this.currentStep(); + return step === 'config' || (step === 'profile' && this.profileUpgraded); + } + + canGoNext(): boolean { + return this.currentStep() === 'profile' ? this.profileUpgraded : this.canSubmit(); + } + + nextStepLabel(): string { + return this.stepLabels[this.steps[this.selectedIndex + 1]] ?? ''; + } } diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html index 939c25ddff..d4eb2310ea 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-action-detail.component.html @@ -142,7 +142,7 @@ } } @if (plainRows(block.rows).length) { -
+
@for (fact of plainRows(block.rows); track $index) {
{{ label(fact) }}
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 0757247883..0180665132 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 @@ -127,7 +127,7 @@ export interface AiStepView { const ASKED_FOR: Record = { 'search-named': 'named', 'search-typed': 'typed', 'search-text': 'text', 'search-related-from': 'related-from', - 'search-related-to': 'related-to', 'search-alarms-of': 'alarms-of', 'read-attributes-scope': 'attributes-scope', + 'search-related-to': 'related-to', 'read-attributes-scope': 'attributes-scope', 'search-alarms': 'alarms', 'search-alarms-on': 'alarms-on', 'search-alarms-filter-on': 'alarms-filter-on', 'search-alarms-window': 'alarms-window', 'search-alarms-filter-window': 'alarms-filter-window', 'search-alarms-on-window': 'alarms-on-window', 'search-alarms-filter-on-window': 'alarms-filter-on-window', 'read-history': 'history', 'read-history-keys': 'history-keys', 'read-latest-keys': 'latest-keys', 'iot-hub-query': 'query', @@ -1295,6 +1295,10 @@ function describe(tool: string, values: Values, result: unknown, names: AiDetail }; case 'create_dashboard': return {hood: text('create-dashboard', {name: str(values.title) ?? '—'}), blocks: []}; + case 'generate_device_dashboard': { + const keys = Array.isArray(values.keys) ? values.keys.map(String) : []; + return {hood: text('generate-device-dashboard', {entity: of(values.deviceId, 'DEVICE')}), blocks: keys.length ? [{type: 'keys', keys}] : []}; + } case 'update_dashboard': return {hood: text('update-dashboard', {entity: dashboard}), blocks: changes(values, ['dashboardId'], names)}; case 'read_dashboard_overview': @@ -2360,6 +2364,9 @@ function namesOf(message: {from: string; data?: any; references?: Array<{id: str case 'create_dashboard': put(created, values.title, 'DASHBOARD'); break; + case 'generate_device_dashboard': + put(created, undefined, 'DASHBOARD'); + break; case 'save_device': put(created ?? savedObject(values).id, savedObject(values).name, 'DEVICE'); break; 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 d2afdc3ec3..06f4f75667 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 @@ -40,6 +40,7 @@ const TOOL_WORDS: Record = { test_converter: 'test-converter', read_converter_library: 'read-converter-library', create_dashboard: 'create-dashboard', + generate_device_dashboard: 'generate-device-dashboard', update_dashboard: 'update-dashboard', add_dashboard_state: 'add-dashboard-state', update_dashboard_state: 'update-dashboard-state', diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts index 5906317f70..b8d19aa09f 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-approval-card.component.ts @@ -55,6 +55,8 @@ const MAX_FIELDS = 5; const DETAIL_TOKENS = new Set(['server-attributes', 'shared-attributes']); +const ATTRIBUTE_TOOLS = new Set(['save_attributes', 'delete_attributes']); + const VALUE_TOKENS: Record = { undo: ['none'], defaultDashboard: ['none'], @@ -72,7 +74,7 @@ const CODE_FIELDS = new Set(['arguments', 'expression', 'output']); const HEAD_VERBS = new Set(['create', 'update', 'delete', 'install', 'acknowledge', 'clear', 'assign', 'unassign']); const REVIEW_VERBS = new Set(['install', 'restart', 'update', 'upgrade', 'upgrade-agent', 'delete', 'cancel', 'sync', 'acknowledge', 'clear', 'assign', 'unassign']); -const IMAGE_FIELDS = new Set(['widget-image', 'scada-symbol']); +const IMAGE_FIELDS = new Set(['widget-image', 'scada-symbol', 'dashboard-image']); const BLOCK_FIELDS = new Set(['script']); @@ -195,6 +197,11 @@ function aiChangeHead(translate: TranslateService, data: ToolExecutionRequested) if (!HEAD_VERBS.has(verb)) { return translate.instant(label); } + if (DETAIL_TOKENS.has(review.detail) || ATTRIBUTE_TOOLS.has(data.tool)) { + const kind = DETAIL_TOKENS.has(review.detail) ? translate.instant('ai-assistant.review.detail.' + review.detail) + : translate.instant('ai-assistant.review.kind.attributes'); + return translate.instant('ai-assistant.review.head-change.' + verb, {kind}); + } const type = review.detail === 'alarm-rule' ? 'ALARM_RULE' : review.entityType; const key = 'ai-assistant.review.kind.' + type; const phrase = translate.instant(key); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-artifact-pane.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-artifact-pane.component.html index fff54110b0..11489f55ee 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-artifact-pane.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-artifact-pane.component.html @@ -6,7 +6,7 @@ -->
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html index 18465f5a25..210cdbde74 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.html @@ -93,7 +93,7 @@ } @else if (msg.from === 'ACTION' && plans[$index]; as plan) {
+ (run)="runPlan.emit({run: $event, steps: plan.steps})" (changeRequested)="changePlan.emit()">
} @else if (msg.from === 'ACTION' && handOvers[$index]; as card) {
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.scss b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.scss index 8680d28d7f..5583c127d2 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.scss +++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.scss @@ -561,6 +561,10 @@ padding: 0; background: none; box-shadow: none; + font-weight: 400; + } + + td:first-child code.k-ent { font-weight: 500; } diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.ts index 6b77a240c7..9540bfc852 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat-messages.component.ts @@ -508,6 +508,8 @@ export class AiChatMessagesComponent implements OnChanges, OnDestroy { this.runningLead = running.length ? running[0] : -1; this.runningCount = running.length; this.findReadGroups(); + const last = this.messages[this.messages.length - 1]; + this.waitApproval = last?.from === 'APPROVAL' && !this.autoApprove && !this.isAnswered(last as ApprovalChatMessage); if (changes.messages.firstChange) { if (this.initialScroll === 'bottom') { this.pinToBottom(); @@ -521,10 +523,6 @@ export class AiChatMessagesComponent implements OnChanges, OnDestroy { const prevLastMsg = prevMsgs?.[prevMsgs.length - 1]; const msgs = changes.messages.currentValue as ChatMessage[]; const lastMsg = msgs[msgs.length - 1]; - // In auto-approve we are not blocked on the user, so the assistant keeps working: the - // thinking indicator stays visible (waitApproval false), and the view follows the stream of - // auto-generated cards only while the reader is near the bottom. - this.waitApproval = lastMsg?.from === 'APPROVAL' && !this.autoApprove && !this.isAnswered(lastMsg as ApprovalChatMessage); if (this.autoApprove) { if (wasNearBottom) { setTimeout(() => this.scrollToBottom('auto'), 0); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat-title.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-chat-title.component.html index 01d3972043..35bd1082fd 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-chat-title.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat-title.component.html @@ -24,10 +24,7 @@ } @else { @if (renamable()) { + } - + @if (fullscreen() || !headNarrow()) { + + } @if (!fullscreen()) { - } @if (docked() && (split() || splitAvailable())) { @@ -415,9 +419,23 @@ {{ (split() ? 'ai-assistant.back-to-panel' : 'ai-assistant.split-view') | translate }} } - @if (recentChats().length) { -
{{ 'ai-assistant.recent-chats' | translate }}
- @for (other of recentChats(); track other.id) { + @if (chat()) { + + + + } + @for (group of otherChats(); track group.label) { +
{{ group.label | translate }}
+ @for (other of group.chats; track other.id) { - @if (chat()) { - - } diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.scss b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.scss index 72fd4f050f..928d69fb9d 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.scss +++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.scss @@ -23,6 +23,7 @@ .ai-chat-head { position: relative; + container: k-head / inline-size; flex: none; display: flex; align-items: center; diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts index 2ef5fab1d3..64371d66ff 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-chat.component.ts @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 +import { AI_TOOLTIP_PROVIDERS } from '@home/components/ai/ai-tooltip'; import { aiCreditsLimitOf, AiCreditsLimitType } from '@home/components/ai/ai-credits.models'; import { aiClientOs, aiPageView, isAiTitledView } from '@shared/models/ai-chat.models'; import { getDefaultTimezone } from '@shared/models/time/time.models'; @@ -46,6 +47,7 @@ import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { environment as env } from '@env/environment'; import { ActionNotificationShow } from '@core/notification/notification.actions'; import { isNotEmptyStr, parseHttpErrorMessage } from '@core/utils'; +import { aiChatNameOf } from '@home/components/ai/ai-text'; import { ActionChatMessage, AiStartedFrom, ApprovalChatMessage, ChatMessage, GeneralChatMessage } from '@shared/models/solution-creator.models'; import { AiAssistantPromptExample, @@ -110,14 +112,19 @@ interface AiRefusal { '[class.split]': 'split() && docked()', '[class.v-page]': '!docked()', '[class.v-panel]': 'docked()' - } + }, + providers: AI_TOOLTIP_PROVIDERS }) export class AiChatComponent implements OnInit, OnDestroy { private static readonly RESUME_ATTEMPTS = 4; private static readonly RESUME_DELAY_MS = 2000; private static readonly NOTICE_MS = 6000; - private static readonly RECENT_CHATS = 5; + private static readonly MENU_CHATS = 4; + + private static readonly NEW_CHAT_TITLE = 'New chat'; + + private static readonly NARROW_HEAD = 500; @ViewChild(AiPromptInputComponent) promptInput: AiPromptInputComponent; @ViewChild(AiChatTitleComponent) titleRef: AiChatTitleComponent; @@ -167,10 +174,29 @@ export class AiChatComponent implements OnInit, OnDestroy { {key: 'datasheet', icon: 'attach_file', file: true} ]; - recentChats = computed(() => this.chats.chats() - .filter(chat => chat.id !== this.chatId()) - .sort((a, b) => b.createdTime - a.createdTime) - .slice(0, AiChatComponent.RECENT_CHATS)); + otherChats = computed<{label: string; chats: ChatInfo[]}[]>(() => { + const others = this.chats.chats() + .filter(chat => chat.id !== this.chatId()) + .sort((a, b) => (b.updatedTime ?? b.createdTime) - (a.updatedTime ?? a.createdTime)); + const startedHere = new Set(this.panelService.chatsStartedHere()); + const here = others.filter(chat => startedHere.has(chat.id)).slice(0, AiChatComponent.MENU_CHATS - 1); + const recent = others.filter(chat => !startedHere.has(chat.id)).slice(0, Math.max(1, AiChatComponent.MENU_CHATS - here.length)); + return [ + ...(here.length ? [{label: 'ai-assistant.on-this-page', chats: here}] : []), + ...(recent.length ? [{label: 'ai-assistant.recent-chats', chats: recent}] : []) + ]; + }); + + headNarrow = signal(false); + + shownTitle = computed(() => { + const title = this.chat()?.title; + if (title && title !== AiChatComponent.NEW_CHAT_TITLE) { + return title; + } + const first = this.messages().find(message => message.from === 'USER') as GeneralChatMessage | undefined; + return typeof first?.content === 'string' && first.content.trim() ? aiChatNameOf(first.content) : title; + }); fullscreen = signal(false); @@ -549,6 +575,14 @@ export class AiChatComponent implements OnInit, OnDestroy { }); ngOnInit(): void { + if (typeof ResizeObserver !== 'undefined') { + const head = new ResizeObserver(() => { + const width = this.hostElement.querySelector('.ai-chat-head')?.clientWidth ?? 0; + this.headNarrow.set(width > 0 && width < AiChatComponent.NARROW_HEAD); + }); + head.observe(this.hostElement); + this.destroyRef.onDestroy(() => head.disconnect()); + } this.loadChat$.pipe( switchMap(id => this.aiChat.getChatMessages(id, {ignoreLoading: true, ignoreErrors: true}).pipe( catchError(err => { @@ -1054,8 +1088,11 @@ export class AiChatComponent implements OnInit, OnDestroy { this.messageCancelled = false; const startOrContinue$ = this.chatId() ? of(null) - : this.chats.create('New chat', this.newChatAutoApprove()).pipe( + : this.chats.create(AiChatComponent.NEW_CHAT_TITLE, this.newChatAutoApprove()).pipe( tap(chat => { + if (this.variant() === 'panel') { + this.panelService.noteStartedHere(chat.id); + } this.freshChatId = chat.id; this.shownChatId = chat.id; this.chatId.set(chat.id); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html index 4e9c9baef8..26b3ad0bd7 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.html @@ -7,12 +7,12 @@
@for (option of question().options; track option.label) { } - diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts index d38ab5bd0d..27c16f7082 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-color-field.component.ts @@ -22,7 +22,6 @@ export class AiColorFieldComponent { question = input.required(); value = model(''); - disabled = input(false); enter = output(); private elementRef: ElementRef = inject(ElementRef); @@ -40,9 +39,6 @@ export class AiColorFieldComponent { } openHex(): void { - if (this.disabled()) { - return; - } if (!this.other()) { this.value.set('#'); } @@ -76,9 +72,6 @@ export class AiColorFieldComponent { } openPicker(picker: HTMLInputElement, field: HTMLInputElement): void { - if (this.disabled()) { - return; - } picker.value = aiHexOf(field.value) ?? '#000000'; try { picker.showPicker(); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-core.module.ts b/ui-ngx/src/app/modules/home/components/ai/ai-core.module.ts index aba2c626b3..e1915d1162 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-core.module.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-core.module.ts @@ -10,8 +10,8 @@ import { AiTipDirective } from '@home/components/ai/ai-tip.directive'; import { AiFadeInImageDirective } from '@home/components/ai/ai-fade-in-image.directive'; import { AiSpinComponent } from '@home/components/ai/ai-spin.component'; import { AiSevMarkComponent } from '@home/components/ai/ai-sev-mark.component'; -import { AiLoadingModalComponent } from '@home/components/ai/ai-loading-modal.component'; import { AiNoTelemetryModalComponent } from '@home/components/ai/ai-no-telemetry-modal.component'; +import { AiTipIfCutDirective, AiTooltipChainDirective } from '@home/components/ai/ai-tooltip'; @NgModule({ declarations: [ @@ -22,12 +22,13 @@ import { AiNoTelemetryModalComponent } from '@home/components/ai/ai-no-telemetry AiFadeInImageDirective, AiSpinComponent, AiSevMarkComponent, - AiLoadingModalComponent, AiNoTelemetryModalComponent ], imports: [ CommonModule, - SharedModule + SharedModule, + AiTooltipChainDirective, + AiTipIfCutDirective ], exports: [ AiAssistantButtonComponent, @@ -37,8 +38,9 @@ import { AiNoTelemetryModalComponent } from '@home/components/ai/ai-no-telemetry AiFadeInImageDirective, AiSpinComponent, AiSevMarkComponent, - AiLoadingModalComponent, - AiNoTelemetryModalComponent + AiNoTelemetryModalComponent, + AiTooltipChainDirective, + AiTipIfCutDirective ] }) export class AiCoreModule {} diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss b/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss index 7fb233ca15..3c772e1f21 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss +++ b/ui-ngx/src/app/modules/home/components/ai/ai-credits.component.scss @@ -1,12 +1,25 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 +:host { + display: inline-flex; + min-width: 0; +} + .cred { display: inline-flex; align-items: center; gap: 8px; + min-width: 0; + + > :not(.cred-line) { + flex-shrink: 0; + } } .cred-line { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; font: 400 var(--chat-meta)/var(--chat-meta-lh) var(--tb-font); color: var(--tb-ink-76); white-space: nowrap; diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-dashboard-generation.service.ts b/ui-ngx/src/app/modules/home/components/ai/ai-dashboard-generation.service.ts index d86504ea90..96eb0771b6 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-dashboard-generation.service.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-dashboard-generation.service.ts @@ -1,11 +1,9 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 -import { DestroyRef, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { createDefaultEntityDataPageLink, singleEntityFilterFromDeviceId } from '@shared/models/query/query.models'; -import { AiLoadingModalComponent, AiLoadingModalData } from '@home/components/ai/ai-loading-modal.component'; -import { dashboardGenerateImage, generateDashboardSteps } from '@home/components/ai/ai.models'; -import { finalize } from 'rxjs/operators'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; +import { map } from 'rxjs/operators'; +import { forkJoin, of } from 'rxjs'; import { AiNoTelemetryModalComponent, AiNoTelemetryModalData @@ -13,21 +11,20 @@ import { import { Operation } from '@shared/models/security.models'; import { EntityType } from '@shared/models/entity-type.models'; import { EntityService } from '@core/http/entity.service'; +import { DeviceService } from '@core/http/device.service'; +import { AiAssistantPanelService } from '@core/services/ai-assistant-panel.service'; import { MatDialog } from '@angular/material/dialog'; -import { AiChatService } from '@core/http/ai-chat.service'; -import { Router } from '@angular/router'; import { TranslateService } from '@ngx-translate/core'; -import { DomSanitizer } from '@angular/platform-browser'; -import { Store } from '@ngrx/store'; -import { AppState } from '@core/core.state'; import { UserPermissionsService } from '@core/http/user-permissions.service'; import { EntityGroupInfo } from '@shared/models/entity-group.models'; interface GenerateDashboardOptions { deviceId: string; - destroyRef?: DestroyRef; - noTelemetry: AiNoTelemetryModalData; - beforeOpen?: () => void; + deviceName?: string; + keys?: string[]; + checkTelemetry?: boolean; + noTelemetry?: AiNoTelemetryModalData; + beforeCompose?: () => void; } interface AllowDashboardGenerateOptions { @@ -41,47 +38,29 @@ interface AllowDashboardGenerateOptions { export class AiDashboardGenerationService { constructor(private entityService: EntityService, + private deviceService: DeviceService, private dialog: MatDialog, - private aiChatService: AiChatService, - private router: Router, + private panelService: AiAssistantPanelService, private translate: TranslateService, - private sanitizer: DomSanitizer, - private store: Store, private userPermissionsService: UserPermissionsService) { } - generateWithTelemetryCheck(opts: GenerateDashboardOptions): void { - this.entityService.findEntityKeysByQueryV2({ + askInChat(opts: GenerateDashboardOptions): void { + const telemetry$ = opts.checkTelemetry === false ? of(true) : this.entityService.findEntityKeysByQueryV2({ entityFilter: singleEntityFilterFromDeviceId(opts.deviceId), pageLink: createDefaultEntityDataPageLink(1), - }, true, false).subscribe((res) => { - opts.beforeOpen?.(); - if (res.timeseries.length) { - this.generate(opts.deviceId, opts.destroyRef); - } else { - this.openNoTelemetryModal(opts.noTelemetry); + }, true, false).pipe(map(res => res.timeseries.length > 0)); + const name$ = opts.deviceName ? of(opts.deviceName) : this.deviceService.getDevice(opts.deviceId, {ignoreLoading: true}).pipe(map(device => device.name)); + forkJoin([telemetry$, name$]).subscribe(([hasTelemetry, name]) => { + if (!hasTelemetry) { + this.openNoTelemetryModal(opts.noTelemetry ?? {}); + return; } - }); - } - - generate(deviceId: string, destroyRef?: DestroyRef, timeseriesKeys: string[] = []): void { - const dialogRef = this.dialog.open(AiLoadingModalComponent, { - disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], - data: { - messages: generateDashboardSteps, - estimateWaitTime: 60000, - image: dashboardGenerateImage - } as AiLoadingModalData - }); - let request$ = this.aiChatService.generateDashboard(deviceId, timeseriesKeys).pipe( - finalize(() => dialogRef.close()) - ); - if (destroyRef) { - request$ = request$.pipe(takeUntilDestroyed(destroyRef)); - } - request$.subscribe({ - next: (response) => this.router.navigate(['/dashboards', response]) + opts.beforeCompose?.(); + const keys = (opts.keys ?? []).filter(Boolean); + this.panelService.compose(keys.length + ? this.translate.instant('ai-assistant.ask.device-dashboard-keys', {name, keys: keys.join(', ')}) + : this.translate.instant('ai-assistant.ask.device-dashboard', {name})); }); } diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.html deleted file mode 100644 index 59a00e96d0..0000000000 --- a/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.html +++ /dev/null @@ -1,15 +0,0 @@ - -
-
- Loading -
- {{ statusMessage | translate }} - {{ 'solution-creator.estimate-wait-time' | translate: {time: (data.estimateWaitTime | milliSecondsToTimeString:true : true)} }} -
-
-
diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.scss b/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.scss deleted file mode 100644 index b0786e00db..0000000000 --- a/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.scss +++ /dev/null @@ -1,34 +0,0 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 -.tb-generated { - z-index: 3; - .panel { - box-shadow: 0 6px 12px 0 rgba(0, 0, 0, 0.04), 0 12px 32px 0 rgba(0, 0, 0, 0.08); - background-color: #fff; - width: 500px; - } - img { - width: 200px; - } - .info { - white-space: pre-line; - text-align: center; - line-height: 1.5; - letter-spacing: 0.15px; - } - - .msg.text-changed { - animation: fadeInSlideUp 0.5s ease-out forwards; - } - - @keyframes fadeInSlideUp { - 0% { - opacity: 0; - transform: translateY(15px); - } - 100% { - opacity: 1; - transform: translateY(0); - } - } -} diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.ts deleted file mode 100644 index 3ab1c957eb..0000000000 --- a/ui-ngx/src/app/modules/home/components/ai/ai-loading-modal.component.ts +++ /dev/null @@ -1,61 +0,0 @@ -// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. -// SPDX-License-Identifier: BUSL-1.1 -import { Component, DestroyRef, Inject, OnInit, ViewEncapsulation } from '@angular/core'; -import { DialogComponent } from '@shared/components/dialog.component'; -import { Store } from '@ngrx/store'; -import { AppState } from '@core/core.state'; -import { Router } from '@angular/router'; -import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material/dialog'; -import { from, of } from 'rxjs'; -import { concatMap, delay } from 'rxjs/operators'; -import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; -import { generatedStateImages } from '@home/components/ai/ai.models'; - -export interface AiLoadingModalData { - messages: Array<{text: string; delay: number}>; - estimateWaitTime: number; - image?: string; -} - -@Component({ - selector: 'tb-ai-loading-modal', - templateUrl: './ai-loading-modal.component.html', - styleUrl: './ai-loading-modal.component.scss', - encapsulation: ViewEncapsulation.None, - standalone: false, - host: { - style: 'width: 100%; height: 100%; min-height: 100%; display: flex; overflow: hidden;' - } -}) -export class AiLoadingModalComponent extends DialogComponent implements OnInit { - - generateImage: string = generatedStateImages[Math.floor(Math.random() * generatedStateImages.length)]; - statusMessage: string = ''; - statusMessageChanged = false; - - constructor(protected store: Store, - protected router: Router, - @Inject(MAT_DIALOG_DATA) public data: AiLoadingModalData, - public dialogRef: MatDialogRef, - private destroyRef: DestroyRef) { - super(store, router, dialogRef); - } - - ngOnInit() { - this.initGenerateState(); - } - - private initGenerateState(): void { - from(this.data.messages).pipe( - concatMap(message => of(message).pipe(delay(message.delay))), - takeUntilDestroyed(this.destroyRef) - ).subscribe((msg) => { - this.statusMessageChanged = true; - this.statusMessage = msg.text; - setTimeout(() => { - this.statusMessageChanged = false; - }, 500); - }); - } - -} diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html index 262b55a238..b2f16d33d2 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.html @@ -5,16 +5,16 @@ -->
- - @if (question().number?.unit) { {{ question().number.unit }} } -
@if (wrong()) { diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts index 685fdc4bf0..b7eae1fd27 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-number-field.component.ts @@ -15,7 +15,6 @@ export class AiNumberFieldComponent { question = input.required(); value = model(''); - disabled = input(false); enter = output(); private translate = inject(TranslateService); @@ -31,9 +30,6 @@ export class AiNumberFieldComponent { } stepBy(field: HTMLInputElement, direction: number): void { - if (this.disabled()) { - return; - } const current = aiReadNumber(field.value, this.locale()); const base = isNaN(current) ? (this.question().number?.suggested ?? 0) : current; const decimals = Math.max(aiStepDecimals(this.step()), isNaN(current) ? 0 : aiStepDecimals(current)); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.html index 3cfbfe0da2..e750917182 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.html @@ -22,7 +22,7 @@ {{ gate() || !progress() ? ('ai-assistant.plan.steps' | translate: {count: counted()}) : ('ai-assistant.plan.done-of' | translate: {done: done(), count: counted()}) }} @if (gate()) { - @@ -47,7 +47,7 @@ - } @else { diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.ts b/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.ts index 05442d6a15..282a52dd5a 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.ts +++ b/ui-ngx/src/app/modules/home/components/ai/ai-plan.component.ts @@ -30,7 +30,7 @@ export class AiPlanComponent { open = this.fold.open; @Output() run = new EventEmitter(); - @Output() change = new EventEmitter(); + @Output() changeRequested = new EventEmitter(); private cleared = signal>(new Set()); diff --git a/ui-ngx/src/app/modules/home/components/ai/ai-prompt-input.component.html b/ui-ngx/src/app/modules/home/components/ai/ai-prompt-input.component.html index 628dd9989f..b01eee5cf8 100644 --- a/ui-ngx/src/app/modules/home/components/ai/ai-prompt-input.component.html +++ b/ui-ngx/src/app/modules/home/components/ai/ai-prompt-input.component.html @@ -53,7 +53,7 @@
@if (suggestion && !hasText()) { - + {{ 'ai-assistant.suggestion-sr' | translate: {text: suggestion} }} } @@ -106,7 +106,7 @@ [style.--n]="step.options.length"> @for (option of step.options; track option.label) { @@ -115,7 +115,7 @@ {{ otherLabel(step) }} - @@ -128,11 +128,11 @@ @for (option of step.options; track option.label) { + (click)="pick(step, option.label)">{{ option.label }} }
@@ -142,16 +142,16 @@ @for (option of step.options; track option.label) { + (click)="pick(step, option.label)">{{ option.label }} } + (click)="pickOther(step)">{{ step.other?.label ? step.other.label + '…' : ('ai-assistant.question.other-chip' | translate) }}
@if (isOther(step) && step.number) { - } @else if (isOther(step)) { - @@ -164,7 +164,7 @@ [style.--n]="step.options.length"> @for (option of step.options; track option.label) { @@ -173,7 +173,7 @@ {{ otherLabel(step) }} - - - +
+ + } + @case ('config') { + +
+ +
+ + agent.app-profile-name + + @if (profileForm.get('name').hasError('required')) { + {{ 'agent.profile-name-required' | translate }} + } + + + + agent.app-profile-description + + +
+ + @if (composeTypeKeys.length > 1) { + + agent.app-compose-template-select + + @for (key of composeTypeKeys; track key) { + + {{ composeTypeLabel(key) }} + + } + + + } - @if (composeTypeKeys.length > 1) { - - agent.app-compose-template-select - - @for (key of composeTypeKeys; track key) { - - {{ composeTypeLabel(key) }} - + @if (selectedType === 'EDGE' || selectedType === 'GATEWAY') { +
+ info_outline + agent.app-profile-compose-creds-hint +
} -
-
- } - @if (selectedType === 'EDGE' || selectedType === 'GATEWAY') { -
- info_outline - agent.app-profile-compose-creds-hint -
+
+
agent.app-install-diff-template
+
agent.app-install-diff-editable
+ +
+ +

agent.app-install-diff-hint

+
+
} + @case ('save') { + +
+ +
+
+
+ agent.app-profile-name + {{ profileName }} +
+
+ agent.app-type + {{ selectedType }} +
+ @if (template) { +
+ agent.app-template + {{ template.currentVersion }} +
+ } + @if (profileDescription) { +
+ agent.app-profile-description + {{ profileDescription }} +
+ } +
-
-
agent.app-install-diff-template
-
agent.app-install-diff-editable
- -
- -

agent.app-install-diff-hint

-
- - - - -
- -
-
-
- agent.app-profile-name - {{ profileName }} -
-
- agent.app-type - {{ selectedType }} -
- @if (template) { -
- agent.app-template - {{ template.currentVersion }} -
- } - @if (profileDescription) { -
- agent.app-profile-description - {{ profileDescription }} +
+ info_outline + agent.app-profile-wizard-confirm-info +
- } -
- -
- info_outline - agent.app-profile-wizard-confirm-info -
-
-
-
- +
+
+ } + } + } - - +
+
+ @if (selectedIndex > 0) { + } - - @if (stepIndex === stepper?.steps.length - 1) { - - } @else { - + + @if (!isLastStep()) { + }
+ +
+ + +
diff --git a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.scss b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.scss index 06ddb621d2..39bf8d6bbc 100644 --- a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.scss +++ b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.scss @@ -2,7 +2,7 @@ // SPDX-License-Identifier: BUSL-1.1 @use '../../../components/agent/wizard/agent-wizard' as *; -@include wizard-chrome; +@include wizard-stepper-dialog(1280px); @include wizard-step-basics; @include wizard-type-cards; @include wizard-diff; diff --git a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.ts b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.ts index 200428b83c..17a59870ac 100644 --- a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.ts +++ b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.ts @@ -33,6 +33,10 @@ import { import { orderTemplatesNewestFirst } from '@home/pages/agent/util/template-version-order'; import { EdgeTemplateCompatibilityService } from '@home/pages/agent/util/edge-template-compatibility.service'; import { AgentAppWizardLoaderService } from '@home/pages/agent/wizard/agent-app-wizard-loader.service'; +import { + AGENT_APP_PROFILE_STEP_LABELS, + AgentAppProfileStepKey +} from '@home/pages/agent/wizard/agent-app-wizard.models'; export interface AgentAppProfileWizardData { profile?: AgentAppProfile; @@ -58,6 +62,10 @@ export class AgentAppProfileWizardComponent extends DialogComponent implements OnInit { + readonly stepLabels = AGENT_APP_PROFILE_STEP_LABELS; + steps: AgentAppProfileStepKey[] = []; + selectedIndex = 0; + // Left (read-only) = raw template compose; right (editable) = same content, // user-editable. This is the value persisted on submit. proposedYaml = ''; @@ -130,6 +138,7 @@ export class AgentAppProfileWizardComponent } ngOnInit() { + this.steps = this.buildSteps(); const prefetchTypes = this.lockedAppType ? [this.lockedAppType] : this.typeCards.map(card => card.type); prefetchTypes.forEach(type => { this.loader.loadTemplatesByType(type).subscribe({ error: () => {} }); @@ -308,6 +317,22 @@ export class AgentAppProfileWizardComponent this.dialogRef.close(undefined); } + isLastStep(): boolean { + return this.selectedIndex === this.steps.length - 1; + } + + canGoNext(): boolean { + return this.steps[this.selectedIndex] === 'type' ? this.canProceedFromType() : this.canSubmit(); + } + + nextStepLabel(): string { + return this.stepLabels[this.steps[this.selectedIndex + 1]] ?? ''; + } + + private buildSteps(): AgentAppProfileStepKey[] { + return this.editMode ? ['config', 'save'] : ['type', 'config', 'save']; + } + canProceedFromType(): boolean { return !!this.selectedType && !!this.selectedTemplateVersion && !!this.template && !this.loadingTemplate && !this.loadingTemplates && !this.loadError; diff --git a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-wizard.models.ts b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-wizard.models.ts index d7f0c68a2d..0fb0e54272 100644 --- a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-wizard.models.ts +++ b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-wizard.models.ts @@ -41,6 +41,32 @@ export interface AgentAppWizardFinish { closeOnly?: boolean; } +export type AgentAppInstallStepKey = 'agent' | 'type' | 'config' | 'summary' | 'deploy'; + +export const AGENT_APP_INSTALL_STEP_LABELS: Record = { + agent: 'agent.deploy-select-agent-step', + type: 'agent.app-install-step1', + config: 'agent.app-install-step3', + summary: 'agent.app-install-step4', + deploy: 'agent.deploy-install-step' +}; + +export type AgentAppUpgradeStepKey = 'profile' | 'config' | 'summary'; + +export const AGENT_APP_UPGRADE_STEP_LABELS: Record = { + profile: 'agent.app-upgrade-profile-step', + config: 'agent.app-install-step3', + summary: 'agent.app-install-step4' +}; + +export type AgentAppProfileStepKey = 'type' | 'config' | 'save'; + +export const AGENT_APP_PROFILE_STEP_LABELS: Record = { + type: 'agent.app-install-step1', + config: 'agent.app-install-step3', + save: 'agent.app-profile-step-save' +}; + export interface AgentTypeCard { type: AgentApplicationType; icon: string; diff --git a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.html b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.html index d1b739159f..8c5a8626c6 100644 --- a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.html +++ b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.html @@ -5,20 +5,21 @@ --> @if (!embedded) { - -
-

{{ (isEdit ? 'agent.edit-profile' : 'agent.add-profile') | translate }}

-
+ +

{{ (isEdit ? 'agent.edit-profile' : 'agent.add-profile') | translate }}

+
-
} +
-
- - +
@@ -106,30 +107,31 @@ - + +
+
+ @if (selectedIndex > 0 || showBack) { + + } + + @if (selectedIndex === 0) { + }
- + +
+ + +
diff --git a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.scss b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.scss index 46d93884bc..7c9c24d68a 100644 --- a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.scss +++ b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.scss @@ -2,32 +2,9 @@ // SPDX-License-Identifier: BUSL-1.1 @use '../../../components/agent/wizard/agent-wizard' as *; -@include wizard-chrome; +@include wizard-stepper-dialog(750px); :host { - display: block; - width: min(750px, 95vw); - min-width: 0; - max-width: 95vw; - - .tb-install-wizard-body.tb-install-wizard-embedded { - padding: 16px 24px 0 !important; - - mat-stepper { - flex: 1 1 auto; - } - - .step-footer { - position: sticky; - bottom: 0; - z-index: 15; - background: #fff; - margin: 16px -24px 0; - padding: 8px; - min-height: 52px; - } - } - // Sibling layout: button lives outside the entity-list's form-field so // clicking it counts as a genuine outside-click and MatAutocomplete closes // its panel naturally — no synthetic-event hacks needed. @@ -38,7 +15,7 @@ gap: 12px; .app-profile-picker-field { - flex: 1; + flex: 1 1 280px; min-width: 0; } diff --git a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.ts b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.ts index 2045dc0d95..af2f2a0050 100644 --- a/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.ts +++ b/ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.ts @@ -9,7 +9,6 @@ import { MediaBreakpoints } from '@shared/models/constants'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators'; import { - AgentAppProfile, AgentApplicationType, AgentProfile, AgentProvisionType, @@ -19,10 +18,7 @@ import { import { AgentService } from '@core/http/agent.service'; import { UserPermissionsService } from '@core/http/user-permissions.service'; import { Operation, Resource } from '@shared/models/security.models'; -import { - AgentAppProfileWizardComponent, - AgentAppProfileWizardData -} from '@home/pages/agent/wizard/agent-app-profile-wizard.component'; +import { openAgentAppProfileWizard } from '@home/pages/agent/wizard/agent-app-profile-wizard-dialog'; export interface AgentProfileWizardData { defaults?: Partial; @@ -62,6 +58,7 @@ export class AgentProfileWizardComponent implements OnInit { assignmentsLoadState: 'loading' | 'loaded' | 'failed' = 'loaded'; @ViewChild('stepper', { static: false }) stepper: MatStepper; + selectedIndex = 0; stepperLabelPosition: Observable<'bottom' | 'end'>; @@ -125,7 +122,11 @@ export class AgentProfileWizardComponent implements OnInit { } back() { - this.backClicked.emit(); + if (this.selectedIndex > 0) { + this.stepper.previous(); + } else { + this.backClicked.emit(); + } } canSubmit(): boolean { @@ -162,13 +163,7 @@ export class AgentProfileWizardComponent implements OnInit { } private openAppProfileWizard() { - this.dialog.open( - AgentAppProfileWizardComponent, { - disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'], - data: { lockedAppType: this.lockedAppType } - } - ).afterClosed().subscribe(saved => { + openAgentAppProfileWizard(this.dialog, { lockedAppType: this.lockedAppType }).subscribe(saved => { if (saved) { const currentIds: string[] = this.step2Form.value?.appProfileIds ?? []; if (!currentIds.includes(saved.id.id)) { diff --git a/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.html b/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.html index b3822d082e..e2d56769e4 100644 --- a/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.html +++ b/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.html @@ -66,8 +66,7 @@ [class.attn]="needsAttention(chat)" [attr.aria-current]="isActive(chat) ? 'page' : null" (click)="selectRow(chat)" (keydown.enter)="selectRow(chat)"> - @if (chat.solution) { diff --git a/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.ts b/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.ts index 278dfa5fd9..dde6295b0e 100644 --- a/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.ts +++ b/ui-ngx/src/app/modules/home/pages/ai-assistant/ai-assistant.component.ts @@ -1,5 +1,6 @@ // SPDX-FileCopyrightText: Copyright ThingsBoard, Inc. // SPDX-License-Identifier: BUSL-1.1 +import { AI_TOOLTIP_PROVIDERS } from '@home/components/ai/ai-tooltip'; import { TourService } from '@core/services/tour.service'; import { AiAssistantPanelService } from '@core/services/ai-assistant-panel.service'; import { AiChatService } from '@core/http/ai-chat.service'; @@ -61,7 +62,8 @@ export interface AiChatsGroup { host: { 'data-ai': '', '[class.rail-open]': 'railOpen()' - } + }, + providers: AI_TOOLTIP_PROVIDERS }) export class AiAssistantComponent implements OnInit, OnDestroy { diff --git a/ui-ngx/src/app/modules/home/pages/ai-assistant/cli/ai-cli-guide.component.scss b/ui-ngx/src/app/modules/home/pages/ai-assistant/cli/ai-cli-guide.component.scss index 6e4184f6a0..a16c5ecff6 100644 --- a/ui-ngx/src/app/modules/home/pages/ai-assistant/cli/ai-cli-guide.component.scss +++ b/ui-ngx/src/app/modules/home/pages/ai-assistant/cli/ai-cli-guide.component.scss @@ -83,6 +83,7 @@ $hero-bg: #1b252c; min-height: 0; overflow-x: hidden; overflow-y: auto; + overflow-anchor: none; padding: 0 20px; text-align: left; } diff --git a/ui-ngx/src/app/modules/home/pages/device/device-check-connectivity-dialog.component.ts b/ui-ngx/src/app/modules/home/pages/device/device-check-connectivity-dialog.component.ts index aee5d6cc5e..9ef6330f71 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device-check-connectivity-dialog.component.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device-check-connectivity-dialog.component.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors // SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. // SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 -import { Component, DestroyRef, Inject, NgZone, OnDestroy, OnInit } from '@angular/core'; +import { Component, Inject, NgZone, OnDestroy, OnInit } from '@angular/core'; import { DialogComponent } from '@shared/components/dialog.component'; import { select, Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; @@ -87,7 +87,6 @@ export class DeviceCheckConnectivityDialogComponent extends private telemetryWsService: TelemetryWebsocketService, private wl: WhiteLabelingService, private zone: NgZone, - private destroyRef: DestroyRef, private aiDashboardGenerationService: AiDashboardGenerationService) { super(store, router, dialogRef); @@ -215,17 +214,16 @@ export class DeviceCheckConnectivityDialogComponent extends generateDashboard($event: Event) { $event.stopPropagation(); - if (!this.data.afterAdd) { - this.aiDashboardGenerationService.generateWithTelemetryCheck({ - deviceId: this.data.deviceId.id, - destroyRef: this.destroyRef, - noTelemetry: { hideSendTelemetry: true } - }); - } else if (!this.latestTelemetry.length) { + if (this.data.afterAdd && !this.latestTelemetry.length) { this.aiDashboardGenerationService.openNoTelemetryModal({ hideSendTelemetry: true }); - } else { - this.aiDashboardGenerationService.generate(this.data.deviceId.id, this.destroyRef); + return; } + this.aiDashboardGenerationService.askInChat({ + deviceId: this.data.deviceId.id, + checkTelemetry: !this.data.afterAdd, + noTelemetry: { hideSendTelemetry: true }, + beforeCompose: () => this.dialogRef.close(null) + }); } isAllowedDashboardGenerate(): boolean { diff --git a/ui-ngx/src/app/modules/home/pages/device/device-group-config.factory.ts b/ui-ngx/src/app/modules/home/pages/device/device-group-config.factory.ts index b747925862..a29d9493c7 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device-group-config.factory.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device-group-config.factory.ts @@ -10,7 +10,7 @@ import { EntityGroupStateInfo, GroupEntityTableConfig } from '@home/models/group/group-entities-table-config.models'; -import { DestroyRef, Inject, Injectable } from '@angular/core'; +import { Inject, Injectable } from '@angular/core'; import { EntityType } from '@shared/models/entity-type.models'; import { DeviceComponent } from '@home/pages/device/device.component'; import { map, mergeMap, take, tap } from 'rxjs/operators'; @@ -65,7 +65,6 @@ export class DeviceGroupConfigFactory implements EntityGroupStateConfigFactory this.checkConnectivity($event, device.id) } }); } diff --git a/ui-ngx/src/app/modules/home/pages/device/device.component.ts b/ui-ngx/src/app/modules/home/pages/device/device.component.ts index a5017b5204..abab6df548 100644 --- a/ui-ngx/src/app/modules/home/pages/device/device.component.ts +++ b/ui-ngx/src/app/modules/home/pages/device/device.component.ts @@ -188,9 +188,9 @@ export class DeviceComponent extends GroupEntityComponent { generateDashboard($event: Event) { $event.stopPropagation(); - this.aiDashboardGenerationService.generateWithTelemetryCheck({ + this.aiDashboardGenerationService.askInChat({ deviceId: this.entity.id.id, - destroyRef: this.destroyRef, + deviceName: this.entity.name, noTelemetry: { checkConnectivity: () => this.onEntityAction($event, 'checkConnectivity') } }); } diff --git a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts index 90a353fc3b..c5989a66f1 100644 --- a/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/device/devices-table-config.resolver.ts @@ -1,7 +1,7 @@ // SPDX-FileCopyrightText: Copyright The ThingsBoard Authors // SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc. // SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1 -import { DestroyRef, Injectable } from '@angular/core'; +import { Injectable } from '@angular/core'; import { ActivatedRoute, ActivatedRouteSnapshot, Router } from '@angular/router'; import { CellActionDescriptor, @@ -91,7 +91,6 @@ export class DevicesTableConfigResolver { private router: Router, private dialog: MatDialog, private wl: WhiteLabelingService, - private destroyRef: DestroyRef, private iotHubActions: IotHubActionsService, private aiDashboardGenerationService: AiDashboardGenerationService) { } @@ -453,9 +452,9 @@ export class DevicesTableConfigResolver { generateDashboard($event: Event, device: DeviceInfo) { $event.stopPropagation(); - this.aiDashboardGenerationService.generateWithTelemetryCheck({ + this.aiDashboardGenerationService.askInChat({ deviceId: device.id.id, - destroyRef: this.destroyRef, + deviceName: device.name, noTelemetry: { checkConnectivity: () => this.checkConnectivity($event, device.id) } }); } diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.html b/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.html index a0725ab18b..81de6331b0 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.html +++ b/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.html @@ -48,15 +48,13 @@
-
- @if (contentData.docker) { - - } @else { -
- -
- } -
+ @if (contentData.docker) { + + } @else { +
+ +
+ }
@@ -67,15 +65,13 @@
-
- @if (contentData.ubuntu) { - - } @else { -
- -
- } -
+ @if (contentData.ubuntu) { + + } @else { +
+ +
+ }
@@ -86,15 +82,13 @@
-
- @if (contentData.centos) { - - } @else { -
- -
- } -
+ @if (contentData.centos) { + + } @else { +
+ +
+ }
diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.scss b/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.scss index 1c9578dafb..04403b94ab 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.scss +++ b/ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.scss @@ -6,8 +6,10 @@ :host { height: 100%; max-height: 100vh; + max-width: 100%; display: grid; grid-template-rows: min-content minmax(auto, 1fr) min-content; + grid-template-columns: minmax(0, 1fr); .tb-loader { display: flex; @@ -49,13 +51,27 @@ } .mat-mdc-dialog-content { - max-height: 80vh; padding: 0 16px 16px 16px; border-top: 16px solid #fff; + display: flex; + flex-direction: column; + overflow: hidden; + + @media #{$mat-gt-xs} { + max-height: 80vh; + } } } :host ::ng-deep { + .mat-mdc-dialog-content > .tb-form-panel, + .mat-mdc-dialog-content > .tb-form-panel > .tb-form-panel, + .mat-mdc-tab-group, + .mat-mdc-tab-body-wrapper { + flex: 1 1 auto; + min-height: 0; + } + .tb-markdown-view { padding: 16px 16px 32px 16px; div { diff --git a/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts b/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts index 91e235400e..c154d9ff11 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edge.component.ts @@ -21,12 +21,8 @@ import {EdgeService} from "@core/http/edge.service"; import { Router } from '@angular/router'; import { MatDialog } from '@angular/material/dialog'; import { AgentService } from '@core/http/agent.service'; -import { AgentApplication, AgentAppConfigType, AgentAppEvent } from '@shared/models/agent.models'; -import { - AgentAppInstallWizardComponent, - AgentAppInstallWizardData, - AgentAppInstallWizardResult -} from '@home/components/agent/wizard/agent-app-install-wizard.component'; +import { AgentApplication, AgentAppConfigType } from '@shared/models/agent.models'; +import { openAgentAppInstallWizard } from '@home/components/agent/wizard/agent-app-install-wizard-dialog'; @Component({ selector: 'tb-edge', @@ -218,21 +214,16 @@ export class EdgeComponent extends GroupEntityComponent { if ($event) { $event.stopPropagation(); } if (!this.managedApp) { return; } this.agentService.getAgentApplicationInfoById(this.managedApp.id.id).subscribe(full => { - this.dialog.open( - AgentAppInstallWizardComponent, { - disableClose: false, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'], - data: { - agentId: full.agentId?.id, - agent: null, - mode: 'upgrade', - application: full - } - }).afterClosed().subscribe(event => { - if (event && this.entity?.id?.id) { - this.loadManagedApp(this.entity.id.id); - } - }); + openAgentAppInstallWizard(this.dialog, { + agentId: full.agentId?.id, + agent: null, + mode: 'upgrade', + application: full + }).subscribe(event => { + if (event && this.entity?.id?.id) { + this.loadManagedApp(this.entity.id.id); + } + }); }); } diff --git a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts index 66f09ed6f0..06fe74a7a6 100644 --- a/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts +++ b/ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts @@ -49,10 +49,7 @@ import { CustomerId } from '@shared/models/id/customer-id'; import { UtilsService } from '@core/services/utils.service'; import { AddGroupEntityDialogComponent } from '@home/components/group/add-group-entity-dialog.component'; import { AddGroupEntityDialogData } from '@home/models/group/group-entity-component.models'; -import { - AgentAutoProvisionDialogData, - AgentAutoProvisionDialogComponent -} from '@home/components/agent/dialog/agent-auto-provision-dialog.component'; +import { AgentAutoProvisionDialogService } from '@home/components/agent/dialog/agent-auto-provision-dialog.service'; import { AgentApplicationType } from '@shared/models/agent.models'; import { AiAssistantConfigService } from '@core/services/ai-assistant-config.service'; import { AiAssistantViewType } from '@shared/models/ai-chat.models'; @@ -74,7 +71,8 @@ export class EdgesTableConfigResolver { private utils: UtilsService, private datePipe: DatePipe, private router: Router, - private dialog: MatDialog) { + private dialog: MatDialog, + private autoProvisionDialogService: AgentAutoProvisionDialogService) { } resolve(route: ActivatedRouteSnapshot): Observable> { @@ -297,13 +295,7 @@ export class EdgesTableConfigResolver { if ($event) { $event.stopPropagation(); } - this.dialog.open( - AgentAutoProvisionDialogComponent, { - disableClose: true, - panelClass: ['tb-dialog', 'tb-fullscreen-dialog'], - data: { appType: AgentApplicationType.EDGE } - } - ).afterClosed().subscribe(result => { + this.autoProvisionDialogService.open(AgentApplicationType.EDGE).subscribe(result => { if (result) { config.updateData(); } diff --git a/ui-ngx/src/app/modules/tour/welcome-invitation.component.scss b/ui-ngx/src/app/modules/tour/welcome-invitation.component.scss index 9ee04abeea..9a7577656a 100644 --- a/ui-ngx/src/app/modules/tour/welcome-invitation.component.scss +++ b/ui-ngx/src/app/modules/tour/welcome-invitation.component.scss @@ -22,6 +22,17 @@ } } +@media (min-width: 641px) and (max-height: 640px) { + .tb-invite-panel { + max-height: calc(100dvh - 16px) !important; + + .tb-invite { + max-height: calc(100dvh - 16px); + overflow-y: auto; + } + } +} + @media (max-width: 640px) { .tb-invite-panel { width: 100vw; diff --git a/ui-ngx/src/assets/locale/locale.constant-ar_AE.json b/ui-ngx/src/assets/locale/locale.constant-ar_AE.json index b741f807c6..76012ea314 100644 --- a/ui-ngx/src/assets/locale/locale.constant-ar_AE.json +++ b/ui-ngx/src/assets/locale/locale.constant-ar_AE.json @@ -11376,14 +11376,7 @@ "info": "معلومات", "main-dashboard": "لوحة المعلومات الرئيسية", "view-as": "عرض بصفة {{ name }}", - "estimate-wait-time": "وقت الانتظار المقدّر ~{{ time }}", "condition": "الشرط", - "step-reading-device-data": "جارٍ قراءة بيانات الجهاز…", - "step-analyzing-telemetry-attributes": "جارٍ تحليل القياس عن بُعد والسمات…", - "step-selecting-widgets": "جارٍ اختيار الأدوات المناسبة لبياناتك…", - "step-configuring-titles-units-ranges": "جارٍ تكوين العناوين والوحدات والمديات…", - "step-designing-layout": "جارٍ تصميم التخطيط…", - "step-arranging-widgets": "جارٍ ترتيب الأدوات على لوحة المعلومات…", "generate-dashboard": "توليد لوحة المعلومات", "generate-dashboard-with-ai": "توليد لوحة المعلومات بالذكاء الاصطناعي", "no-telemetry-title": "لم يتم العثور على بيانات القياس عن بُعد", diff --git a/ui-ngx/src/assets/locale/locale.constant-ca_ES.json b/ui-ngx/src/assets/locale/locale.constant-ca_ES.json index 73bd2e9e4c..346e27ed2e 100644 --- a/ui-ngx/src/assets/locale/locale.constant-ca_ES.json +++ b/ui-ngx/src/assets/locale/locale.constant-ca_ES.json @@ -11376,14 +11376,7 @@ "info": "Informació", "main-dashboard": "Tauler principal", "view-as": "Visualitza com a {{ name }}", - "estimate-wait-time": "El temps d'espera estimat és de ~{{ time }}", "condition": "Condició", - "step-reading-device-data": "S'estan llegint les dades del dispositiu…", - "step-analyzing-telemetry-attributes": "S'estan analitzant la telemetria i els atributs…", - "step-selecting-widgets": "S'estan seleccionant ginys per a les vostres dades…", - "step-configuring-titles-units-ranges": "S'estan configurant els títols, les unitats i els intervals…", - "step-designing-layout": "S'està dissenyant la disposició…", - "step-arranging-widgets": "S'estan col·locant els ginys al tauler…", "generate-dashboard": "Genera el tauler", "generate-dashboard-with-ai": "Genera el tauler amb IA", "no-telemetry-title": "No s'han trobat dades de telemetria", diff --git a/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json b/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json index f8f2331930..8e3326641c 100644 --- a/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json +++ b/ui-ngx/src/assets/locale/locale.constant-cs_CZ.json @@ -11376,14 +11376,7 @@ "info": "Informace", "main-dashboard": "Hlavní dashboard", "view-as": "Zobrazit jako {{ name }}", - "estimate-wait-time": "Odhadovaná doba čekání je ~{{ time }}", "condition": "Podmínka", - "step-reading-device-data": "Čtení dat zařízení…", - "step-analyzing-telemetry-attributes": "Analýza telemetrie a atributů…", - "step-selecting-widgets": "Výběr widgetů pro vaše data…", - "step-configuring-titles-units-ranges": "Konfigurace názvů, jednotek a rozsahů…", - "step-designing-layout": "Návrh rozvržení…", - "step-arranging-widgets": "Rozmísťování widgetů na dashboardu…", "generate-dashboard": "Generovat dashboard", "generate-dashboard-with-ai": "Generovat dashboard pomocí AI", "no-telemetry-title": "Nebyla nalezena žádná data telemetrie", diff --git a/ui-ngx/src/assets/locale/locale.constant-da_DK.json b/ui-ngx/src/assets/locale/locale.constant-da_DK.json index 8512a20208..7dfd9afa8b 100644 --- a/ui-ngx/src/assets/locale/locale.constant-da_DK.json +++ b/ui-ngx/src/assets/locale/locale.constant-da_DK.json @@ -11376,14 +11376,7 @@ "info": "Info", "main-dashboard": "Hoveddashboard", "view-as": "Vis som {{ name }}", - "estimate-wait-time": "Anslået ventetid er ~{{ time }}", "condition": "Betingelse", - "step-reading-device-data": "Læser enhedsdata…", - "step-analyzing-telemetry-attributes": "Analyserer telemetri og attributter…", - "step-selecting-widgets": "Vælger widgets til dine data…", - "step-configuring-titles-units-ranges": "Konfigurerer titler, måleenheder og områder…", - "step-designing-layout": "Designer layoutet…", - "step-arranging-widgets": "Placerer widgets på dashboardet…", "generate-dashboard": "Generér dashboard", "generate-dashboard-with-ai": "Generér dashboard med AI", "no-telemetry-title": "Ingen telemetridata fundet", diff --git a/ui-ngx/src/assets/locale/locale.constant-de_DE.json b/ui-ngx/src/assets/locale/locale.constant-de_DE.json index b57f784e68..28369f111b 100644 --- a/ui-ngx/src/assets/locale/locale.constant-de_DE.json +++ b/ui-ngx/src/assets/locale/locale.constant-de_DE.json @@ -11376,14 +11376,7 @@ "info": "Info", "main-dashboard": "Haupt-Dashboard", "view-as": "Anzeigen als {{ name }}", - "estimate-wait-time": "Geschätzte Wartezeit ca. {{ time }}", "condition": "Bedingung", - "step-reading-device-data": "Gerätedaten werden gelesen…", - "step-analyzing-telemetry-attributes": "Telemetrie und Attribute werden analysiert…", - "step-selecting-widgets": "Widgets für Ihre Daten werden ausgewählt…", - "step-configuring-titles-units-ranges": "Titel, Einheiten und Bereiche werden konfiguriert…", - "step-designing-layout": "Layout wird entworfen…", - "step-arranging-widgets": "Widgets werden auf dem Dashboard angeordnet…", "generate-dashboard": "Dashboard generieren", "generate-dashboard-with-ai": "Dashboard mit KI generieren", "no-telemetry-title": "Keine Telemetriedaten gefunden", diff --git a/ui-ngx/src/assets/locale/locale.constant-el_GR.json b/ui-ngx/src/assets/locale/locale.constant-el_GR.json index 26bf70569d..6b48ef6713 100644 --- a/ui-ngx/src/assets/locale/locale.constant-el_GR.json +++ b/ui-ngx/src/assets/locale/locale.constant-el_GR.json @@ -11376,14 +11376,7 @@ "info": "Πληροφορίες", "main-dashboard": "Κύριος πίνακας ελέγχου", "view-as": "Προβολή ως {{ name }}", - "estimate-wait-time": "Ο εκτιμώμενος χρόνος αναμονής είναι ~{{ time }}", "condition": "Συνθήκη", - "step-reading-device-data": "Ανάγνωση δεδομένων συσκευής…", - "step-analyzing-telemetry-attributes": "Ανάλυση τηλεμετρίας και χαρακτηριστικών…", - "step-selecting-widgets": "Επιλογή widget για τα δεδομένα σας…", - "step-configuring-titles-units-ranges": "Διαμόρφωση τίτλων, μονάδων και ευρών…", - "step-designing-layout": "Σχεδιασμός της διάταξης…", - "step-arranging-widgets": "Τοποθέτηση των widget στον πίνακα ελέγχου…", "generate-dashboard": "Δημιουργία πίνακα ελέγχου", "generate-dashboard-with-ai": "Δημιουργία πίνακα ελέγχου με AI", "no-telemetry-title": "Δεν βρέθηκαν δεδομένα τηλεμετρίας", 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 3d4c048229..4915968a2e 100644 --- a/ui-ngx/src/assets/locale/locale.constant-en_US.json +++ b/ui-ngx/src/assets/locale/locale.constant-en_US.json @@ -691,6 +691,10 @@ "use-system-mobile-settings": "Use system mobile settings" }, "ai-assistant": { + "ask": { + "device-dashboard": "Build a dashboard for {{name}}", + "device-dashboard-keys": "Build a dashboard for {{name}} showing {{keys}}" + }, "question": { "other-chip": "Other…", "other-color": "Other color…", @@ -815,7 +819,6 @@ "text": "'{{text}}'", "related-from": "what {{entity}} points to", "related-to": "what points to {{entity}}", - "alarms-of": "{{entity}}", "alarms": "{{filter}}", "alarms-on": "on {{entity}}", "alarms-filter-on": "{{filter}}, on {{entity}}", @@ -857,7 +860,6 @@ "search-named": "Searched {{what}} named like '{{name}}'", "search-typed": "Searched {{what}} of the {{types}} profile", "search-text": "Searched {{what}} matching '{{text}}'", - "search-alarms-of": "Searched the alarms of {{entity}}", "what": { "devices": "devices", "assets": "assets", @@ -1131,6 +1133,7 @@ "search-web": "Searched the web for '{{query}}'", "fetch-page": "Read {{url}}", "create-dashboard": "Created the dashboard '{{name}}'", + "generate-device-dashboard": "Designed a dashboard for {{entity}} from its data", "update-dashboard": "Updated {{entity}}", "read-dashboard": "Read the layout of {{entity}}", "add-state": "Added the state '{{name}}' to {{entity}}", @@ -1458,6 +1461,10 @@ "run": "Creating the dashboard", "done": "Created the dashboard" }, + "generate-device-dashboard": { + "run": "Designing the dashboard", + "done": "Created the dashboard" + }, "update-dashboard": { "run": "Updating the dashboard", "done": "Updated the dashboard" @@ -2393,7 +2400,7 @@ "test-first": "Test from this computer first", "test-here": "Test from this computer", "send-test": "Send a test value", - "send-test-tip": "Sends one value as the device, marked as a test; the wait keeps listening for the device itself", + "send-test-tip": "Marked as a test", "test-sent": "Sent a test value at {{time}}; it is on the latest telemetry. The wait goes on for the device itself.", "test-failed": "The test value did not go through: {{error}}.", "needs-you": "Needs you", @@ -2694,7 +2701,7 @@ } }, "copy": "Copy", - "edit-message": "Edit: the words back in the composer", + "edit-message": "Edit", "show-all": "Show all", "rename-save": "Save (Enter)", "rename-discard": "Discard (Esc)", @@ -2853,6 +2860,7 @@ "tag": "Tag", "entities": "Entities", "includes": "Also saves", + "shows": "Shows", "removeOthers": "Delete what the version lacks", "assignee": "Assignee", "comment": "Comment", @@ -2861,6 +2869,7 @@ "window": "Time window", "type": "Type", "dashboard": "Default dashboard", + "dashboard-image": "Picture", "queue": "Queue", "image": "Picture", "value": "Value", @@ -3076,6 +3085,7 @@ "NOTIFICATION_PREFERENCES": "Notification preferences" }, "kind": { + "attributes": "attributes", "ADMIN_SETTINGS": "the admin settings", "AGENT": "an agent", "AGENT_APPLICATION": "an application", @@ -3236,14 +3246,13 @@ "pinned": "Pinned", "pin": "Pin to the top", "unpin": "Unpin", - "double-click-to-rename": "Double-click to rename", "new-solution": "New solution", "edit-design": "Edit the design", - "chats-menu": "Chats and this chat", "resize-panel": "Resize the AI Assistant panel", "resize-panel-hint": "Drag to resize; double-click to reset", "open-full-screen": "Open full screen", "recent-chats": "Recent chats", + "on-this-page": "On this page", "all-chats": "All chats", "panel-title": "Ask about this page", "panel-line": "What is on it, what to change, or something new.", @@ -3259,7 +3268,6 @@ "open-chat": "Open the chat" }, "started-from": "Started from", - "open-page": "Open {{name}}", "page": { "DEVICE_LIST": "Devices", "DEVICE_GROUP_LIST": "Device groups", @@ -4567,7 +4575,7 @@ "run-step-by-step": "Run step by step", "run-auto": "Run with auto-approve", "run-tip": "Each change waits for your approval", - "run-auto-tip": "Changes are made as the plan says. Every action still shows, and Stop halts the run.", + "run-auto-tip": "Stop still works", "run-prompt": "Run the plan.", "leave-out": "Leave out step {{number}}: {{text}}" }, @@ -15831,12 +15839,10 @@ "get-started": "Get started", "installed": "Solution installed", "installed-line": "{ entities, plural, =1 {1 entity} other {# entities} } · { dashboards, plural, =1 {1 dashboard} other {# dashboards} } · live on simulated data", - "view-as-user": "View as {{name}}", - "json-note": "Edits here are applied as they are; the AI does not review them.", + "json-note": "The AI does not review these edits", "json-invalid": "Not valid JSON: {{message}}", "json-applied": "Applied", "json-discarded": "Your JSON changes were discarded.", - "json-tip": "View as JSON", "view-json": "View", "keys": "{ count, plural, =1 {1 key} other {# keys} }", "list": "List", @@ -15877,8 +15883,6 @@ "view-as-main": "View as user", "install-failed": "Install failed", "step-failed": "Step failed", - "open-name": "Opens {{name}}", - "open-list": "Opens {{name}} in ThingsBoard", "pending-DEVICE": "{{profile}} devices", "pending-ASSET": "{{profile}} assets", "pending-CUSTOMER": "{{profile}} customers", @@ -15901,7 +15905,6 @@ "installed-already-note": "The installed solution stays as it is until you create it again; creating then replaces it.", "what-should-it-do": "What should the solution do?", "what-it-becomes": "A description becomes profiles, roles, calculated fields, alarm rules and dashboards, on simulated devices.", - "example-tip": "Puts the example in the composer", "limits": "Nothing is created in your tenant until you approve the design and install it.", "what-is-solution": "What is a solution?", "about-title": "ThingsBoard Solutions", @@ -15989,14 +15992,7 @@ "info": "Info", "main-dashboard": "Main dashboard", "view-as": "View as {{ name }}", - "estimate-wait-time": "Estimated wait time is ~{{ time }}", "condition": "Condition", - "step-reading-device-data": "Reading device data…", - "step-analyzing-telemetry-attributes": "Analyzing telemetry & attributes…", - "step-selecting-widgets": "Selecting widgets for your data…", - "step-configuring-titles-units-ranges": "Configuring titles, units, and ranges…", - "step-designing-layout": "Designing the layout…", - "step-arranging-widgets": "Arranging widgets on the dashboard…", "generate-dashboard": "Generate dashboard", "generate-dashboard-with-ai": "Generate dashboard with AI", "no-telemetry-title": "No telemetry data found", diff --git a/ui-ngx/src/assets/locale/locale.constant-es_ES.json b/ui-ngx/src/assets/locale/locale.constant-es_ES.json index 3fad72eadc..05f239c797 100644 --- a/ui-ngx/src/assets/locale/locale.constant-es_ES.json +++ b/ui-ngx/src/assets/locale/locale.constant-es_ES.json @@ -11376,14 +11376,7 @@ "info": "Información", "main-dashboard": "Tablero principal", "view-as": "Ver como {{ name }}", - "estimate-wait-time": "El tiempo de espera estimado es de ~{{ time }}", "condition": "Condición", - "step-reading-device-data": "Leyendo los datos del dispositivo…", - "step-analyzing-telemetry-attributes": "Analizando telemetría y atributos…", - "step-selecting-widgets": "Seleccionando widgets para tus datos…", - "step-configuring-titles-units-ranges": "Configurando títulos, unidades y rangos…", - "step-designing-layout": "Diseñando el diseño de página…", - "step-arranging-widgets": "Organizando los widgets en el tablero…", "generate-dashboard": "Generar tablero", "generate-dashboard-with-ai": "Generar tablero con IA", "no-telemetry-title": "No se encontraron datos de telemetría", diff --git a/ui-ngx/src/assets/locale/locale.constant-fr_FR.json b/ui-ngx/src/assets/locale/locale.constant-fr_FR.json index fc12fa5cec..2bab3af4fa 100644 --- a/ui-ngx/src/assets/locale/locale.constant-fr_FR.json +++ b/ui-ngx/src/assets/locale/locale.constant-fr_FR.json @@ -11376,14 +11376,7 @@ "info": "Infos", "main-dashboard": "Tableau de bord principal", "view-as": "Afficher en tant que {{ name }}", - "estimate-wait-time": "Le temps d’attente estimé est d’environ {{ time }}", "condition": "Condition", - "step-reading-device-data": "Lecture des données de l’appareil…", - "step-analyzing-telemetry-attributes": "Analyse de la télémétrie et des attributs…", - "step-selecting-widgets": "Sélection des widgets pour vos données…", - "step-configuring-titles-units-ranges": "Configuration des titres, unités et plages…", - "step-designing-layout": "Conception de la mise en page…", - "step-arranging-widgets": "Disposition des widgets sur le tableau de bord…", "generate-dashboard": "Générer le tableau de bord", "generate-dashboard-with-ai": "Générer le tableau de bord avec l’IA", "no-telemetry-title": "Aucune donnée de télémétrie trouvée", diff --git a/ui-ngx/src/assets/locale/locale.constant-hi_IN.json b/ui-ngx/src/assets/locale/locale.constant-hi_IN.json index 93ae41432a..0b9a3a71e0 100644 --- a/ui-ngx/src/assets/locale/locale.constant-hi_IN.json +++ b/ui-ngx/src/assets/locale/locale.constant-hi_IN.json @@ -11376,14 +11376,7 @@ "info": "जानकारी", "main-dashboard": "मुख्य डैशबोर्ड", "view-as": "{{ name }} के रूप में देखें", - "estimate-wait-time": "अनुमानित प्रतीक्षा समय ~{{ time }} है", "condition": "शर्त", - "step-reading-device-data": "डिवाइस डेटा पढ़ा जा रहा है…", - "step-analyzing-telemetry-attributes": "टेलीमेट्री और विशेषताओं का विश्लेषण किया जा रहा है…", - "step-selecting-widgets": "आपके डेटा के लिए विजेट चुने जा रहे हैं…", - "step-configuring-titles-units-ranges": "शीर्षक, इकाइयाँ और रेंज कॉन्फ़िगर किए जा रहे हैं…", - "step-designing-layout": "लेआउट डिज़ाइन किया जा रहा है…", - "step-arranging-widgets": "डैशबोर्ड पर विजेट व्यवस्थित किए जा रहे हैं…", "generate-dashboard": "डैशबोर्ड जनरेट करें", "generate-dashboard-with-ai": "AI से डैशबोर्ड जनरेट करें", "no-telemetry-title": "कोई टेलीमेट्री डेटा नहीं मिला", diff --git a/ui-ngx/src/assets/locale/locale.constant-it_IT.json b/ui-ngx/src/assets/locale/locale.constant-it_IT.json index fdc2473a18..21d646247f 100644 --- a/ui-ngx/src/assets/locale/locale.constant-it_IT.json +++ b/ui-ngx/src/assets/locale/locale.constant-it_IT.json @@ -11376,14 +11376,7 @@ "info": "Info", "main-dashboard": "Dashboard principale", "view-as": "Visualizza come {{ name }}", - "estimate-wait-time": "Il tempo di attesa stimato è di ~{{ time }}", "condition": "Condizione", - "step-reading-device-data": "Lettura dei dati del dispositivo…", - "step-analyzing-telemetry-attributes": "Analisi di telemetria e attributi…", - "step-selecting-widgets": "Selezione dei widget per i tuoi dati…", - "step-configuring-titles-units-ranges": "Configurazione di titoli, unità e intervalli…", - "step-designing-layout": "Progettazione del layout…", - "step-arranging-widgets": "Disposizione dei widget nella dashboard…", "generate-dashboard": "Genera dashboard", "generate-dashboard-with-ai": "Genera dashboard con l'IA", "no-telemetry-title": "Nessun dato di telemetria trovato", diff --git a/ui-ngx/src/assets/locale/locale.constant-ja_JP.json b/ui-ngx/src/assets/locale/locale.constant-ja_JP.json index decb18aff3..a99fbdab89 100644 --- a/ui-ngx/src/assets/locale/locale.constant-ja_JP.json +++ b/ui-ngx/src/assets/locale/locale.constant-ja_JP.json @@ -11376,14 +11376,7 @@ "info": "情報", "main-dashboard": "メインダッシュボード", "view-as": "{{ name }}として表示", - "estimate-wait-time": "推定待ち時間は約{{ time }}です。", "condition": "条件", - "step-reading-device-data": "デバイスデータを読み取っています…", - "step-analyzing-telemetry-attributes": "テレメトリと属性を分析しています…", - "step-selecting-widgets": "データに適したウィジェットを選択しています…", - "step-configuring-titles-units-ranges": "タイトル、単位、範囲を設定しています…", - "step-designing-layout": "レイアウトを設計しています…", - "step-arranging-widgets": "ダッシュボードにウィジェットを配置しています…", "generate-dashboard": "ダッシュボードを生成", "generate-dashboard-with-ai": "AIでダッシュボードを生成", "no-telemetry-title": "テレメトリデータが見つかりません", diff --git a/ui-ngx/src/assets/locale/locale.constant-ka_GE.json b/ui-ngx/src/assets/locale/locale.constant-ka_GE.json index b1f4a8ce68..e04de1378c 100644 --- a/ui-ngx/src/assets/locale/locale.constant-ka_GE.json +++ b/ui-ngx/src/assets/locale/locale.constant-ka_GE.json @@ -11376,14 +11376,7 @@ "info": "ინფორმაცია", "main-dashboard": "მთავარი სამუშაო დაფა", "view-as": "ნახვა როგორც {{ name }}", - "estimate-wait-time": "მოლოდინის სავარაუდო დროა ~{{ time }}", "condition": "პირობა", - "step-reading-device-data": "მოწყობილობის მონაცემების წაკითხვა…", - "step-analyzing-telemetry-attributes": "ტელემეტრიისა და ატრიბუტების ანალიზი…", - "step-selecting-widgets": "ვიჯეტების შერჩევა თქვენი მონაცემებისთვის…", - "step-configuring-titles-units-ranges": "სათაურების, ერთეულებისა და დიაპაზონების კონფიგურირება…", - "step-designing-layout": "განლაგების დაპროექტება…", - "step-arranging-widgets": "ვიჯეტების განთავსება სამუშაო დაფაზე…", "generate-dashboard": "სამუშაო დაფის გენერირება", "generate-dashboard-with-ai": "სამუშაო დაფის გენერირება AI-ით", "no-telemetry-title": "ტელემეტრიის მონაცემები ვერ მოიძებნა", diff --git a/ui-ngx/src/assets/locale/locale.constant-ko_KR.json b/ui-ngx/src/assets/locale/locale.constant-ko_KR.json index f474a1478b..84abc0606c 100644 --- a/ui-ngx/src/assets/locale/locale.constant-ko_KR.json +++ b/ui-ngx/src/assets/locale/locale.constant-ko_KR.json @@ -11450,14 +11450,7 @@ "info": "정보", "main-dashboard": "메인 대시보드", "view-as": "{{ name }}(으)로 보기", - "estimate-wait-time": "예상 대기 시간은 약 {{ time }}입니다", "condition": "조건", - "step-reading-device-data": "장치 데이터 읽는 중…", - "step-analyzing-telemetry-attributes": "텔레메트리 및 속성 분석 중…", - "step-selecting-widgets": "데이터에 맞는 위젯 선택 중…", - "step-configuring-titles-units-ranges": "제목, 단위 및 범위 구성 중…", - "step-designing-layout": "레이아웃 디자인 중…", - "step-arranging-widgets": "대시보드에 위젯 배치 중…", "generate-dashboard": "대시보드 생성", "generate-dashboard-with-ai": "AI로 대시보드 생성", "no-telemetry-title": "텔레메트리 데이터를 찾을 수 없습니다", diff --git a/ui-ngx/src/assets/locale/locale.constant-lt_LT.json b/ui-ngx/src/assets/locale/locale.constant-lt_LT.json index b36ced63f5..2a7cf74b56 100644 --- a/ui-ngx/src/assets/locale/locale.constant-lt_LT.json +++ b/ui-ngx/src/assets/locale/locale.constant-lt_LT.json @@ -11376,14 +11376,7 @@ "info": "Informacija", "main-dashboard": "Pagrindinis skydelis", "view-as": "Peržiūrėti kaip {{ name }}", - "estimate-wait-time": "Numatomas laukimo laikas – ~{{ time }}", "condition": "Sąlyga", - "step-reading-device-data": "Skaitomi įrenginio duomenys…", - "step-analyzing-telemetry-attributes": "Analizuojama telemetrija ir atributai…", - "step-selecting-widgets": "Parenkami valdikliai jūsų duomenims…", - "step-configuring-titles-units-ranges": "Konfigūruojami pavadinimai, matavimo vienetai ir diapazonai…", - "step-designing-layout": "Kuriamas išdėstymas…", - "step-arranging-widgets": "Valdikliai išdėstomi skydelyje…", "generate-dashboard": "Generuoti skydelį", "generate-dashboard-with-ai": "Generuoti skydelį naudojant DI", "no-telemetry-title": "Telemetrijos duomenų nerasta", diff --git a/ui-ngx/src/assets/locale/locale.constant-lv_LV.json b/ui-ngx/src/assets/locale/locale.constant-lv_LV.json index 92b5805eec..62aa4b854e 100644 --- a/ui-ngx/src/assets/locale/locale.constant-lv_LV.json +++ b/ui-ngx/src/assets/locale/locale.constant-lv_LV.json @@ -11376,14 +11376,7 @@ "info": "Informācija", "main-dashboard": "Galvenais infopanelis", "view-as": "Skatīt kā {{ name }}", - "estimate-wait-time": "Aptuvenais gaidīšanas laiks ir ~{{ time }}", "condition": "Nosacījums", - "step-reading-device-data": "Notiek iekārtas datu nolasīšana…", - "step-analyzing-telemetry-attributes": "Telemetrijas un atribūtu analīze…", - "step-selecting-widgets": "Logrīku atlase jūsu datiem…", - "step-configuring-titles-units-ranges": "Virsrakstu, vienību un diapazonu konfigurēšana…", - "step-designing-layout": "Izkārtojuma izstrāde…", - "step-arranging-widgets": "Logrīku izkārtošana infopanelī…", "generate-dashboard": "Ģenerēt infopaneli", "generate-dashboard-with-ai": "Ģenerēt infopaneli ar MI", "no-telemetry-title": "Telemetrijas dati nav atrasti", diff --git a/ui-ngx/src/assets/locale/locale.constant-nl_BE.json b/ui-ngx/src/assets/locale/locale.constant-nl_BE.json index c072ebfeac..4b2884616e 100644 --- a/ui-ngx/src/assets/locale/locale.constant-nl_BE.json +++ b/ui-ngx/src/assets/locale/locale.constant-nl_BE.json @@ -11382,14 +11382,7 @@ "info": "Info", "main-dashboard": "Hoofddashboard", "view-as": "Bekijken als {{ name }}", - "estimate-wait-time": "Geschatte wachttijd is ~{{ time }}", "condition": "Voorwaarde", - "step-reading-device-data": "Apparaatgegevens worden gelezen…", - "step-analyzing-telemetry-attributes": "Telemetrie & attributen worden geanalyseerd…", - "step-selecting-widgets": "Widgets voor je gegevens worden geselecteerd…", - "step-configuring-titles-units-ranges": "Titels, eenheden en bereiken worden geconfigureerd…", - "step-designing-layout": "De lay-out wordt ontworpen…", - "step-arranging-widgets": "Widgets worden op het dashboard gerangschikt…", "generate-dashboard": "Dashboard genereren", "generate-dashboard-with-ai": "Dashboard genereren met AI", "no-telemetry-title": "Geen telemetriegegevens gevonden", diff --git a/ui-ngx/src/assets/locale/locale.constant-nl_NL.json b/ui-ngx/src/assets/locale/locale.constant-nl_NL.json index c93bcd00b6..b8d930aec1 100644 --- a/ui-ngx/src/assets/locale/locale.constant-nl_NL.json +++ b/ui-ngx/src/assets/locale/locale.constant-nl_NL.json @@ -11376,14 +11376,7 @@ "info": "Info", "main-dashboard": "Hoofddashboard", "view-as": "Bekijken als {{ name }}", - "estimate-wait-time": "Geschatte wachttijd is ~{{ time }}", "condition": "Voorwaarde", - "step-reading-device-data": "Apparaatgegevens worden gelezen…", - "step-analyzing-telemetry-attributes": "Telemetrie & attributen worden geanalyseerd…", - "step-selecting-widgets": "Widgets voor je gegevens worden geselecteerd…", - "step-configuring-titles-units-ranges": "Titels, eenheden en bereiken worden geconfigureerd…", - "step-designing-layout": "De lay-out wordt ontworpen…", - "step-arranging-widgets": "Widgets worden op het dashboard gerangschikt…", "generate-dashboard": "Dashboard genereren", "generate-dashboard-with-ai": "Dashboard genereren met AI", "no-telemetry-title": "Geen telemetriegegevens gevonden", diff --git a/ui-ngx/src/assets/locale/locale.constant-no_NO.json b/ui-ngx/src/assets/locale/locale.constant-no_NO.json index 9636ff99e0..571de56925 100644 --- a/ui-ngx/src/assets/locale/locale.constant-no_NO.json +++ b/ui-ngx/src/assets/locale/locale.constant-no_NO.json @@ -11376,14 +11376,7 @@ "info": "Info", "main-dashboard": "Hoveddashbord", "view-as": "Vis som {{ name }}", - "estimate-wait-time": "Estimert ventetid er ~{{ time }}", "condition": "Betingelse", - "step-reading-device-data": "Leser enhetsdata…", - "step-analyzing-telemetry-attributes": "Analyserer telemetri og attributter…", - "step-selecting-widgets": "Velger widgeter for dataene dine…", - "step-configuring-titles-units-ranges": "Konfigurerer titler, måleenheter og områder…", - "step-designing-layout": "Utformer oppsettet…", - "step-arranging-widgets": "Plasserer widgeter på dashbordet…", "generate-dashboard": "Generer dashbord", "generate-dashboard-with-ai": "Generer dashbord med AI", "no-telemetry-title": "Fant ingen telemetridata", diff --git a/ui-ngx/src/assets/locale/locale.constant-pl_PL.json b/ui-ngx/src/assets/locale/locale.constant-pl_PL.json index 8c176df445..9d0a13c5af 100644 --- a/ui-ngx/src/assets/locale/locale.constant-pl_PL.json +++ b/ui-ngx/src/assets/locale/locale.constant-pl_PL.json @@ -11376,14 +11376,7 @@ "info": "Informacje", "main-dashboard": "Pulpit główny", "view-as": "Wyświetl jako {{ name }}", - "estimate-wait-time": "Szacowany czas oczekiwania: ~{{ time }}", "condition": "Warunek", - "step-reading-device-data": "Odczytywanie danych urządzenia…", - "step-analyzing-telemetry-attributes": "Analizowanie telemetrii i atrybutów…", - "step-selecting-widgets": "Wybieranie widżetów dla Twoich danych…", - "step-configuring-titles-units-ranges": "Konfigurowanie tytułów, jednostek i zakresów…", - "step-designing-layout": "Projektowanie układu…", - "step-arranging-widgets": "Rozmieszczanie widżetów na pulpicie…", "generate-dashboard": "Wygeneruj pulpit", "generate-dashboard-with-ai": "Wygeneruj pulpit za pomocą AI", "no-telemetry-title": "Nie znaleziono danych telemetrii", diff --git a/ui-ngx/src/assets/locale/locale.constant-pt_BR.json b/ui-ngx/src/assets/locale/locale.constant-pt_BR.json index 2678445a76..b1b1aea2a4 100644 --- a/ui-ngx/src/assets/locale/locale.constant-pt_BR.json +++ b/ui-ngx/src/assets/locale/locale.constant-pt_BR.json @@ -11376,14 +11376,7 @@ "info": "Informações", "main-dashboard": "Dashboard principal", "view-as": "Visualizar como {{ name }}", - "estimate-wait-time": "O tempo de espera estimado é de ~{{ time }}", "condition": "Condição", - "step-reading-device-data": "Lendo dados do dispositivo…", - "step-analyzing-telemetry-attributes": "Analisando telemetria e atributos…", - "step-selecting-widgets": "Selecionando widgets para seus dados…", - "step-configuring-titles-units-ranges": "Configurando títulos, unidades e intervalos…", - "step-designing-layout": "Projetando o layout…", - "step-arranging-widgets": "Organizando widgets no dashboard…", "generate-dashboard": "Gerar dashboard", "generate-dashboard-with-ai": "Gerar dashboard com IA", "no-telemetry-title": "Nenhum dado de telemetria encontrado", diff --git a/ui-ngx/src/assets/locale/locale.constant-ro_RO.json b/ui-ngx/src/assets/locale/locale.constant-ro_RO.json index f3ece1f782..391078af12 100644 --- a/ui-ngx/src/assets/locale/locale.constant-ro_RO.json +++ b/ui-ngx/src/assets/locale/locale.constant-ro_RO.json @@ -11376,14 +11376,7 @@ "info": "Informații", "main-dashboard": "Tablou de bord principal", "view-as": "Vizualizează ca {{ name }}", - "estimate-wait-time": "Timpul de așteptare estimat este de ~{{ time }}", "condition": "Condiție", - "step-reading-device-data": "Se citesc datele dispozitivului…", - "step-analyzing-telemetry-attributes": "Se analizează telemetria și atributele…", - "step-selecting-widgets": "Se selectează widgeturile pentru datele dumneavoastră…", - "step-configuring-titles-units-ranges": "Se configurează titlurile, unitățile și intervalele…", - "step-designing-layout": "Se proiectează aspectul…", - "step-arranging-widgets": "Se aranjează widgeturile pe tabloul de bord…", "generate-dashboard": "Generează tabloul de bord", "generate-dashboard-with-ai": "Generează tabloul de bord cu IA", "no-telemetry-title": "Nu s-au găsit date de telemetrie", diff --git a/ui-ngx/src/assets/locale/locale.constant-sl_SI.json b/ui-ngx/src/assets/locale/locale.constant-sl_SI.json index 8b4d90dbbe..e4719d9861 100644 --- a/ui-ngx/src/assets/locale/locale.constant-sl_SI.json +++ b/ui-ngx/src/assets/locale/locale.constant-sl_SI.json @@ -11450,14 +11450,7 @@ "info": "Informacije", "main-dashboard": "Glavna nadzorna plošča", "view-as": "Prikaži kot {{ name }}", - "estimate-wait-time": "Predviden čas čakanja je ~{{ time }}", "condition": "Pogoj", - "step-reading-device-data": "Branje podatkov naprave…", - "step-analyzing-telemetry-attributes": "Analiziranje telemetrije in atributov…", - "step-selecting-widgets": "Izbiranje gradnikov za vaše podatke…", - "step-configuring-titles-units-ranges": "Nastavljanje naslovov, enot in obsegov…", - "step-designing-layout": "Oblikovanje postavitve…", - "step-arranging-widgets": "Razporejanje gradnikov na nadzorni plošči…", "generate-dashboard": "Ustvari nadzorno ploščo", "generate-dashboard-with-ai": "Ustvari nadzorno ploščo z umetno inteligenco", "no-telemetry-title": "Ni najdenih podatkov telemetrije", diff --git a/ui-ngx/src/assets/locale/locale.constant-tr_TR.json b/ui-ngx/src/assets/locale/locale.constant-tr_TR.json index af0e97bce0..182c969e95 100644 --- a/ui-ngx/src/assets/locale/locale.constant-tr_TR.json +++ b/ui-ngx/src/assets/locale/locale.constant-tr_TR.json @@ -11376,14 +11376,7 @@ "info": "Bilgi", "main-dashboard": "Ana pano", "view-as": "{{ name }} olarak görüntüle", - "estimate-wait-time": "Tahmini bekleme süresi: ~{{ time }}", "condition": "Koşul", - "step-reading-device-data": "Cihaz verileri okunuyor…", - "step-analyzing-telemetry-attributes": "Telemetri ve öznitelikler analiz ediliyor…", - "step-selecting-widgets": "Verileriniz için widget'lar seçiliyor…", - "step-configuring-titles-units-ranges": "Başlıklar, birimler ve aralıklar yapılandırılıyor…", - "step-designing-layout": "Düzen tasarlanıyor…", - "step-arranging-widgets": "Widget'lar panoya yerleştiriliyor…", "generate-dashboard": "Pano oluştur", "generate-dashboard-with-ai": "Yapay zeka ile pano oluştur", "no-telemetry-title": "Telemetri verisi bulunamadı", diff --git a/ui-ngx/src/assets/locale/locale.constant-uk_UA.json b/ui-ngx/src/assets/locale/locale.constant-uk_UA.json index 7227fa4347..fa337f0f97 100644 --- a/ui-ngx/src/assets/locale/locale.constant-uk_UA.json +++ b/ui-ngx/src/assets/locale/locale.constant-uk_UA.json @@ -11376,14 +11376,7 @@ "info": "Інформація", "main-dashboard": "Головний дашборд", "view-as": "Переглянути як {{ name }}", - "estimate-wait-time": "Орієнтовний час очікування: ~{{ time }}", "condition": "Умова", - "step-reading-device-data": "Читання даних пристрою…", - "step-analyzing-telemetry-attributes": "Аналіз телеметрії та атрибутів…", - "step-selecting-widgets": "Підбір віджетів для ваших даних…", - "step-configuring-titles-units-ranges": "Налаштування заголовків, одиниць виміру та діапазонів…", - "step-designing-layout": "Проєктування макету…", - "step-arranging-widgets": "Розміщення віджетів на дашборді…", "generate-dashboard": "Згенерувати дашборд", "generate-dashboard-with-ai": "Згенерувати дашборд за допомогою ШІ", "no-telemetry-title": "Дані телеметрії не знайдено", diff --git a/ui-ngx/src/assets/locale/locale.constant-zh_CN.json b/ui-ngx/src/assets/locale/locale.constant-zh_CN.json index ad7a6f0c41..dde66f7e93 100644 --- a/ui-ngx/src/assets/locale/locale.constant-zh_CN.json +++ b/ui-ngx/src/assets/locale/locale.constant-zh_CN.json @@ -11376,14 +11376,7 @@ "info": "信息", "main-dashboard": "主仪表板", "view-as": "以 {{ name }} 身份查看", - "estimate-wait-time": "预计等待时间约为 {{ time }}", "condition": "条件", - "step-reading-device-data": "正在读取设备数据…", - "step-analyzing-telemetry-attributes": "正在分析遥测和属性…", - "step-selecting-widgets": "正在为您的数据选择部件…", - "step-configuring-titles-units-ranges": "正在配置标题、单位和范围…", - "step-designing-layout": "正在设计布局…", - "step-arranging-widgets": "正在仪表板上排列部件…", "generate-dashboard": "生成仪表板", "generate-dashboard-with-ai": "使用 AI 生成仪表板", "no-telemetry-title": "未找到遥测数据", diff --git a/ui-ngx/src/assets/locale/locale.constant-zh_TW.json b/ui-ngx/src/assets/locale/locale.constant-zh_TW.json index 2f6ce3877c..aefa508c98 100644 --- a/ui-ngx/src/assets/locale/locale.constant-zh_TW.json +++ b/ui-ngx/src/assets/locale/locale.constant-zh_TW.json @@ -13309,14 +13309,7 @@ "info": "資訊", "main-dashboard": "主要儀表板", "view-as": "以「{{ name }}」的身分檢視", - "estimate-wait-time": "預計等待時間約為 {{ time }}", "condition": "條件", - "step-reading-device-data": "正在讀取裝置資料…", - "step-analyzing-telemetry-attributes": "正在分析遙測與屬性…", - "step-selecting-widgets": "正在為您的資料選擇小工具…", - "step-configuring-titles-units-ranges": "正在設定標題、單位與範圍…", - "step-designing-layout": "正在設計版面配置…", - "step-arranging-widgets": "正在配置儀表板上的小工具…", "generate-dashboard": "產生儀表板", "generate-dashboard-with-ai": "使用 AI 產生儀表板", "no-telemetry-title": "找不到遙測資料", diff --git a/ui-ngx/src/assets/solution-creator/building-animated.webp b/ui-ngx/src/assets/solution-creator/building-animated.webp deleted file mode 100644 index 67732c5496..0000000000 Binary files a/ui-ngx/src/assets/solution-creator/building-animated.webp and /dev/null differ diff --git a/ui-ngx/src/assets/solution-creator/catch-animated.webp b/ui-ngx/src/assets/solution-creator/catch-animated.webp deleted file mode 100644 index e517b836e1..0000000000 Binary files a/ui-ngx/src/assets/solution-creator/catch-animated.webp and /dev/null differ diff --git a/ui-ngx/src/assets/solution-creator/dashboard-animated.webp b/ui-ngx/src/assets/solution-creator/dashboard-animated.webp deleted file mode 100644 index f35d6f58bf..0000000000 Binary files a/ui-ngx/src/assets/solution-creator/dashboard-animated.webp and /dev/null differ diff --git a/ui-ngx/src/assets/solution-creator/forest-animated.webp b/ui-ngx/src/assets/solution-creator/forest-animated.webp deleted file mode 100644 index cb28cd0a55..0000000000 Binary files a/ui-ngx/src/assets/solution-creator/forest-animated.webp and /dev/null differ diff --git a/ui-ngx/src/assets/solution-creator/parachute-animated.webp b/ui-ngx/src/assets/solution-creator/parachute-animated.webp deleted file mode 100644 index bc72498d9b..0000000000 Binary files a/ui-ngx/src/assets/solution-creator/parachute-animated.webp and /dev/null differ diff --git a/ui-ngx/src/assets/solution-creator/rocket-animated.webp b/ui-ngx/src/assets/solution-creator/rocket-animated.webp deleted file mode 100644 index 3b51c62ae3..0000000000 Binary files a/ui-ngx/src/assets/solution-creator/rocket-animated.webp and /dev/null differ diff --git a/ui-ngx/src/styles.scss b/ui-ngx/src/styles.scss index 29336612ca..40b9c09f32 100644 --- a/ui-ngx/src/styles.scss +++ b/ui-ngx/src/styles.scss @@ -1127,16 +1127,6 @@ tb-entities-table.white-background { } } - // The agent wizards are opened under the 'tb-agent-wizard-dialog' panelClass and size - // themselves, so the surface must not impose its own min-width floor on small displays. - .tb-agent-wizard-dialog { - .mat-mdc-dialog-surface, - .mdc-dialog__surface { - min-width: 0 !important; - max-width: 95vw !important; - } - } - .tb-fullscreen-dialog-gt-xs { @media #{$mat-gt-xs} { min-height: 100%; diff --git a/ui-ngx/src/theme/ai-theme.scss b/ui-ngx/src/theme/ai-theme.scss index d7e3c12f69..9f3be8d762 100644 --- a/ui-ngx/src/theme/ai-theme.scss +++ b/ui-ngx/src/theme/ai-theme.scss @@ -475,8 +475,32 @@ } } -.mat-mdc-tooltip.tb-ai-cursor-tooltip { - translate: -12px 30px; +@keyframes tb-ai-tip-in { + from { + opacity: 0; + } + to { + opacity: 1; + } +} + +@keyframes tb-ai-tip-out { + from { + opacity: 1; + } + to { + opacity: 0; + } +} + +.mat-mdc-tooltip.tb-ai-tip { + &.mat-mdc-tooltip-show { + animation: tb-ai-tip-in 100ms ease-out forwards; + } + + &.mat-mdc-tooltip-hide { + animation: tb-ai-tip-out 60ms ease-in forwards; + } } @mixin tb-ai-kbd { @@ -2199,6 +2223,48 @@ code.k-ent[data-pal="solution"] .k-ent-ic { color: var(--entity-solution-fg); } } } +@container k-chat (max-width: 400px) { + .tb-ai-composer .composer-foot:has(.cred.near, .cred.over) .composer-auto .label { + display: none; + } +} + +@container k-chat (max-width: 340px) { + .tb-ai-composer .cred:has(.cred-topup) .cred-line { + display: none; + } +} + +.tb-ai-composer.docked .composer-auto { + gap: 0; + + .label { + position: absolute; + width: 1px; + height: 1px; + overflow: hidden; + clip: rect(0 0 0 0); + white-space: nowrap; + } +} + +@container k-chat (max-width: 560px) { + tb-ai-action-detail.k-detail table.k-hist { + :is(th, td) { + padding-right: 8px; + } + + :is(th, td):last-child { + padding-right: 0; + } + + td.c, + .tb-spark { + width: 56px; + } + } +} + @container k-chat (max-width: 560px) { .k-fields { grid-template-columns: minmax(0, 1fr); @@ -2565,6 +2631,9 @@ code.k-ent[data-pal="solution"] .k-ent-ic { color: var(--entity-solution-fg); } } .k-optbody { + min-width: 0; + overflow-wrap: anywhere; + b { display: block; font-size: 15px; @@ -4160,6 +4229,26 @@ cursor: pointer; font-weight: 400; vertical-align: 1px; } + +.composer-ghost-end { + white-space: nowrap; + } + + &.tight { + display: flex; + align-items: center; + white-space: nowrap; + + > span { + min-width: 0; + overflow: hidden; + text-overflow: ellipsis; + } + + > kbd { + flex: none; + } + } } .tb-ai-sr-only { @@ -4536,10 +4625,10 @@ cursor: pointer; gap: 8px; .ob-chip { - height: calc(var(--chat-control) + 2px); + height: var(--chat-control); padding: 0 14px; font-size: var(--chat-line); - line-height: var(--chat-control); + line-height: calc(var(--chat-control) - 2px); &[aria-pressed="true"] { border-color: var(--ai-selected); @@ -5168,6 +5257,7 @@ tb-ai-action-detail.k-detail { font-family: var(--tb-font); .k-detail-recs, + .k-detail-facts.capped, .k-tels, .k-made, .k-detail-links { @@ -5380,6 +5470,7 @@ tb-ai-action-detail.k-detail { } .k-hist { + max-width: 100%; margin-top: 10px; border-collapse: collapse; font-size: var(--chat-line); @@ -5455,7 +5546,7 @@ tb-ai-action-detail.k-detail { } td.q { - white-space: nowrap; + min-width: 9ch; font-variant-numeric: tabular-nums; color: var(--tb-text-secondary); }