Browse Source

Fixed agent wizards and the edge instructions dialog not scrolling on mobile (#16809)

* Unified agent dialogs layout and fixed scroll issues in edge instructions dialog

* Fixed agent wizards review issues: config step check, embedded layout, shared step constants

* Fixed agent dialogs review issues: wide dialog width, fullscreen event progress, host binding

* Fixed PR comments

* Fixed PR comments

* Fixed PR comments: wide uninstall dialog, compose editor/diff heights, unused stepper ViewChild

* Used the shared agent color variables in the compose editor and diff, merged duplicate host-context blocks in the wizard dialog mixin

---------

Co-authored-by: Vladyslav_Prykhodko <vprykhodko@thingsboard.io>
pull/16870/head
Maksym Tsymbarov 2 days ago
committed by GitHub
parent
commit
697104c8e8
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 5
      ui-ngx/src/app/modules/home/components/agent/_agent-shared.scss
  2. 32
      ui-ngx/src/app/modules/home/components/agent/agent-deploy-status.component.scss
  3. 4
      ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.scss
  4. 11
      ui-ngx/src/app/modules/home/components/agent/component/agent-compose-diff.component.ts
  5. 6
      ui-ngx/src/app/modules/home/components/agent/component/agent-compose-editor.component.scss
  6. 59
      ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.html
  7. 9
      ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.scss
  8. 3
      ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.component.ts
  9. 2
      ui-ngx/src/app/modules/home/components/agent/dialog/agent-auto-provision-dialog.service.ts
  10. 284
      ui-ngx/src/app/modules/home/components/agent/wizard/_agent-wizard.scss
  11. 601
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.html
  12. 10
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.scss
  13. 87
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.ts
  14. 22
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard-dialog.ts
  15. 5
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss
  16. 1
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.ts
  17. 72
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html
  18. 2
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.scss
  19. 14
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.ts
  20. 294
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html
  21. 2
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.scss
  22. 35
      ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.ts
  23. 3
      ui-ngx/src/app/modules/home/pages/agent/agent-app-profile.component.ts
  24. 13
      ui-ngx/src/app/modules/home/pages/agent/agent-app-profiles-table-config.resolver.ts
  25. 46
      ui-ngx/src/app/modules/home/pages/agent/agent-application.component.ts
  26. 54
      ui-ngx/src/app/modules/home/pages/agent/agent-applications-table-config.resolver.ts
  27. 31
      ui-ngx/src/app/modules/home/pages/agent/agent-deploy-dialog.service.ts
  28. 13
      ui-ngx/src/app/modules/home/pages/agent/agent-executions-side-panel.component.ts
  29. 11
      ui-ngx/src/app/modules/home/pages/agent/agent-install-instructions-dialog.component.scss
  30. 2
      ui-ngx/src/app/modules/home/pages/agent/agent-profile-create-dialog.service.ts
  31. 32
      ui-ngx/src/app/modules/home/pages/agent/agent-profile-created-dialog.component.html
  32. 49
      ui-ngx/src/app/modules/home/pages/agent/agent-profile-created-dialog.component.scss
  33. 5
      ui-ngx/src/app/modules/home/pages/agent/agent-profile-merged-profiles.component.ts
  34. 2
      ui-ngx/src/app/modules/home/pages/agent/agent-profiles-table-config.resolver.ts
  35. 2
      ui-ngx/src/app/modules/home/pages/agent/agents-table-config.resolver.ts
  36. 30
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-assign-compare-dialog.component.html
  37. 2
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-assign-compare-dialog.component.scss
  38. 15
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-event-progress-dialog.component.html
  39. 53
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-event-progress-dialog.component.scss
  40. 41
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-profile-upgrade-dialog.component.html
  41. 2
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-profile-upgrade-dialog.component.scss
  42. 18
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-version-warning-dialog.component.html
  43. 53
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-version-warning-dialog.component.scss
  44. 9
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-assign-profile-dialog.component.scss
  45. 15
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-assign-profile-dialog.component.ts
  46. 11
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-bulk-action-dialog.component.scss
  47. 63
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-preset-dialog.component.html
  48. 45
      ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-preset-dialog.component.scss
  49. 13
      ui-ngx/src/app/modules/home/pages/agent/table/abstract-agent-app-event-table-config.ts
  50. 2
      ui-ngx/src/app/modules/home/pages/agent/util/agent-app-event-progress.ts
  51. 2
      ui-ngx/src/app/modules/home/pages/agent/util/agent-version-warnings.ts
  52. 23
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard-dialog.ts
  53. 348
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.html
  54. 2
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.scss
  55. 25
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.ts
  56. 26
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-wizard.models.ts
  57. 68
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.html
  58. 27
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.scss
  59. 21
      ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.ts
  60. 48
      ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.html
  61. 18
      ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.scss
  62. 33
      ui-ngx/src/app/modules/home/pages/edge/edge.component.ts
  63. 16
      ui-ngx/src/app/modules/home/pages/edge/edges-table-config.resolver.ts
  64. 10
      ui-ngx/src/styles.scss

5
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; }
}
}

32
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);

4
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 {

11
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();
});
}

6
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; }
}
}

59
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
-->
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<div class="tb-install-wizard-toolbar-content">
<h2>{{ titleKey | translate }}</h2>
</div>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2>{{ titleKey | translate }}</h2>
<span class="flex-1"></span>
<div tb-help="agentProfileAutoProvision"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
<div mat-dialog-content class="tb-install-wizard-body">
<mat-stepper linear #stepper [labelPosition]="(stepperLabelPosition | async)">
<div mat-dialog-content>
<mat-stepper linear #stepper [labelPosition]="(stepperLabelPosition | async)"
(selectionChange)="selectedIndex = $event.selectedIndex">
<mat-step [completed]="canProceed()"
[label]="stepSelectKey | translate">
@ -98,16 +97,6 @@
}
</div>
</form>
<div class="step-footer">
<button mat-button type="button" (click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button color="primary" type="button"
[disabled]="!canProceed() || loading"
(click)="proceedToScript()">
<span>{{ 'action.next' | translate }}</span>
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
</div>
</mat-step>
<mat-step [label]="stepScriptKey | translate">
@ -146,16 +135,30 @@
<span translate>edge.auto-provision-no-script</span>
</div>
}
<div class="step-footer">
<button mat-button type="button" (click)="cancel()">{{ 'action.close' | translate }}</button>
<button mat-raised-button color="primary" type="button" (click)="goToProfile()">
<mat-icon>open_in_new</mat-icon>
<span translate>agent.go-to-profile</span>
</button>
</div>
</mat-step>
</mat-stepper>
</div>
<div mat-dialog-actions>
@if (selectedIndex === 0) {
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end">
<button mat-stroked-button
color="primary"
[disabled]="!canProceed() || loading"
(click)="proceedToScript()">{{ 'action.next-with-label' | translate: { label: (stepScriptKey | translate) } }}</button>
</div>
<mat-divider class="w-full"></mat-divider>
}
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2">
<button mat-button
(click)="cancel()">{{ (selectedIndex === 0 ? 'action.cancel' : 'action.close') | translate }}</button>
@if (selectedIndex > 0) {
<button mat-raised-button
color="primary"
(click)="goToProfile()">
<mat-icon>open_in_new</mat-icon>
<span translate>agent.go-to-profile</span>
</button>
}
</div>
</div>

9
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;

3
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, AgentProfileAssignProfileDialogData, string[]>(
AgentProfileAssignProfileDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: { selectedIds, lockedAppType: this.appType }
}
).afterClosed();

2
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, AgentAutoProvisionDialogData, boolean>(
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();

284
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
// <gutterWidth>). 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 <div>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;
}

601
ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-flow.component.html

@ -5,28 +5,33 @@
-->
@if (!embedded) {
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<mat-toolbar color="tb-primary" class="tb-bottom-border">
@if (showBack) {
<button mat-icon-button (click)="back.emit()" type="button" tabindex="-1">
<mat-icon>arrow_back</mat-icon>
<button mat-icon-button (click)="back.emit()" type="button">
<mat-icon class="material-icons">arrow_back</mat-icon>
</button>
}
<div class="tb-install-wizard-toolbar-content">
<h2>{{ 'agent.app-install-title' | translate }}@if (agent) {:}</h2>
@if (agent) {
<span class="flex-1">
{{ 'agent.app-install-on-agent' | translate: { name: agent?.name } }}
</span>
}
</div>
<h2>{{ 'agent.app-install-title' | translate }}@if (agent) {: {{ 'agent.app-install-on-agent' | translate: { name: agent?.name } }}}</h2>
<span class="flex-1"></span>
<div [tb-help]="helpLinkId"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
}
@if (embedded) {
<ng-container [ngTemplateOutlet]="body"></ng-container>
<ng-container [ngTemplateOutlet]="actions"></ng-container>
} @else {
<div mat-dialog-content>
<ng-container [ngTemplateOutlet]="body"></ng-container>
</div>
<div mat-dialog-actions>
<ng-container [ngTemplateOutlet]="actions"></ng-container>
</div>
}
<div mat-dialog-content class="tb-install-wizard-body" [class.tb-install-wizard-embedded]="embedded">
<ng-template #body>
@if (checkingManaged) {
<div class="loading-state">
@ -35,7 +40,7 @@
}
@if (!checkingManaged && managedApp) {
<div class="managed-block">
<div class="managed-block p-6">
<tb-agent-deploy-status
[agent]="managedAgent"
[application]="managedApp"
@ -43,17 +48,11 @@
(goToAgentApplication)="goToAgentApplication()"
(goToAgentEvents)="goToAgentEvents()">
</tb-agent-deploy-status>
<div class="step-footer">
<span class="flex-1"></span>
@if (!embedded) {
<button mat-button (click)="cancel()">{{ 'action.close' | translate }}</button>
}
</div>
</div>
}
@if (selectAgent && !embedded && !checkingManaged && !managedApp) {
<div class="tb-form-hint tb-primary-fill mb-4">
<div class="tb-form-hint tb-primary-fill mx-6 mt-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.deploy-via-agent-desc</span>
</div>
@ -62,302 +61,292 @@
@if (!checkingManaged && !managedApp) {
<mat-stepper linear #stepper
[class.tb-steps-locked]="!!installedApplication"
(selectionChange)="selectedIndex = $event.selectedIndex"
[orientation]="(stepperOrientation | async)"
[labelPosition]="(stepperLabelPosition | async)">
@if (selectAgent) {
<mat-step [label]="'agent.deploy-select-agent-step' | translate"
[completed]="canProceedFromAgent()"
[editable]="!installedApplication">
<p class="hint" translate>agent.deploy-intro</p>
<tb-agent-autocomplete
[ngModel]="agent"
(ngModelChange)="onSelectedAgentChange($event)">
</tb-agent-autocomplete>
<div class="step-footer">
<button mat-raised-button color="primary" matStepperNext [disabled]="!canProceedFromAgent()">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
</div>
</mat-step>
}
@if (!lockedType) {
<mat-step [label]="'agent.app-install-step1' | translate">
<p class="hint" translate>agent.app-install-pick-type</p>
<div class="type-cards">
@for (card of typeCards; track card.type) {
<button type="button" class="type-card"
[class.selected]="selectedType === card.type"
[disabled]="isTypeDisabled(card.type)"
[attr.aria-pressed]="selectedType === card.type"
(click)="selectType(card.type)">
<mat-icon>{{ card.icon }}</mat-icon>
<h4>{{ card.labelKey | translate }}</h4>
<p>{{ (unavailableTypes.has(card.type) ? 'agent.app-type-unavailable' : card.descKey) | translate }}</p>
</button>
}
</div>
@if (loadingTemplate) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-install-loading-template</span>
</div>
@for (step of steps; track step) {
@switch (step) {
@case ('agent') {
<mat-step [label]="stepLabels[step] | translate"
[completed]="canProceedFromAgent()"
[editable]="!installedApplication">
<p class="hint" translate>agent.deploy-intro</p>
<tb-agent-autocomplete
[ngModel]="agent"
(ngModelChange)="onSelectedAgentChange($event)">
</tb-agent-autocomplete>
</mat-step>
}
@if (loadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
</div>
@case ('type') {
<mat-step [label]="stepLabels[step] | translate" [completed]="canProceedFromType()">
<p class="hint" translate>agent.app-install-pick-type</p>
<div class="type-cards">
@for (card of typeCards; track card.type) {
<button type="button" class="type-card"
[class.selected]="selectedType === card.type"
[disabled]="isTypeDisabled(card.type)"
[attr.aria-pressed]="selectedType === card.type"
(click)="selectType(card.type)">
<mat-icon>{{ card.icon }}</mat-icon>
<h4>{{ card.labelKey | translate }}</h4>
<p>{{ (unavailableTypes.has(card.type) ? 'agent.app-type-unavailable' : card.descKey) | translate }}</p>
</button>
}
</div>
@if (loadingTemplate) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-install-loading-template</span>
</div>
}
@if (loadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
</div>
}
</mat-step>
}
<div class="step-footer">
@if (selectAgent) {
<button mat-button matStepperPrevious>
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
}
<button mat-raised-button color="primary" matStepperNext [disabled]="!canProceedFromType()">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
</div>
</mat-step>
}
<mat-step [label]="'agent.app-install-step3' | translate" [editable]="!installedApplication">
<div class="config-toggle">
<tb-toggle-select [(ngModel)]="useProfile" (ngModelChange)="toggleUseProfile($event)" appearance="fill" disablePagination>
<tb-toggle-option [value]="true">{{ 'agent.app-install-from-profile' | translate }}</tb-toggle-option>
<tb-toggle-option [value]="false">{{ 'agent.app-install-custom-config' | translate }}</tb-toggle-option>
</tb-toggle-select>
</div>
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-install-name</mat-label>
<input matInput [(ngModel)]="appName" required>
</mat-form-field>
@if (canHaveRelatedEntity) {
<tb-agent-related-entity-autocomplete
[appType]="selectedType"
[disabled]="!!lockedRelatedEntity"
[required]="relatedEntityRequired"
allowCreate
[ngModel]="relatedEntityId"
(ngModelChange)="relatedEntityId = $event; onRelatedEntityChange($event)"
(relatedEntityNameChange)="onRelatedEntityName($event)">
</tb-agent-related-entity-autocomplete>
}
@if (useProfile && typesWithoutTemplates.has(selectedType)) {
<div class="tb-form-hint tb-primary-fill tb-form-hint-warning mb-4">
<mat-icon>warning_amber</mat-icon>
<span translate>agent.app-no-templates</span>
</div>
}
@if (useProfile) {
<mat-form-field class="mat-block" appearance="outline" [formGroup]="profileSelectFormGroup">
<mat-label translate>agent.app-install-select-profile</mat-label>
<input matInput type="text" required
#profileInput
formControlName="profile"
[matAutocomplete]="profileAutocomplete">
@if (profileSelectFormGroup.get('profile').value) {
<button type="button"
matSuffix mat-icon-button aria-label="Clear"
(click)="clearProfile()">
<mat-icon class="material-icons">close</mat-icon>
</button>
}
@if (!profileSelectFormGroup.get('profile').value && canCreateProfileForType) {
<button
mat-button color="primary" matSuffix type="button"
(mousedown)="$event.preventDefault()"
(click)="createProfile($event)">
<span style="white-space: nowrap">{{ 'agent.deploy-create-new' | translate }}</span>
</button>
}
<mat-autocomplete class="tb-autocomplete"
#profileAutocomplete="matAutocomplete"
[displayWith]="displayProfileFn">
@if (filteredProfiles | async; as profiles) {
@for (p of profiles; track trackKey(p)) {
<mat-option [value]="p" class="tb-profile-option"
[matTooltip]="isVirtualProfile(p) ? ('agent.app-install-virtual-profile-hint' | translate) : ''"
matTooltipPosition="right">
<span>{{ p.name }}</span>
@if (isVirtualProfile(p)) {
<span class="tb-virtual-profile-badge">{{ 'agent.app-install-virtual-profile-badge' | translate }}</span>
}
@if (!isVirtualProfile(p) && p.templateVersion) {
<span class="tb-profile-template-version">{{ profileTemplateLabel(p) }}</span>
@case ('config') {
<mat-step [label]="stepLabels[step] | translate" [completed]="canSubmit() || !!installedApplication"
[editable]="!installedApplication">
<div class="config-toggle">
<tb-toggle-select class="xs:w-full" [(ngModel)]="useProfile" (ngModelChange)="toggleUseProfile($event)" appearance="fill" disablePagination>
<tb-toggle-option [value]="true">{{ 'agent.app-install-from-profile' | translate }}</tb-toggle-option>
<tb-toggle-option [value]="false">{{ 'agent.app-install-custom-config' | translate }}</tb-toggle-option>
</tb-toggle-select>
</div>
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-install-name</mat-label>
<input matInput [(ngModel)]="appName" required>
</mat-form-field>
@if (canHaveRelatedEntity) {
<tb-agent-related-entity-autocomplete
[appType]="selectedType"
[disabled]="!!lockedRelatedEntity"
[required]="relatedEntityRequired"
allowCreate
[ngModel]="relatedEntityId"
(ngModelChange)="relatedEntityId = $event; onRelatedEntityChange($event)"
(relatedEntityNameChange)="onRelatedEntityName($event)">
</tb-agent-related-entity-autocomplete>
}
@if (useProfile && typesWithoutTemplates.has(selectedType)) {
<div class="tb-form-hint tb-primary-fill tb-form-hint-warning mb-4">
<mat-icon>warning_amber</mat-icon>
<span translate>agent.app-no-templates</span>
</div>
}
@if (useProfile) {
<mat-form-field class="mat-block" appearance="outline" [formGroup]="profileSelectFormGroup">
<mat-label translate>agent.app-install-select-profile</mat-label>
<input matInput type="text" required
#profileInput
formControlName="profile"
[matAutocomplete]="profileAutocomplete">
@if (profileSelectFormGroup.get('profile').value) {
<button type="button"
matSuffix mat-icon-button aria-label="Clear"
(click)="clearProfile()">
<mat-icon class="material-icons">close</mat-icon>
</button>
}
@if (!profileSelectFormGroup.get('profile').value && canCreateProfileForType) {
<button
mat-button color="primary" matSuffix type="button"
(mousedown)="$event.preventDefault()"
(click)="createProfile($event)">
<span style="white-space: nowrap">{{ 'agent.deploy-create-new' | translate }}</span>
</button>
}
<mat-autocomplete class="tb-autocomplete"
#profileAutocomplete="matAutocomplete"
[displayWith]="displayProfileFn">
@if (filteredProfiles | async; as profiles) {
@for (p of profiles; track trackKey(p)) {
<mat-option [value]="p" class="tb-profile-option"
[matTooltip]="isVirtualProfile(p) ? ('agent.app-install-virtual-profile-hint' | translate) : ''"
matTooltipPosition="right">
<span>{{ p.name }}</span>
@if (isVirtualProfile(p)) {
<span class="tb-virtual-profile-badge">{{ 'agent.app-install-virtual-profile-badge' | translate }}</span>
}
@if (!isVirtualProfile(p) && p.templateVersion) {
<span class="tb-profile-template-version">{{ profileTemplateLabel(p) }}</span>
}
</mat-option>
}
@if (!profiles.length) {
<mat-option [value]="null" disabled class="tb-not-found">
<div class="tb-not-found-content">
<span translate>agent.app-install-no-profiles</span>
</div>
</mat-option>
}
}
</mat-option>
</mat-autocomplete>
</mat-form-field>
}
@if (loadingProfiles) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-install-loading-template</span>
</div>
}
<tb-agent-app-step-inputs [bindings]="bindings"></tb-agent-app-step-inputs>
@if (useProfile && selectedProfile && !isVirtualProfile(selectedProfile)) {
<div class="tb-compare-actions">
<button mat-stroked-button color="primary" type="button" (click)="openEditProfile()">
<mat-icon>edit</mat-icon>
<span>{{ 'agent.app-update-edit-profile' | translate }}</span>
</button>
</div>
}
@if (useProfile && selectedProfile) {
<mat-expansion-panel class="tb-compose-panel">
<mat-expansion-panel-header>
<mat-panel-title translate>agent.app-install-yaml</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<tb-agent-compose-editor [value]="composeYaml" [readOnly]="useProfile && !!selectedProfile"></tb-agent-compose-editor>
</ng-template>
</mat-expansion-panel>
}
@if (mergeError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ mergeError }}</span>
</div>
}
@if (!useProfile && !template && loadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
</div>
} @else if (!useProfile) {
@if (composeTypeKeys.length > 1) {
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-compose-template-select</mat-label>
<mat-select [value]="composeType" (selectionChange)="onComposeTypeChange($event.value)">
@for (key of composeTypeKeys; track key) {
<mat-option [value]="key">
{{ composeTypeLabel(key) }}
</mat-option>
}
</mat-select>
</mat-form-field>
}
@if (!profiles.length) {
<mat-option [value]="null" disabled class="tb-not-found">
<div class="tb-not-found-content">
<span translate>agent.app-install-no-profiles</span>
</div>
</mat-option>
@if (relatedEntityId) {
<div class="tb-form-hint tb-primary-fill mb-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-compose-creds-overridden-hint</span>
</div>
}
<div class="diff-header-row">
<div class="diff-header added" translate>agent.app-install-diff-template</div>
<div class="diff-header removed" translate>agent.app-install-diff-editable</div>
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml" [syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-install-diff-hint</p>
}
</mat-autocomplete>
</mat-form-field>
}
@if (loadingProfiles) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-install-loading-template</span>
</div>
}
<tb-agent-app-step-inputs [bindings]="bindings"></tb-agent-app-step-inputs>
@if (useProfile && selectedProfile && !isVirtualProfile(selectedProfile)) {
<div class="tb-compare-actions">
<button mat-stroked-button color="primary" type="button" (click)="openEditProfile()">
<mat-icon>edit</mat-icon>
<span>{{ 'agent.app-update-edit-profile' | translate }}</span>
</button>
</div>
}
@if (useProfile && selectedProfile) {
<mat-expansion-panel class="tb-compose-panel">
<mat-expansion-panel-header>
<mat-panel-title translate>agent.app-install-yaml</mat-panel-title>
</mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<tb-agent-compose-editor [value]="composeYaml" [readOnly]="useProfile && !!selectedProfile"></tb-agent-compose-editor>
</ng-template>
</mat-expansion-panel>
}
@if (mergeError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ mergeError }}</span>
</div>
}
@if (!useProfile && !template && loadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
</div>
} @else if (!useProfile) {
@if (composeTypeKeys.length > 1) {
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-compose-template-select</mat-label>
<mat-select [value]="composeType" (selectionChange)="onComposeTypeChange($event.value)">
@for (key of composeTypeKeys; track key) {
<mat-option [value]="key">
{{ composeTypeLabel(key) }}
</mat-option>
</mat-step>
}
@case ('summary') {
<mat-step [label]="stepLabels[step] | translate" [completed]="!!installedApplication"
[editable]="!installedApplication">
<div class="summary-card">
<div class="summary-row">
<span class="label" translate>agent.app-name</span>
<span class="value">{{ appName }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-type</span>
<span class="value"><span class="tb-type-badge"
[class.edge]="selectedType === 'EDGE'"
[class.gateway]="selectedType === 'GATEWAY'"
[class.generic]="selectedType === 'GENERIC'">{{ selectedType }}</span></span>
</div>
@if (template) {
<div class="summary-row">
<span class="label" translate>agent.app-template</span>
<span class="value">{{ template.appType }} {{ template.currentVersion }}</span>
</div>
}
</mat-select>
</mat-form-field>
@if (useProfile && selectedProfile) {
<div class="summary-row">
<span class="label" translate>agent.app-install-select-profile</span>
<span class="value">{{ selectedProfile.name }}</span>
</div>
}
@if (agent) {
<div class="summary-row">
<span class="label" translate>agent.agents</span>
<span class="value">{{ agent.name }}</span>
</div>
}
</div>
<div class="tb-form-hint tb-primary-fill mb-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-install-confirm-info</span>
</div>
</mat-step>
}
@if (relatedEntityId) {
<div class="tb-form-hint tb-primary-fill mb-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-compose-creds-overridden-hint</span>
</div>
@case ('deploy') {
<mat-step [label]="stepLabels[step] | translate">
<tb-agent-deploy-status
[agent]="agent"
[application]="installedApplication"
(goToAgent)="goToAgent()"
(goToAgentApplication)="goToAgentApplication()"
(goToAgentEvents)="goToAgentEvents()">
</tb-agent-deploy-status>
</mat-step>
}
<div class="diff-header-row">
<div class="diff-header added" translate>agent.app-install-diff-template</div>
<div class="diff-header removed" translate>agent.app-install-diff-editable</div>
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml" [syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-install-diff-hint</p>
}
<div class="step-footer">
@if (!installedApplication) {
<button mat-button matStepperPrevious [disabled]="submitting">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
}
<button mat-raised-button color="primary" matStepperNext [disabled]="!canSubmit()">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
</div>
</mat-step>
<mat-step [label]="'agent.app-install-step4' | translate" [completed]="!!installedApplication"
[editable]="!installedApplication">
<div class="summary-card">
<div class="summary-row">
<span class="label" translate>agent.app-name</span>
<span class="value">{{ appName }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-type</span>
<span class="value"><span class="tb-type-badge"
[class.edge]="selectedType === 'EDGE'"
[class.gateway]="selectedType === 'GATEWAY'"
[class.generic]="selectedType === 'GENERIC'">{{ selectedType }}</span></span>
</div>
@if (template) {
<div class="summary-row">
<span class="label" translate>agent.app-template</span>
<span class="value">{{ template.appType }} {{ template.currentVersion }}</span>
</div>
}
@if (useProfile && selectedProfile) {
<div class="summary-row">
<span class="label" translate>agent.app-install-select-profile</span>
<span class="value">{{ selectedProfile.name }}</span>
</div>
}
@if (agent) {
<div class="summary-row">
<span class="label" translate>agent.agents</span>
<span class="value">{{ agent.name }}</span>
</div>
}
</div>
<div class="tb-form-hint tb-primary-fill mb-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-install-confirm-info</span>
</div>
<div class="step-footer">
@if (!installedApplication) {
<button mat-button matStepperPrevious [disabled]="submitting">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
}
@if (!installedApplication) {
<button mat-raised-button color="primary"
(click)="submit()" [disabled]="!canSubmit()">
<mat-icon>save</mat-icon>
<span>{{ 'agent.app-install-cta' | translate }}</span>
</button>
}
@if (installedApplication) {
<button mat-raised-button color="primary" matStepperNext>
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
}
</div>
</mat-step>
@if (selectAgent) {
<mat-step [label]="'agent.deploy-install-step' | translate">
<tb-agent-deploy-status
[agent]="agent"
[application]="installedApplication"
(goToAgent)="goToAgent()"
(goToAgentApplication)="goToAgentApplication()"
(goToAgentEvents)="goToAgentEvents()">
</tb-agent-deploy-status>
<div class="step-footer">
<span class="flex-1"></span>
@if (!embedded) {
<button mat-button (click)="cancel()">{{ 'action.close' | translate }}</button>
}
</div>
</mat-step>
}
</mat-stepper>
}
</div>
</ng-template>
<ng-template #actions>
@if (!checkingManaged && !managedApp && (canGoBack() || showNext())) {
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end">
@if (canGoBack()) {
<button mat-stroked-button
[disabled]="submitting"
(click)="stepper.previous()">{{ 'action.back' | translate }}</button>
}
<span class="flex-1"></span>
@if (showNext()) {
<button mat-stroked-button
color="primary"
[disabled]="!canGoNext()"
(click)="stepper.next()">{{ 'action.next-with-label' | translate: { label: (nextStepLabel() | translate) } }}</button>
}
</div>
@if (!embedded || canInstall()) {
<mat-divider class="w-full"></mat-divider>
}
}
@if (!embedded || canInstall()) {
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2">
@if (!embedded) {
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ (managedApp || installedApplication ? 'action.close' : 'action.cancel') | translate }}</button>
}
@if (canInstall()) {
<button mat-raised-button
color="primary"
[disabled]="currentStep() !== 'summary' || !canSubmit()"
(click)="submit()">{{ 'agent.app-install-cta' | translate }}</button>
}
</div>
}
</ng-template>

10
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;
}

87
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, AgentAppProfileWizardData, AgentAppProfile>(
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, AgentAppProfileWizardData, AgentAppProfile>(
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;
}
}

22
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<AgentAppInstallWizardResult> {
return dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
AgentAppInstallWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data
}
).afterClosed();
}

5
ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-install-wizard.component.scss

@ -1,5 +0,0 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use 'agent-wizard' as *;
@include wizard-chrome;

1
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]
})

72
ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-update-flow.component.html

@ -5,36 +5,28 @@
-->
@if (!embedded) {
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<mat-toolbar color="tb-primary" class="tb-bottom-border">
@if (showBack) {
<button mat-icon-button (click)="back.emit()" type="button" tabindex="-1">
<mat-icon>arrow_back</mat-icon>
<button mat-icon-button (click)="back.emit()" type="button">
<mat-icon class="material-icons">arrow_back</mat-icon>
</button>
}
<div class="tb-install-wizard-toolbar-content">
<h2>{{ 'agent.app-update-wizard-title' | translate }}@if (existingApplication) {
:
}</h2>
@if (existingApplication) {
<span class="flex-1">
{{ 'agent.app-update-on-app' | translate: { name: existingApplication?.name } }}
</span>
}
</div>
<h2>{{ 'agent.app-update-wizard-title' | translate }}@if (existingApplication) {: {{ 'agent.app-update-on-app' | translate: { name: existingApplication?.name } }}}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppUpdate"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
}
<div mat-dialog-content class="tb-install-wizard-body" [class.tb-install-wizard-embedded]="embedded">
<div mat-dialog-content>
<mat-stepper linear #stepper
(selectionChange)="selectedIndex = $event.selectedIndex"
[orientation]="(stepperOrientation | async)"
[labelPosition]="(stepperLabelPosition | async)">
<mat-step [label]="'agent.app-install-step3' | translate">
<mat-step [label]="'agent.app-install-step3' | translate" [completed]="canSubmit()">
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-install-name</mat-label>
@ -124,13 +116,6 @@
<tb-agent-compose-diff [left]="currentYaml" [right]="futureYaml" [readOnly]="readOnlyCompare" [syncScroll]="diffSyncScroll"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-update-compare-hint</p>
}
<div class="step-footer">
<button mat-raised-button color="primary" matStepperNext [disabled]="!canSubmit()">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
</div>
</mat-step>
<mat-step [label]="'agent.app-install-step4' | translate">
@ -171,18 +156,33 @@
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-install-confirm-info</span>
</div>
<div class="step-footer">
<button mat-button matStepperPrevious [disabled]="submitting">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
<button mat-raised-button color="primary" (click)="submit()" [disabled]="!canSubmit()">
<mat-icon>save</mat-icon>
<span>{{ 'agent.app-update-cta' | translate }}</span>
</button>
</div>
</mat-step>
</mat-stepper>
</div>
<div mat-dialog-actions>
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end">
@if (selectedIndex > 0) {
<button mat-stroked-button
[disabled]="submitting"
(click)="stepper.previous()">{{ 'action.back' | translate }}</button>
}
<span class="flex-1"></span>
@if (selectedIndex === 0) {
<button mat-stroked-button
color="primary"
[disabled]="!canSubmit()"
(click)="stepper.next()">{{ 'action.next-with-label' | translate: { label: ('agent.app-install-step4' | translate) } }}</button>
}
</div>
<mat-divider class="w-full"></mat-divider>
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2">
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button
color="primary"
[disabled]="selectedIndex !== 1 || !canSubmit()"
(click)="submit()">{{ 'agent.app-update-cta' | translate }}</button>
</div>
</div>

2
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;

14
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<AgentAppUpgradeResult | null>();
@Output() back = new EventEmitter<void>();
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, AgentAppProfileWizardData, AgentAppProfile>(
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();

294
ui-ngx/src/app/modules/home/components/agent/wizard/agent-app-upgrade-flow.component.html

@ -5,30 +5,21 @@
-->
@if (!embedded) {
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<mat-toolbar color="tb-primary" class="tb-bottom-border">
@if (showBack) {
<button mat-icon-button (click)="back.emit()" type="button" tabindex="-1">
<mat-icon>arrow_back</mat-icon>
<button mat-icon-button (click)="back.emit()" type="button">
<mat-icon class="material-icons">arrow_back</mat-icon>
</button>
}
<div class="tb-install-wizard-toolbar-content">
<h2>{{ 'agent.app-upgrade-title' | translate }}@if (existingApplication) {
:
}</h2>
@if (existingApplication) {
<span class="flex-1">
{{ 'agent.app-upgrade-heading' | translate: { name: existingApplication?.name, from: fromVersion || '—', to: toVersion || '—' } }}
</span>
}
</div>
<h2>{{ 'agent.app-upgrade-title' | translate }}@if (existingApplication) {: {{ 'agent.app-upgrade-heading' | translate: { name: existingApplication?.name, from: fromVersion || '—', to: toVersion || '—' } }}}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppUpgrade"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
}
<div mat-dialog-content class="tb-install-wizard-body" [class.tb-install-wizard-embedded]="embedded">
<div mat-dialog-content>
@if (loadingTemplate || loadingProfile) {
<div class="loading-state">
@ -45,143 +36,154 @@
@if (!(loadingTemplate || loadingProfile || loadError)) {
<mat-stepper linear #stepper
(selectionChange)="selectedIndex = $event.selectedIndex"
[orientation]="(stepperOrientation | async)"
[labelPosition]="(stepperLabelPosition | async)">
@if (showProfileUpgradeStep) {
<mat-step [label]="'agent.app-upgrade-profile-step' | translate"
[completed]="profileUpgraded">
@if (loadingProfile) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-upgrade-profile-loading</span>
</div>
@for (step of steps; track step) {
@switch (step) {
@case ('profile') {
<mat-step [label]="stepLabels[step] | translate"
[completed]="profileUpgraded">
@if (loadingProfile) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-upgrade-profile-loading</span>
</div>
}
@if (!loadingProfile && profileLoadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ profileLoadError }}</span>
</div>
}
@if (!loadingProfile && !profileLoadError && profile && template) {
<div class="summary-card" style="margin-bottom: 16px;">
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-profile-name</span>
<span class="value">{{ profile.name }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-summary-versions</span>
<span class="value">{{ fromVersion || '—' }} → {{ toVersion || '—' }}</span>
</div>
</div>
<p class="hint" translate>agent.app-upgrade-profile-hint</p>
<div class="diff-header-row">
<div class="diff-header added">
{{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }}
</div>
<div class="diff-header removed" translate>agent.app-upgrade-profile-current</div>
@if (profileUpgraded) {
<div class="diff-readonly-chip">
<mat-icon>lock</mat-icon>
<span translate>agent.app-diff-read-only</span>
</div>
}
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="profileProposedYaml" [right]="profileCurrentYaml" [readOnly]="profileUpgraded" [syncScroll]="diffSyncScroll" (rightChange)="profileComposeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-upgrade-diff-hint</p>
}
</mat-step>
}
@if (!loadingProfile && profileLoadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ profileLoadError }}</span>
</div>
@case ('config') {
<mat-step [label]="stepLabels[step] | translate" [completed]="canSubmit()">
@if (canHaveRelatedEntity && isProfileBoundUpgrade) {
<tb-agent-related-entity-autocomplete
[appType]="selectedType || existingApplication?.appType"
[disabled]="!!lockedRelatedEntity"
[required]="relatedEntityRequired"
[ngModel]="relatedEntityId"
(ngModelChange)="relatedEntityId = $event">
</tb-agent-related-entity-autocomplete>
}
<tb-agent-app-step-inputs [bindings]="bindings"></tb-agent-app-step-inputs>
@if (!isProfileBoundUpgrade) {
<div class="diff-header-row">
<div class="diff-header added">
{{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }}
</div>
<div class="diff-header removed" translate>agent.app-upgrade-current</div>
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml" [syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-upgrade-diff-hint</p>
}
</mat-step>
}
@if (!loadingProfile && !profileLoadError && profile && template) {
<div class="summary-card" style="margin-bottom: 16px;">
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-profile-name</span>
<span class="value">{{ profile.name }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-summary-versions</span>
<span class="value">{{ fromVersion || '—' }} → {{ toVersion || '—' }}</span>
@case ('summary') {
<mat-step [label]="stepLabels[step] | translate">
<div class="summary-card">
<div class="summary-row">
<span class="label" translate>agent.app-name</span>
<span class="value">{{ appName }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-summary-versions</span>
<span class="value">{{ fromVersion || '—' }} → {{ toVersion || '—' }}</span>
</div>
@if (hasBackupVolumeInput) {
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-summary-volumes-label</span>
<span class="value">
{{ 'agent.app-upgrade-summary-volumes' | translate: { count: selectedBackupVolumeCount } }}
</span>
</div>
}
</div>
</div>
<p class="hint" translate>agent.app-upgrade-profile-hint</p>
<div class="diff-header-row">
<div class="diff-header added">
{{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }}
<div class="tb-form-hint tb-primary-fill mb-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-upgrade-rollback-info</span>
</div>
<div class="diff-header removed" translate>agent.app-upgrade-profile-current</div>
@if (profileUpgraded) {
<div class="diff-readonly-chip">
<mat-icon>lock</mat-icon>
<span translate>agent.app-diff-read-only</span>
</div>
}
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="profileProposedYaml" [right]="profileCurrentYaml" [readOnly]="profileUpgraded" [syncScroll]="diffSyncScroll" (rightChange)="profileComposeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-upgrade-diff-hint</p>
</mat-step>
}
<div class="step-footer">
@if (!profileUpgraded) {
<button mat-raised-button color="primary"
(click)="submitProfileUpgrade()"
[disabled]="!canSubmitProfileUpgrade()"
>
<mat-icon>upgrade</mat-icon>
<span>{{ 'agent.app-upgrade-profile-cta' | translate }}</span>
</button>
}
@if (profileUpgraded) {
<button mat-raised-button color="primary" matStepperNext>
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
}
</div>
</mat-step>
}
<mat-step [label]="'agent.app-install-step3' | translate">
@if (canHaveRelatedEntity && isProfileBoundUpgrade) {
<tb-agent-related-entity-autocomplete
[appType]="selectedType || existingApplication?.appType"
[disabled]="!!lockedRelatedEntity"
[required]="relatedEntityRequired"
[ngModel]="relatedEntityId"
(ngModelChange)="relatedEntityId = $event">
</tb-agent-related-entity-autocomplete>
}
<tb-agent-app-step-inputs [bindings]="bindings"></tb-agent-app-step-inputs>
@if (!isProfileBoundUpgrade) {
<div class="diff-header-row">
<div class="diff-header added">
{{ 'agent.app-upgrade-template-new' | translate: { version: toVersion || '—' } }}
</div>
<div class="diff-header removed" translate>agent.app-upgrade-current</div>
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml" [syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-upgrade-diff-hint</p>
}
<div class="step-footer">
<button mat-raised-button color="primary" matStepperNext [disabled]="!canSubmit()">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
</div>
</mat-step>
<mat-step [label]="'agent.app-install-step4' | translate">
<div class="summary-card">
<div class="summary-row">
<span class="label" translate>agent.app-name</span>
<span class="value">{{ appName }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-summary-versions</span>
<span class="value">{{ fromVersion || '—' }} → {{ toVersion || '—' }}</span>
</div>
@if (hasBackupVolumeInput) {
<div class="summary-row">
<span class="label" translate>agent.app-upgrade-summary-volumes-label</span>
<span class="value">
{{ 'agent.app-upgrade-summary-volumes' | translate: { count: selectedBackupVolumeCount } }}
</span>
</div>
}
</div>
<div class="tb-form-hint tb-primary-fill mb-4">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-upgrade-rollback-info</span>
</div>
<div class="step-footer">
<button mat-button matStepperPrevious [disabled]="submitting">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
<button mat-raised-button color="primary" (click)="submit()" [disabled]="!canSubmit()">
<mat-icon>upgrade</mat-icon>
<span>{{ 'agent.app-upgrade-cta' | translate }}</span>
</button>
</div>
</mat-step>
}
</mat-stepper>
}
</div>
<div mat-dialog-actions>
@if (canGoBack() || showNext()) {
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end">
@if (canGoBack()) {
<button mat-stroked-button
[disabled]="submitting"
(click)="stepper.previous()">{{ 'action.back' | translate }}</button>
}
<span class="flex-1"></span>
@if (showNext()) {
<button mat-stroked-button
color="primary"
[disabled]="!canGoNext()"
(click)="stepper.next()">{{ 'action.next-with-label' | translate: { label: (nextStepLabel() | translate) } }}</button>
}
</div>
<mat-divider class="w-full"></mat-divider>
}
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2">
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ 'action.cancel' | translate }}</button>
@if (currentStep() === 'profile' && !profileUpgraded) {
<button mat-raised-button
color="primary"
[disabled]="!canSubmitProfileUpgrade()"
(click)="submitProfileUpgrade()">{{ 'agent.app-upgrade-profile-cta' | translate }}</button>
} @else {
<button mat-raised-button
color="primary"
[disabled]="currentStep() !== 'summary' || !canSubmit()"
(click)="submit()">{{ 'agent.app-upgrade-cta' | translate }}</button>
}
</div>
</div>

2
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;

35
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]] ?? '';
}
}

3
ui-ngx/src/app/modules/home/pages/agent/agent-app-profile.component.ts

@ -10,7 +10,6 @@ import {
AgentAppArgument,
AgentAppProfile,
AgentApplicationType,
AgentAppTemplate,
agentApplicationTypeTranslationMap,
AgentAppConfigType,
dockerComposeConfig
@ -175,7 +174,7 @@ export class AgentAppProfileComponent extends EntityComponent<AgentAppProfile>
this.dialog.open<AgentAppProfileUpgradeDialogComponent, AgentAppProfileUpgradeDialogData, AgentAppProfile | null>(
AgentAppProfileUpgradeDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: { profile: this.entity }
}
).afterClosed().subscribe(saved => {

13
ui-ngx/src/app/modules/home/pages/agent/agent-app-profiles-table-config.resolver.ts

@ -23,10 +23,7 @@ import { AgentService } from '@core/http/agent.service';
import { AgentAppProfileComponent } from '@home/pages/agent/agent-app-profile.component';
import { MatDialog } from '@angular/material/dialog';
import { DialogService } from '@core/services/dialog.service';
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 { AiAssistantConfigService } from '@core/services/ai-assistant-config.service';
import { AiAssistantViewType } from '@shared/models/ai-chat.models';
@ -135,13 +132,7 @@ export class AgentAppProfilesTableConfigResolver {
}
private openProfileWizard(): Observable<AgentAppProfile | null> {
return this.dialog.open<AgentAppProfileWizardComponent, AgentAppProfileWizardData, AgentAppProfile>(
AgentAppProfileWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: {}
}
).afterClosed().pipe(
return openAgentAppProfileWizard(this.dialog, {}, false).pipe(
tap(saved => {
if (saved) {
this.templateCache.clear();

46
ui-ngx/src/app/modules/home/pages/agent/agent-application.component.ts

@ -41,11 +41,7 @@ import {
AgentAppDeleteDialogComponent,
AgentAppDeleteDialogData
} from '@home/pages/agent/dialog/agent-app-delete-dialog.component';
import {
AgentAppInstallWizardComponent,
AgentAppInstallWizardData,
AgentAppInstallWizardResult
} from '@home/components/agent/wizard/agent-app-install-wizard.component';
import { openAgentAppInstallWizard } from '@home/components/agent/wizard/agent-app-install-wizard-dialog';
import { catchError, map, mergeMap, share, startWith } from 'rxjs/operators';
import { findComposeDownStep } from '@home/pages/agent/util/agent-app-steps';
import { confineWheelToAceEditor } from '@home/pages/agent/util/ace-wheel-confine';
@ -387,7 +383,7 @@ export class AgentApplicationComponent extends EntityComponent<AgentApplicationI
mergeMap(futureYaml => this.dialog.open<AgentAppAssignCompareDialogComponent, AgentAppAssignCompareDialogData, boolean>(
AgentAppAssignCompareDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: {
appName: this.entity?.name,
profileName: profile.name,
@ -608,18 +604,12 @@ export class AgentApplicationComponent extends EntityComponent<AgentApplicationI
takeUntilDestroyed(this.destroyRef)
).subscribe(({ full, confirmed }) => {
if (!confirmed) { return; }
this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
AgentAppInstallWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: {
agentId: full.agentId.id,
agent: null,
mode: 'update',
application: full
}
}
).afterClosed().subscribe(event => {
openAgentAppInstallWizard(this.dialog, {
agentId: full.agentId.id,
agent: null,
mode: 'update',
application: full
}).subscribe(event => {
if (event) {
this.reloadEntity();
}
@ -659,18 +649,12 @@ export class AgentApplicationComponent extends EntityComponent<AgentApplicationI
this.agentService.getAgentApplicationInfoById(this.entity.id.id).pipe(
takeUntilDestroyed(this.destroyRef)
).subscribe(full => {
this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
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 => {
openAgentAppInstallWizard(this.dialog, {
agentId: full.agentId.id,
agent: null,
mode: 'upgrade',
application: full
}).subscribe(event => {
if (event) {
this.reloadEntity();
}
@ -692,7 +676,7 @@ export class AgentApplicationComponent extends EntityComponent<AgentApplicationI
mergeMap(composeDownStep => this.dialog.open<AgentAppDeleteDialogComponent, AgentAppDeleteDialogData, AgentAppEvent | null>(
AgentAppDeleteDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: { application: full, composeDownStep }
}
).afterClosed().pipe(map(event => ({ full, event }))))

54
ui-ngx/src/app/modules/home/pages/agent/agent-applications-table-config.resolver.ts

@ -47,12 +47,8 @@ import {
AgentAppDeleteDialogComponent,
AgentAppDeleteDialogData
} from '@home/pages/agent/dialog/agent-app-delete-dialog.component';
import {
AgentAppInstallWizardComponent,
AgentAppInstallWizardData,
AgentAppInstallWizardResult,
isAgentAppUpgradeResult
} from '@home/components/agent/wizard/agent-app-install-wizard.component';
import { isAgentAppUpgradeResult } from '@home/components/agent/wizard/agent-app-install-wizard.component';
import { openAgentAppInstallWizard } from '@home/components/agent/wizard/agent-app-install-wizard-dialog';
import { AiAssistantConfigService } from '@core/services/ai-assistant-config.service';
import { AiAssistantViewType } from '@shared/models/ai-chat.models';
import { AgentId } from '@shared/models/id/agent-id';
@ -300,18 +296,12 @@ export class AgentApplicationsTableConfigResolver {
))
).subscribe(({ full, confirmed }) => {
if (!confirmed) { return; }
this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
AgentAppInstallWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: {
agentId: this.agentId,
agent: this.agent,
mode: 'update',
application: full
}
}
).afterClosed().subscribe(event => {
openAgentAppInstallWizard(this.dialog, {
agentId: this.agentId,
agent: this.agent,
mode: 'update',
application: full
}).subscribe(event => {
if (event) {
this.config.updateData();
}
@ -367,7 +357,7 @@ export class AgentApplicationsTableConfigResolver {
this.dialog.open<AgentAppDeleteDialogComponent, AgentAppDeleteDialogData, AgentAppEvent | null>(
AgentAppDeleteDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: {
application: app,
agentName: this.agent?.name,
@ -389,18 +379,12 @@ export class AgentApplicationsTableConfigResolver {
}
private showUpgradeWizard(application: AgentApplicationInfo) {
this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
AgentAppInstallWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: {
agentId: this.agentId,
agent: this.agent,
mode: 'upgrade',
application
}
}
).afterClosed().subscribe(event => {
openAgentAppInstallWizard(this.dialog, {
agentId: this.agentId,
agent: this.agent,
mode: 'upgrade',
application
}).subscribe(event => {
if (event) {
this.config.updateData();
}
@ -408,13 +392,7 @@ export class AgentApplicationsTableConfigResolver {
}
private openInstallWizard(): Observable<AgentApplicationInfo | null> {
return this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
AgentAppInstallWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: { agentId: this.agentId, agent: this.agent }
}
).afterClosed().pipe(
return openAgentAppInstallWizard(this.dialog, { agentId: this.agentId, agent: this.agent }).pipe(
switchMap(result => !isAgentAppUpgradeResult(result) && result?.applicationId?.id
? this.agentService.getAgentApplicationInfoById(result.applicationId.id)
: of(null))

31
ui-ngx/src/app/modules/home/pages/agent/agent-deploy-dialog.service.ts

@ -5,13 +5,10 @@ import { MatDialog } from '@angular/material/dialog';
import { Observable, of } from 'rxjs';
import { catchError } from 'rxjs/operators';
import { EntityId } from '@shared/models/id/entity-id';
import { AgentApplication, AgentApplicationType, AgentAppEvent } from '@shared/models/agent.models';
import { AgentApplication, AgentApplicationType } from '@shared/models/agent.models';
import { AgentService } from '@core/http/agent.service';
import {
AgentAppInstallWizardComponent,
AgentAppInstallWizardData,
AgentAppInstallWizardResult
} from '@home/components/agent/wizard/agent-app-install-wizard.component';
import { AgentAppInstallWizardResult } from '@home/components/agent/wizard/agent-app-install-wizard.component';
import { openAgentAppInstallWizard } from '@home/components/agent/wizard/agent-app-install-wizard-dialog';
@Injectable({ providedIn: 'root' })
export class AgentDeployDialogService {
@ -29,19 +26,13 @@ export class AgentDeployDialogService {
open(appType: AgentApplicationType, relatedEntity: EntityId,
options?: { showBack?: boolean }): Observable<AgentAppInstallWizardResult> {
return this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
AgentAppInstallWizardComponent, {
disableClose: false,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: {
mode: 'install',
selectAgent: true,
lockedType: appType,
lockedRelatedEntity: relatedEntity,
navigateToAgentOnFinish: true,
showBack: !!options?.showBack
}
}
).afterClosed();
return openAgentAppInstallWizard(this.dialog, {
mode: 'install',
selectAgent: true,
lockedType: appType,
lockedRelatedEntity: relatedEntity,
navigateToAgentOnFinish: true,
showBack: !!options?.showBack
});
}
}

13
ui-ngx/src/app/modules/home/pages/agent/agent-executions-side-panel.component.ts

@ -28,10 +28,7 @@ import {
AgentProfileInfo
} from '@shared/models/agent.models';
import { TranslateService } from '@ngx-translate/core';
import {
AgentAppEventProgressDialogComponent,
AgentAppEventProgressDialogData
} from '@home/pages/agent/dialog/agent-app-event-progress-dialog.component';
import { openAgentAppEventProgress } from '@home/pages/agent/util/agent-app-event-progress';
const NON_TERMINAL_BULK: ReadonlyArray<AgentBulkActionStatus> = [
AgentBulkActionStatus.QUEUED,
@ -173,13 +170,7 @@ export class AgentExecutionsSidePanelComponent implements OnChanges, OnDestroy {
}
private openProgressDialog(application: AgentApplication | null, event: AgentAppEventInfo): void {
this.dialog.open<AgentAppEventProgressDialogComponent, AgentAppEventProgressDialogData, boolean>(
AgentAppEventProgressDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
data: { application, event }
}
).afterClosed().subscribe(() => this.refresh());
openAgentAppEventProgress(this.dialog, application, event).subscribe(() => this.refresh());
}
formatTime(ts: number): string {

11
ui-ngx/src/app/modules/home/pages/agent/agent-install-instructions-dialog.component.scss

@ -1,13 +1,8 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../components/agent/agent-shared' as *;
@use '../../components/agent/wizard/agent-wizard' as *;
:host {
display: block;
width: min(720px, 95vw);
min-width: 0;
max-width: 95vw;
}
@include wizard-dialog(720px);
.tb-agent-install-dialog-header {
display: flex;
@ -24,8 +19,6 @@
.tb-agent-install-dialog-body {
padding: 16px 24px 24px;
max-height: 70vh;
overflow-y: auto;
}
.instructions-section {

2
ui-ngx/src/app/modules/home/pages/agent/agent-profile-create-dialog.service.ts

@ -18,7 +18,7 @@ export class AgentProfileCreateDialogService {
return this.dialog.open<AgentProfilePresetDialogComponent, AgentProfileWizardData, AgentProfile>(
AgentProfilePresetDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data
}).afterClosed();
}

32
ui-ngx/src/app/modules/home/pages/agent/agent-profile-created-dialog.component.html

@ -4,18 +4,18 @@
SPDX-License-Identifier: BUSL-1.1
-->
<div mat-dialog-title class="tb-agent-profile-created-header">
<h2 class="flex-1">
<mat-icon class="success-icon">check_circle</mat-icon>
<span translate>agent.agent-profile-created</span>
</h2>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<mat-icon class="material-icons mr-2">check_circle</mat-icon>
<h2 translate>agent.agent-profile-created</h2>
<span class="flex-1"></span>
<div tb-help="agentProfileProvisionCommand"></div>
<button mat-icon-button (click)="close()" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button
(click)="close()"
type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</div>
<div mat-dialog-content class="tb-agent-profile-created-body">
</mat-toolbar>
<div mat-dialog-content>
<section class="instructions-section">
<h3>
@ -63,13 +63,13 @@
</div>
<div mat-dialog-actions align="end" class="tb-agent-profile-created-footer">
<button mat-button (click)="close()">
{{ 'action.close' | translate }}
</button>
<div mat-dialog-actions class="flex items-center justify-end">
<button mat-button
(click)="close()">{{ 'action.close' | translate }}</button>
@if (agentProfile?.id?.id) {
<button mat-raised-button color="primary"
(click)="goToProfile()">
<button mat-raised-button
color="primary"
(click)="goToProfile()">
<mat-icon>open_in_new</mat-icon>
<span translate>agent.go-to-profile</span>
</button>

49
ui-ngx/src/app/modules/home/pages/agent/agent-profile-created-dialog.component.scss

@ -1,42 +1,8 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../components/agent/agent-shared' as *;
@use '../../components/agent/wizard/agent-wizard' as *;
:host {
display: block;
width: min(760px, 95vw);
min-width: 0;
max-width: 95vw;
}
.tb-agent-profile-created-header {
display: flex;
align-items: center;
justify-content: space-between;
margin: 0;
h2 {
display: flex;
align-items: center;
gap: 10px;
font-size: 20px;
font-weight: 400;
margin: 0;
.success-icon {
color: #4caf50;
font-size: 24px;
width: 24px;
height: 24px;
}
}
}
.tb-agent-profile-created-body {
padding: 16px 24px 24px;
max-height: 72vh;
overflow-y: auto;
}
@include wizard-dialog(760px);
.instructions-section {
h3 {
@ -89,14 +55,3 @@
}
}
}
.tb-agent-profile-created-footer {
padding: 8px 16px;
button[mat-raised-button] mat-icon {
font-size: 18px;
width: 18px;
height: 18px;
margin-right: 4px;
}
}

5
ui-ngx/src/app/modules/home/pages/agent/agent-profile-merged-profiles.component.ts

@ -28,7 +28,6 @@ import {
AgentAppConfigType,
AgentAppEventActionType,
agentAppEventActionTypeTranslationMap,
AgentAppProfile,
AgentAppProfileRelationInfo,
AgentAppTemplate,
AgentApplicationType,
@ -321,7 +320,7 @@ export class AgentProfileMergedProfilesComponent implements OnInit, OnChanges, O
this.dialog.open<AgentProfileAssignProfileDialogComponent, AgentProfileAssignProfileDialogData, string[]>(
AgentProfileAssignProfileDialogComponent, {
disableClose: true,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: { selectedIds }
}
).afterClosed().pipe(takeUntil(this.destroy$)).subscribe(nextIds => {
@ -476,7 +475,7 @@ export class AgentProfileMergedProfilesComponent implements OnInit, OnChanges, O
switchMap(({ templates, preview }) => this.dialog.open<AgentProfileBulkActionDialogComponent, AgentProfileBulkActionDialogData>(
AgentProfileBulkActionDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: {
agentProfile: this.agentProfile,
profile,

2
ui-ngx/src/app/modules/home/pages/agent/agent-profiles-table-config.resolver.ts

@ -97,7 +97,7 @@ export class AgentProfilesTableConfigResolver {
this.dialog.open<AgentProfileCreatedDialogComponent, AgentProfileCreatedDialogData>(
AgentProfileCreatedDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: { agentProfile, dockerCommand: res?.instructions || '' }
});
});

2
ui-ngx/src/app/modules/home/pages/agent/agents-table-config.resolver.ts

@ -394,7 +394,7 @@ export class AgentsTableConfigResolver {
this.dialog.open<AgentInstallInstructionsDialogComponent, AgentInstallInstructionsDialogData>(
AgentInstallInstructionsDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data: {
agent,
afterAdd,

30
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-assign-compare-dialog.component.html

@ -4,18 +4,15 @@
SPDX-License-Identifier: BUSL-1.1
-->
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<div class="tb-install-wizard-toolbar-content">
<h2>{{ 'agent.app-assign-compare-title' | translate }}:</h2>
<span class="flex-1">{{ data.profileName }}</span>
</div>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2>{{ 'agent.app-assign-compare-title' | translate }}: {{ data.profileName }}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppProfileUse"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
<div mat-dialog-content class="tb-install-wizard-body">
<div mat-dialog-content>
<div class="diff-header-row">
<div class="diff-header compare">{{ 'agent.app-update-current-config' | translate }}</div>
<div class="diff-header compare">{{ 'agent.app-update-future-config' | translate }}</div>
@ -35,12 +32,11 @@
{{ 'agent.app-assign-compare-hint' | translate: { profileName: data.profileName, appName: data.appName } }}
</p>
<div class="step-footer">
<button mat-button (click)="cancel()">
{{ 'action.cancel' | translate }}
</button>
<button mat-raised-button color="primary" (click)="confirm()">
<span>{{ 'agent.app-assign-compare-cta' | translate }}</span>
</button>
</div>
</div>
<div mat-dialog-actions class="flex items-center justify-end">
<button mat-button
(click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button
color="primary"
(click)="confirm()">{{ 'agent.app-assign-compare-cta' | translate }}</button>
</div>

2
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-assign-compare-dialog.component.scss

@ -2,5 +2,5 @@
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/wizard/agent-wizard' as *;
@include wizard-chrome;
@include wizard-dialog(1280px);
@include wizard-diff;

15
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-event-progress-dialog.component.html

@ -4,16 +4,15 @@
SPDX-License-Identifier: BUSL-1.1
-->
<mat-toolbar color="tb-primary" class="tb-progress-dialog-header">
<h2 mat-dialog-title translate>agent.app-event-progress-title</h2>
<span class="header-app-name">{{ subjectName }}</span>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2>{{ 'agent.app-event-progress-title' | translate }}: {{ subjectName }}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppEvents"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
<div mat-dialog-content class="tb-progress-body">
<div mat-dialog-content>
@if (loading) {
<div class="tb-progress-loading">
<mat-spinner diameter="20"></mat-spinner>
@ -112,7 +111,7 @@
}
</div>
<div mat-dialog-actions class="tb-progress-actions">
<div mat-dialog-actions class="flex flex-wrap items-center justify-end">
@if (canCancel) {
<button mat-button color="warn" (click)="cancelEvent($event)">
<mat-icon>cancel</mat-icon>

53
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-event-progress-dialog.component.scss

@ -1,44 +1,8 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/agent-shared' as *;
@use '../../../components/agent/wizard/agent-wizard' as *;
:host { display: block; width: min(640px, 95vw); min-width: 0; max-width: 95vw; }
.tb-progress-dialog-header {
display: flex;
align-items: center;
gap: 8px;
padding: 0 16px 0 24px;
min-height: 56px;
h2 {
font-size: 20px;
font-weight: 400;
margin: 0;
padding: 0;
color: inherit;
&::before {
display: none;
}
}
.header-app-name {
flex: 1;
min-width: 0;
font-size: 14px;
font-weight: 500;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
.tb-progress-body {
padding: 16px 24px 24px;
max-height: 70vh;
overflow-y: auto;
}
@include wizard-dialog(640px);
.tb-progress-loading,
.tb-progress-error {
@ -51,12 +15,12 @@
display: flex; gap: 12px; margin-bottom: 20px;
padding: 12px 16px; border: 1px solid $agent-divider-light;
border-radius: 4px; background: $agent-surface-muted;
.info-col { flex: 1; }
.info-col { flex: 1; min-width: 0; }
.info-label {
font-size: 11px; font-weight: 500; color: $agent-text-secondary;
text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px;
}
.info-value { font-size: 13px; font-weight: 500; }
.info-value { font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
}
.tb-status-badge {
@ -131,7 +95,8 @@
.step-content { flex: 1; padding-top: 4px; min-width: 0; }
.step-title {
font-size: 14px; font-weight: 500; color: $agent-text-primary;
margin-bottom: 2px; display: flex; align-items: center; gap: 8px;
margin-bottom: 2px; display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
overflow-wrap: anywhere;
}
.step-type-label {
font-size: 11px; font-weight: 500; padding: 2px 6px; border-radius: 3px;
@ -144,9 +109,3 @@
&.processing .step-meta { color: $agent-color-warning-light; font-weight: 500; }
&.error .step-meta { color: $agent-color-error; font-weight: 500; }
}
.tb-progress-actions {
display: flex; align-items: center;
padding: 8px 16px; border-top: 1px solid $agent-divider-light;
button mat-icon { font-size: 18px; width: 18px; height: 18px; margin-right: 4px; }
}

41
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-profile-upgrade-dialog.component.html

@ -4,18 +4,15 @@
SPDX-License-Identifier: BUSL-1.1
-->
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<div class="tb-install-wizard-toolbar-content">
<h2>{{ 'agent.app-upgrade-title' | translate }}:</h2>
<span class="flex-1">{{ profile.name }}</span>
</div>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2>{{ 'agent.app-upgrade-title' | translate }}: {{ profile.name }}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppProfileVersions"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button (click)="cancel()" type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
<div mat-dialog-content class="tb-install-wizard-body">
<div mat-dialog-content>
@if (loadingTemplate) {
<div class="loading-state">
@ -27,9 +24,6 @@
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
<div class="step-footer">
<button mat-button (click)="cancel()">{{ 'action.close' | translate }}</button>
</div>
</div>
}
@ -61,14 +55,19 @@
<span translate>agent.app-compose-invalid-yaml</span>
</div>
}
<div class="step-footer">
<button mat-button (click)="cancel()" [disabled]="submitting">
{{ 'action.cancel' | translate }}
</button>
<button mat-raised-button color="primary" (click)="submit()" [disabled]="!canSubmit()">
<mat-icon>upgrade</mat-icon>
<span>{{ 'agent.app-upgrade-cta' | translate }}</span>
</button>
</div>
}
</div>
<div mat-dialog-actions class="flex items-center justify-end">
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ (loadError ? 'action.close' : 'action.cancel') | translate }}</button>
@if (!loadingTemplate && !loadError) {
<button mat-raised-button
color="primary"
[disabled]="!canSubmit()"
(click)="submit()">
<mat-icon>upgrade</mat-icon>
<span>{{ 'agent.app-upgrade-cta' | translate }}</span>
</button>
}
</div>

2
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-profile-upgrade-dialog.component.scss

@ -2,7 +2,7 @@
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/wizard/agent-wizard' as *;
@include wizard-chrome;
@include wizard-dialog(1280px);
@include wizard-step-basics;
@include wizard-diff;
@include wizard-summary;

18
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-version-warning-dialog.component.html

@ -4,16 +4,18 @@
SPDX-License-Identifier: BUSL-1.1
-->
<div mat-dialog-title class="tb-app-version-warning-header" [class.destructive]="destructive">
<mat-icon class="warn-icon">warning</mat-icon>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<mat-icon class="material-icons mr-2 flex-none">warning</mat-icon>
<h2>{{ titleKey | translate }}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppProfileVersions"></div>
<button mat-icon-button (click)="cancel()" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button
(click)="cancel()"
type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</div>
<div mat-dialog-content class="tb-app-version-warning-body">
</mat-toolbar>
<div mat-dialog-content>
<p class="warning-text">
{{ textKey | translate: {
@ -40,7 +42,7 @@
</div>
</div>
<div mat-dialog-actions align="end" class="tb-app-version-warning-footer">
<div mat-dialog-actions class="flex flex-wrap items-center justify-end">
<button mat-button (click)="cancel()">
{{ 'action.cancel' | translate }}
</button>

53
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-app-version-warning-dialog.component.scss

@ -1,55 +1,16 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/agent-shared' as *;
@use '../../../components/agent/wizard/agent-wizard' as *;
:host {
display: block;
width: min(560px, 95vw);
min-width: 0;
max-width: 95vw;
}
.tb-app-version-warning-header {
display: flex;
align-items: center;
gap: 8px;
margin: 0;
.warn-icon {
color: $agent-color-warning-strong;
font-size: 22px;
width: 22px;
height: 22px;
}
@include wizard-dialog(560px);
&.destructive .warn-icon {
color: $agent-color-error-accent;
}
h2 {
flex: 1;
font-size: 20px;
font-weight: 400;
margin: 0;
}
}
.tb-app-version-warning-body {
padding: 16px 24px 24px;
.warning-text {
font-size: 14px;
color: rgba(0, 0, 0, 0.74);
margin: 0 0 16px;
line-height: 1.5;
}
.warning-text {
font-size: 14px;
color: rgba(0, 0, 0, 0.74);
margin: 0 0 16px;
line-height: 1.5;
}
.app-summary {
@include agent-summary-card($agent-surface-muted, $agent-divider-light);
}
.tb-app-version-warning-footer {
padding: 8px 24px 16px;
gap: 8px;
}

9
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-assign-profile-dialog.component.scss

@ -1,13 +1,8 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/agent-shared' as *;
@use '../../../components/agent/wizard/agent-wizard' as *;
:host {
display: block;
width: min(920px, 95vw);
min-width: 0;
max-width: 95vw;
}
@include wizard-dialog(920px);
.tb-create-new-link {
white-space: nowrap;

15
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-assign-profile-dialog.component.ts

@ -7,11 +7,8 @@ import { Router } from '@angular/router';
import { MAT_DIALOG_DATA, MatDialog, MatDialogRef } from '@angular/material/dialog';
import { DialogComponent } from '@shared/components/dialog.component';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { AgentAppProfile, AgentApplicationType } from '@shared/models/agent.models';
import {
AgentAppProfileWizardComponent,
AgentAppProfileWizardData
} from '@home/pages/agent/wizard/agent-app-profile-wizard.component';
import { AgentApplicationType } from '@shared/models/agent.models';
import { openAgentAppProfileWizard } from '@home/pages/agent/wizard/agent-app-profile-wizard-dialog';
export interface AgentProfileAssignProfileDialogData {
selectedIds?: string[];
@ -62,13 +59,7 @@ export class AgentProfileAssignProfileDialogComponent
}
private openAppProfileWizard() {
this.dialog.open<AgentAppProfileWizardComponent, AgentAppProfileWizardData, AgentAppProfile>(
AgentAppProfileWizardComponent, {
disableClose: true,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-agent-wizard-dialog'],
data: { lockedAppType: this.data?.lockedAppType }
}
).afterClosed().subscribe(saved => {
openAgentAppProfileWizard(this.dialog, { lockedAppType: this.data?.lockedAppType }).subscribe(saved => {
if (saved) {
const currentIds: string[] = this.formGroup.value?.appProfileIds ?? [];
if (!currentIds.includes(saved.id.id)) {

11
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-bulk-action-dialog.component.scss

@ -1,13 +1,8 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/agent-shared' as *;
@use '../../../components/agent/wizard/agent-wizard' as *;
:host {
display: block;
width: min(720px, 95vw);
min-width: 0;
max-width: 95vw;
}
@include wizard-dialog(720px);
.tb-bulk-dialog-header {
display: flex;
@ -25,8 +20,6 @@
.tb-bulk-dialog-body {
padding: 16px 24px;
max-height: 70vh;
overflow-y: auto;
}
.tb-bulk-summary {

63
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-preset-dialog.component.html

@ -4,29 +4,30 @@
SPDX-License-Identifier: BUSL-1.1
-->
<div mat-dialog-title class="tb-preset-dialog-header">
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2 translate>agent.add-profile</h2>
<span class="flex-1"></span>
<div tb-help="agentProfiles"></div>
<button mat-icon-button (click)="cancel()" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button
(click)="cancel()"
type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</div>
<div mat-dialog-content class="tb-preset-dialog-body" [class.tb-preset-body-advanced]="mode === 'advanced'">
@if (mode === 'advanced') {
<tb-agent-profile-wizard
[embedded]="true"
[showBack]="true"
[defaults]="advancedDefaults"
[lockedAppType]="data?.lockedAppType"
(finished)="onAdvancedFinished($event)"
(cancelled)="cancel()"
(backClicked)="onAdvancedBack()">
</tb-agent-profile-wizard>
}
@if (mode === 'preset') {
<form [formGroup]="form">
</mat-toolbar>
@if (mode === 'advanced') {
<tb-agent-profile-wizard
[embedded]="true"
[showBack]="true"
[defaults]="advancedDefaults"
[lockedAppType]="data?.lockedAppType"
(finished)="onAdvancedFinished($event)"
(cancelled)="cancel()"
(backClicked)="onAdvancedBack()">
</tb-agent-profile-wizard>
}
@if (mode === 'preset') {
<div mat-dialog-content>
<div [formGroup]="form">
<mat-form-field class="mat-block" appearance="outline" subscriptSizing="dynamic">
<mat-label translate>agent.profile-name</mat-label>
<input matInput formControlName="name" required
@ -38,7 +39,7 @@
</mat-error>
}
</mat-form-field>
</form>
</div>
<div class="tb-preset-section-label" translate>agent.preset-setup</div>
<div class="tb-preset-grid">
@for (tile of tiles; track tile.labelKey) {
@ -93,16 +94,14 @@
</div>
</div>
}
}
</div>
@if (mode === 'preset') {
<div mat-dialog-actions align="end" class="tb-preset-dialog-footer">
<button mat-button (click)="cancel()" [disabled]="submitting">
{{ 'action.cancel' | translate }}
</button>
<button mat-raised-button color="primary" (click)="submit()" [disabled]="!canSubmit">
{{ 'action.add' | translate }}
</button>
</div>
<div mat-dialog-actions class="flex items-center justify-end">
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button
color="primary"
[disabled]="!canSubmit"
(click)="submit()">{{ 'action.add' | translate }}</button>
</div>
}

45
ui-ngx/src/app/modules/home/pages/agent/dialog/agent-profile-preset-dialog.component.scss

@ -1,42 +1,11 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
@use '../../../components/agent/agent-shared' as *;
@use '../../../components/agent/wizard/agent-wizard' as *;
:host {
display: block;
width: min(720px, 95vw);
min-width: 0;
max-width: 95vw;
}
.tb-preset-dialog-header {
display: flex;
align-items: center;
gap: 8px;
border-bottom: 1px solid $agent-divider;
h2 {
flex: 1;
font-size: 20px;
font-weight: 400;
margin: 0;
}
}
.tb-preset-dialog-body {
max-height: 75vh;
padding: 12px 24px 16px;
&.tb-preset-body-advanced {
padding: 0 !important;
}
}
@include wizard-dialog(720px);
tb-agent-profile-wizard {
display: block;
width: 100% !important;
min-width: 0 !important;
max-width: 100% !important;
display: contents;
}
.tb-preset-section-label {
@ -180,11 +149,3 @@ tb-agent-profile-wizard {
}
}
}
.tb-preset-dialog-footer {
display: flex;
align-items: center;
justify-content: flex-end;
gap: 8px;
border-top: 1px solid $agent-divider-light;
}

13
ui-ngx/src/app/modules/home/pages/agent/table/abstract-agent-app-event-table-config.ts

@ -30,10 +30,7 @@ import {
isAgentScopedAppEventActionType,
processingStartStatusTranslationMap
} from '@shared/models/agent.models';
import {
AgentAppEventProgressDialogComponent,
AgentAppEventProgressDialogData
} from '@home/pages/agent/dialog/agent-app-event-progress-dialog.component';
import { openAgentAppEventProgress } from '@home/pages/agent/util/agent-app-event-progress';
import {
AGENT_APP_EVENT_FILTER_PANEL_DATA,
AgentAppEventFilterPanelComponent,
@ -196,13 +193,7 @@ export abstract class AbstractAgentAppEventTableConfig<E extends AgentAppEvent>
}
private openProgress(application: AgentApplication | null, event: E): void {
this.dialog.open<AgentAppEventProgressDialogComponent, AgentAppEventProgressDialogData, boolean>(
AgentAppEventProgressDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
data: { application, event }
}
).afterClosed().subscribe(() => this.updateData());
openAgentAppEventProgress(this.dialog, application, event).subscribe(() => this.updateData());
}
private cancelEvent($event: Event, e: E): void {

2
ui-ngx/src/app/modules/home/pages/agent/util/agent-app-event-progress.ts

@ -24,7 +24,7 @@ export function openAgentAppEventProgress(
return dialog.open<AgentAppEventProgressDialogComponent, AgentAppEventProgressDialogData, boolean>(
AgentAppEventProgressDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data: { application, event }
}
).afterClosed();

2
ui-ngx/src/app/modules/home/pages/agent/util/agent-version-warnings.ts

@ -15,7 +15,7 @@ export function confirmAppVersionWarning(dialog: MatDialog,
return dialog.open<AgentAppVersionWarningDialogComponent, AgentAppVersionWarningDialogData, AgentAppVersionWarningResult>(
AgentAppVersionWarningDialogComponent, {
disableClose: false,
panelClass: ['tb-dialog'],
panelClass: ['tb-dialog', 'tb-fullscreen-dialog'],
data
}).afterClosed().pipe(map(res => res ?? false));
}

23
ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard-dialog.ts

@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import { MatDialog } from '@angular/material/dialog';
import { Observable } from 'rxjs';
import { AgentAppProfile } from '@shared/models/agent.models';
import {
AgentAppProfileWizardComponent,
AgentAppProfileWizardData
} from '@home/pages/agent/wizard/agent-app-profile-wizard.component';
export function openAgentAppProfileWizard(
dialog: MatDialog,
data: AgentAppProfileWizardData,
disableClose = true
): Observable<AgentAppProfile> {
return dialog.open<AgentAppProfileWizardComponent, AgentAppProfileWizardData, AgentAppProfile>(
AgentAppProfileWizardComponent, {
disableClose,
panelClass: ['tb-dialog', 'tb-fullscreen-dialog', 'tb-wide-dialog'],
data
}
).afterClosed();
}

348
ui-ngx/src/app/modules/home/pages/agent/wizard/agent-app-profile-wizard.component.html

@ -4,194 +4,198 @@
SPDX-License-Identifier: BUSL-1.1
-->
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<div class="tb-install-wizard-toolbar-content">
<h2>{{ titleKey | translate }}</h2>
</div>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2>{{ titleKey | translate }}</h2>
<span class="flex-1"></span>
<div tb-help="agentAppProfiles"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button
(click)="cancel()"
type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
<div mat-dialog-content>
<div mat-dialog-content class="tb-install-wizard-body flex min-h-[50vh] flex-col">
<mat-stepper class="flex-1" linear #stepper
<mat-stepper linear #stepper
(selectionChange)="selectedIndex = $event.selectedIndex"
[orientation]="(stepperOrientation | async)"
[labelPosition]="(stepperLabelPosition | async)">
@if (!editMode) {
<mat-step [label]="'agent.app-install-step1' | translate" [completed]="canProceedFromType()">
<div class="step-content">
<div class="type-select">
<p class="hint" translate>agent.app-install-pick-type</p>
<div class="type-cards">
@for (card of typeCards; track card.type) {
<button type="button" class="type-card"
[class.selected]="selectedType === card.type"
[class.locked-out]="lockedAppType && lockedAppType !== card.type"
[disabled]="lockedAppType && lockedAppType !== card.type"
[attr.aria-pressed]="selectedType === card.type"
(click)="selectType(card.type)">
<mat-icon>{{ card.icon }}</mat-icon>
<h4>{{ card.labelKey | translate }}</h4>
<p>{{ card.descKey | translate }}</p>
</button>
}
</div>
@if (selectedType && selectedType !== 'GENERIC' && availableTemplates.length) {
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.template</mat-label>
<mat-select [value]="selectedTemplateVersion" (selectionChange)="onTemplateSelected($event.value)">
@for (tpl of availableTemplates; track tpl.currentVersion) {
<mat-option [value]="tpl.currentVersion">
{{ tpl.currentVersion }}
</mat-option>
@for (step of steps; track step) {
@switch (step) {
@case ('type') {
<mat-step [label]="stepLabels[step] | translate" [completed]="canProceedFromType()">
<div class="step-content">
<div class="type-select">
<p class="hint" translate>agent.app-install-pick-type</p>
<div class="type-cards">
@for (card of typeCards; track card.type) {
<button type="button" class="type-card"
[class.selected]="selectedType === card.type"
[class.locked-out]="lockedAppType && lockedAppType !== card.type"
[disabled]="lockedAppType && lockedAppType !== card.type"
[attr.aria-pressed]="selectedType === card.type"
(click)="selectType(card.type)">
<mat-icon>{{ card.icon }}</mat-icon>
<h4>{{ card.labelKey | translate }}</h4>
<p>{{ card.descKey | translate }}</p>
</button>
}
</mat-select>
</mat-form-field>
}
@if (loadingTemplate || loadingTemplates) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-install-loading-template</span>
</div>
}
@if (selectedType && !loadingTemplates && !loadError && !availableTemplates.length) {
<div class="tb-form-hint tb-primary-fill tb-form-hint-warning">
<mat-icon>warning_amber</mat-icon>
<span translate>agent.app-no-templates</span>
</div>
@if (selectedType && selectedType !== 'GENERIC' && availableTemplates.length) {
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.template</mat-label>
<mat-select [value]="selectedTemplateVersion" (selectionChange)="onTemplateSelected($event.value)">
@for (tpl of availableTemplates; track tpl.currentVersion) {
<mat-option [value]="tpl.currentVersion">
{{ tpl.currentVersion }}
</mat-option>
}
</mat-select>
</mat-form-field>
}
@if (loadingTemplate || loadingTemplates) {
<div class="loading-state">
<mat-spinner diameter="20"></mat-spinner>
<span translate>agent.app-install-loading-template</span>
</div>
}
@if (selectedType && !loadingTemplates && !loadError && !availableTemplates.length) {
<div class="tb-form-hint tb-primary-fill tb-form-hint-warning">
<mat-icon>warning_amber</mat-icon>
<span translate>agent.app-no-templates</span>
</div>
}
@if (loadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
</div>
}
</div>
}
@if (loadError) {
<div class="error-state">
<mat-icon>error_outline</mat-icon>
<span>{{ loadError }}</span>
</div>
}
</div>
</div>
</mat-step>
}
<!-- Step 2: Name + YAML editor -->
<mat-step [stepControl]="profileForm" [label]="'agent.app-install-step3' | translate" [completed]="canSubmit()">
<div class="step-content">
<form [formGroup]="profileForm">
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-profile-name</mat-label>
<input matInput formControlName="name" [placeholder]="profileNamePlaceholder">
@if (profileForm.get('name').hasError('required')) {
<mat-error>{{ 'agent.profile-name-required' | translate }}</mat-error>
}
</mat-form-field>
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-profile-description</mat-label>
<textarea matInput formControlName="description" cdkTextareaAutosize cdkAutosizeMinRows="1" rows="1"></textarea>
</mat-form-field>
</form>
</div>
</mat-step>
}
@case ('config') {
<mat-step [stepControl]="profileForm" [label]="stepLabels[step] | translate" [completed]="canSubmit()">
<div class="step-content">
<form [formGroup]="profileForm">
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-profile-name</mat-label>
<input matInput formControlName="name" [placeholder]="profileNamePlaceholder">
@if (profileForm.get('name').hasError('required')) {
<mat-error>{{ 'agent.profile-name-required' | translate }}</mat-error>
}
</mat-form-field>
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-profile-description</mat-label>
<textarea matInput formControlName="description" cdkTextareaAutosize cdkAutosizeMinRows="1" rows="1"></textarea>
</mat-form-field>
</form>
@if (composeTypeKeys.length > 1) {
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-compose-template-select</mat-label>
<mat-select [value]="composeType" (selectionChange)="onComposeTypeChange($event.value)">
@for (key of composeTypeKeys; track key) {
<mat-option [value]="key">
{{ composeTypeLabel(key) }}
</mat-option>
}
</mat-select>
</mat-form-field>
}
@if (composeTypeKeys.length > 1) {
<mat-form-field class="mat-block" appearance="outline">
<mat-label translate>agent.app-compose-template-select</mat-label>
<mat-select [value]="composeType" (selectionChange)="onComposeTypeChange($event.value)">
@for (key of composeTypeKeys; track key) {
<mat-option [value]="key">
{{ composeTypeLabel(key) }}
</mat-option>
@if (selectedType === 'EDGE' || selectedType === 'GATEWAY') {
<div class="tb-form-hint tb-primary-fill">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-profile-compose-creds-hint</span>
</div>
}
</mat-select>
</mat-form-field>
}
@if (selectedType === 'EDGE' || selectedType === 'GATEWAY') {
<div class="tb-form-hint tb-primary-fill">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-profile-compose-creds-hint</span>
</div>
<div class="diff-header-row">
<div class="diff-header added" translate>agent.app-install-diff-template</div>
<div class="diff-header removed" translate>agent.app-install-diff-editable</div>
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml"
[syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-install-diff-hint</p>
</div>
</mat-step>
}
@case ('save') {
<mat-step [label]="stepLabels[step] | translate">
<div class="step-content">
<div class="summary-section">
<div class="summary-card">
<div class="summary-row">
<span class="label" translate>agent.app-profile-name</span>
<span class="value">{{ profileName }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-type</span>
<span class="value"><span class="tb-type-badge"
[class.edge]="selectedType === 'EDGE'"
[class.gateway]="selectedType === 'GATEWAY'"
[class.generic]="selectedType === 'GENERIC'">{{ selectedType }}</span></span>
</div>
@if (template) {
<div class="summary-row">
<span class="label" translate>agent.app-template</span>
<span class="value">{{ template.currentVersion }}</span>
</div>
}
@if (profileDescription) {
<div class="summary-row">
<span class="label" translate>agent.app-profile-description</span>
<span class="value">{{ profileDescription }}</span>
</div>
}
</div>
<div class="diff-header-row">
<div class="diff-header added" translate>agent.app-install-diff-template</div>
<div class="diff-header removed" translate>agent.app-install-diff-editable</div>
<button type="button" class="diff-sync-toggle"
[class.active]="diffSyncScroll"
[matTooltip]="'agent.app-diff-sync-scroll' | translate"
(click)="diffSyncScroll = !diffSyncScroll">
<mat-icon>{{ diffSyncScroll ? 'link' : 'link_off' }}</mat-icon>
</button>
</div>
<tb-agent-compose-diff [left]="proposedYaml" [right]="currentYaml"
[syncScroll]="diffSyncScroll" (rightChange)="composeYaml = $event"></tb-agent-compose-diff>
<p class="diff-hint" translate>agent.app-install-diff-hint</p>
</div>
</mat-step>
<!-- Step 3: Summary + Confirm -->
<mat-step [label]="'agent.app-profile-step-save' | translate">
<div class="step-content">
<div class="summary-section">
<div class="summary-card">
<div class="summary-row">
<span class="label" translate>agent.app-profile-name</span>
<span class="value">{{ profileName }}</span>
</div>
<div class="summary-row">
<span class="label" translate>agent.app-type</span>
<span class="value"><span class="tb-type-badge"
[class.edge]="selectedType === 'EDGE'"
[class.gateway]="selectedType === 'GATEWAY'"
[class.generic]="selectedType === 'GENERIC'">{{ selectedType }}</span></span>
</div>
@if (template) {
<div class="summary-row">
<span class="label" translate>agent.app-template</span>
<span class="value">{{ template.currentVersion }}</span>
</div>
}
@if (profileDescription) {
<div class="summary-row">
<span class="label" translate>agent.app-profile-description</span>
<span class="value">{{ profileDescription }}</span>
<div class="tb-form-hint tb-primary-fill">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-profile-wizard-confirm-info</span>
</div>
</div>
}
</div>
<div class="tb-form-hint tb-primary-fill">
<mat-icon>info_outline</mat-icon>
<span translate>agent.app-profile-wizard-confirm-info</span>
</div>
</div>
</div>
</mat-step>
</div>
</mat-step>
}
}
}
</mat-stepper>
<div class="step-footer">
@let stepIndex = stepper?.selectedIndex;
@if (stepIndex > 0) {
<button mat-button type="button" (click)="stepper.previous()" [disabled]="submitting">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
</div>
<div mat-dialog-actions>
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end">
@if (selectedIndex > 0) {
<button mat-stroked-button
[disabled]="submitting"
(click)="stepper.previous()">{{ 'action.back' | translate }}</button>
}
<button mat-button type="button" (click)="cancel()" [disabled]="submitting">
{{ 'action.cancel' | translate }}
</button>
@if (stepIndex === stepper?.steps.length - 1) {
<button mat-raised-button color="primary" type="button" (click)="submit()" [disabled]="!canSubmit()">
<mat-icon>save</mat-icon>
<span>{{ 'action.save' | translate }}</span>
</button>
} @else {
<button mat-raised-button color="primary" type="button" (click)="stepper.next()"
[disabled]="!stepper?.selected?.completed">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
<span class="flex-1"></span>
@if (!isLastStep()) {
<button mat-stroked-button
color="primary"
[disabled]="!canGoNext()"
(click)="stepper.next()">{{ 'action.next-with-label' | translate: { label: (nextStepLabel() | translate) } }}</button>
}
</div>
<mat-divider class="w-full"></mat-divider>
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2">
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button
color="primary"
[disabled]="!isLastStep() || !canSubmit()"
(click)="submit()">{{ 'action.save' | translate }}</button>
</div>
</div>

2
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;

25
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<AgentAppProfileWizardComponent, AgentAppProfile>
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;

26
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<AgentAppInstallStepKey, string> = {
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<AgentAppUpgradeStepKey, string> = {
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<AgentAppProfileStepKey, string> = {
type: 'agent.app-install-step1',
config: 'agent.app-install-step3',
save: 'agent.app-profile-step-save'
};
export interface AgentTypeCard {
type: AgentApplicationType;
icon: string;

68
ui-ngx/src/app/modules/home/pages/agent/wizard/agent-profile-wizard.component.html

@ -5,20 +5,21 @@
-->
@if (!embedded) {
<mat-toolbar color="tb-primary" class="tb-install-wizard-toolbar">
<div class="tb-install-wizard-toolbar-content">
<h2>{{ (isEdit ? 'agent.edit-profile' : 'agent.add-profile') | translate }}</h2>
</div>
<mat-toolbar color="tb-primary" class="tb-bottom-border">
<h2>{{ (isEdit ? 'agent.edit-profile' : 'agent.add-profile') | translate }}</h2>
<span class="flex-1"></span>
<div tb-help="agentProfiles"></div>
<button mat-icon-button (click)="cancel()" type="button" tabindex="-1">
<mat-icon>close</mat-icon>
<button mat-icon-button
(click)="cancel()"
type="button">
<mat-icon class="material-icons">close</mat-icon>
</button>
</mat-toolbar>
}
<div mat-dialog-content>
<div mat-dialog-content class="tb-install-wizard-body flex min-h-[50vh] flex-col" [class.tb-install-wizard-embedded]="embedded">
<mat-stepper class="flex-1" linear #stepper [labelPosition]="(stepperLabelPosition | async)">
<mat-stepper linear #stepper [labelPosition]="(stepperLabelPosition | async)"
(selectionChange)="selectedIndex = $event.selectedIndex">
<mat-step [stepControl]="step1Form" [label]="'agent.add-profile-step-details' | translate">
<form [formGroup]="step1Form" autocomplete="off">
@ -106,30 +107,31 @@
</mat-stepper>
<div class="step-footer">
@if (stepper?.selectedIndex === 0) {
@if (showBack) {
<button mat-button type="button" (click)="back()">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
}
<button mat-button type="button" (click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button color="primary" type="button" [disabled]="step1Form.invalid" (click)="stepper.next()">
{{ 'action.next' | translate }}
<mat-icon iconPositionEnd>chevron_right</mat-icon>
</button>
} @else {
<button mat-button type="button" (click)="stepper.previous()">
<mat-icon>chevron_left</mat-icon>
{{ 'action.back' | translate }}
</button>
<button mat-raised-button color="primary" type="button"
[disabled]="!canSubmit()"
(click)="submit()">
{{ (isEdit ? 'action.save' : 'action.add') | translate }}
</button>
</div>
<div mat-dialog-actions>
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end">
@if (selectedIndex > 0 || showBack) {
<button mat-stroked-button
[disabled]="submitting"
(click)="back()">{{ 'action.back' | translate }}</button>
}
<span class="flex-1"></span>
@if (selectedIndex === 0) {
<button mat-stroked-button
color="primary"
[disabled]="step1Form.invalid"
(click)="stepper.next()">{{ 'action.next-with-label' | translate: { label: ('agent.add-profile-step-app-profiles' | translate) } }}</button>
}
</div>
<mat-divider class="w-full"></mat-divider>
<div class="dialog-actions-row flex flex-1 flex-row items-center justify-end gap-2">
<button mat-button
[disabled]="submitting"
(click)="cancel()">{{ 'action.cancel' | translate }}</button>
<button mat-raised-button
color="primary"
[disabled]="selectedIndex === 0 || !canSubmit()"
(click)="submit()">{{ (isEdit ? 'action.save' : 'action.add') | translate }}</button>
</div>
</div>

27
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;
}

21
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<AgentProfile>;
@ -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, AgentAppProfileWizardData, AgentAppProfile>(
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)) {

48
ui-ngx/src/app/modules/home/pages/edge/edge-instructions-dialog.component.html

@ -48,15 +48,13 @@
</ng-template>
<ng-template matTabContent>
<div class="tb-form-panel no-padding no-border">
<div class="tb-form-panel no-padding stroked">
@if (contentData.docker) {
<tb-markdown [data]='contentData.docker'></tb-markdown>
} @else {
<div class="tb-loader">
<mat-spinner color="accent" diameter="48" strokeWidth="4"></mat-spinner>
</div>
}
</div>
@if (contentData.docker) {
<tb-markdown [data]='contentData.docker'></tb-markdown>
} @else {
<div class="tb-loader">
<mat-spinner color="accent" diameter="48" strokeWidth="4"></mat-spinner>
</div>
}
</div>
</ng-template>
</mat-tab>
@ -67,15 +65,13 @@
</ng-template>
<ng-template matTabContent>
<div class="tb-form-panel no-padding no-border">
<div class="tb-form-panel no-padding stroked">
@if (contentData.ubuntu) {
<tb-markdown [data]='contentData.ubuntu'></tb-markdown>
} @else {
<div class="tb-loader">
<mat-spinner color="accent" diameter="48" strokeWidth="4"></mat-spinner>
</div>
}
</div>
@if (contentData.ubuntu) {
<tb-markdown [data]='contentData.ubuntu'></tb-markdown>
} @else {
<div class="tb-loader">
<mat-spinner color="accent" diameter="48" strokeWidth="4"></mat-spinner>
</div>
}
</div>
</ng-template>
</mat-tab>
@ -86,15 +82,13 @@
</ng-template>
<ng-template matTabContent>
<div class="tb-form-panel no-padding no-border">
<div class="tb-form-panel no-padding stroked">
@if (contentData.centos) {
<tb-markdown [data]='contentData.centos'></tb-markdown>
} @else {
<div class="tb-loader">
<mat-spinner color="accent" diameter="48" strokeWidth="4"></mat-spinner>
</div>
}
</div>
@if (contentData.centos) {
<tb-markdown [data]='contentData.centos'></tb-markdown>
} @else {
<div class="tb-loader">
<mat-spinner color="accent" diameter="48" strokeWidth="4"></mat-spinner>
</div>
}
</div>
</ng-template>
</mat-tab>

18
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 {

33
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<EdgeInfo> {
if ($event) { $event.stopPropagation(); }
if (!this.managedApp) { return; }
this.agentService.getAgentApplicationInfoById(this.managedApp.id.id).subscribe(full => {
this.dialog.open<AgentAppInstallWizardComponent, AgentAppInstallWizardData, AgentAppInstallWizardResult>(
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);
}
});
});
}

16
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<EntityTableConfig<EdgeInfo>> {
@ -297,13 +295,7 @@ export class EdgesTableConfigResolver {
if ($event) {
$event.stopPropagation();
}
this.dialog.open<AgentAutoProvisionDialogComponent, AgentAutoProvisionDialogData, boolean>(
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();
}

10
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%;

Loading…
Cancel
Save