Skip to content

Commit 2a2be23

Browse files
TheTechnologGerrit
authored andcommitted
Merge "Improved Add Data File button handling"
2 parents c97ddef + 1283792 commit 2a2be23

3 files changed

Lines changed: 109 additions & 116 deletions

File tree

ui/webapp/src/app/modules/panels/instances/components/add-data-file/add-data-file.component.html

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<app-bd-dialog-toolbar header="Add Data File" [panel]="true"></app-bd-dialog-toolbar>
33
<app-bd-dialog-content>
44
<form #form="ngForm" class="flex flex-col gap-1">
5+
@if (fileMinion$ | async) {
56
<div class="my-2">Target Node: <strong name="targetNode">{{ fileMinion$ | async }}</strong></div>
67
<app-bd-form-input
78
#tempFileInput
@@ -16,10 +17,10 @@
1617
hintText="Drop file to add initial content"
1718
></app-bd-file-drop>
1819
@if (tempFileContentLoading$ | async) {
19-
<div>Loading...</div>
20+
<div>Loading...</div>
2021
}
2122
@if (tempFileError) {
22-
<div class="bd-warning-text">{{ tempFileError }}</div>
23+
<div class="bd-warning-text">{{ tempFileError }}</div>
2324
}
2425
<app-bd-button
2526
color="primary"
@@ -29,6 +30,9 @@
2930
(click)="onSave()"
3031
[disabled]="form.invalid || !(fileMinion$ | async)"
3132
></app-bd-button>
33+
} @else {
34+
<app-bd-no-data>This panel has been opened with missing or invalid parameters. Please close it.</app-bd-no-data>
35+
}
3236
</form>
3337
</app-bd-dialog-content>
3438
</app-bd-dialog>

ui/webapp/src/app/modules/panels/instances/components/add-data-file/add-data-file.component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,13 @@ import { CfgFileNameValidatorDirective } from '../../validators/cfg-file-name-va
1515
import { BdFileDropComponent } from '../../../../core/components/bd-file-drop/bd-file-drop.component';
1616
import { BdButtonComponent } from '../../../../core/components/bd-button/bd-button.component';
1717
import { AsyncPipe } from '@angular/common';
18+
import { BdNoDataComponent } from 'src/app/modules/core/components/bd-no-data/bd-no-data.component';
1819

1920
@Component({
2021
selector: 'app-add-data-file',
2122
templateUrl: './add-data-file.component.html',
2223
changeDetection: ChangeDetectionStrategy.OnPush,
23-
imports: [BdDialogComponent, BdDialogToolbarComponent, BdDialogContentComponent, FormsModule, BdFormInputComponent, CfgFileNameValidatorDirective, BdFileDropComponent, BdButtonComponent, AsyncPipe]
24+
imports: [BdDialogComponent, BdDialogToolbarComponent, BdDialogContentComponent, BdNoDataComponent, FormsModule, BdFormInputComponent, CfgFileNameValidatorDirective, BdFileDropComponent, BdButtonComponent, AsyncPipe]
2425
})
2526
export class AddDataFileComponent implements OnInit, OnDestroy, DirtyableDialog {
2627
private readonly areas = inject(NavAreasService);

ui/webapp/src/app/modules/primary/instances/components/files-display/files-display.component.html

Lines changed: 101 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,18 @@
22
<app-bd-dialog-toolbar header="{{isDataFiles?'Data':'Log'}} Files">
33
<div class="flex-auto"></div>
44
@if (cfg.isCentral$ | async) {
5-
<app-bd-server-sync-button [server]="instance?.managedServer"></app-bd-server-sync-button>
6-
<mat-divider [vertical]="true"></mat-divider>
5+
<app-bd-server-sync-button [server]="instance?.managedServer"></app-bd-server-sync-button>
6+
<mat-divider [vertical]="true"></mat-divider>
77
}
88
@if (isDataFiles) {
9-
<app-bd-panel-button
10-
icon="add"
11-
text="Add File..."
12-
[collapsed]="false"
13-
color="primary"
14-
[disabled]="(loading$ | async) || (noactive$ | async) || !(authService.isCurrentScopeWrite$ | async)"
15-
[route]="['panels', 'instances', 'data-files', 'add']"
16-
></app-bd-panel-button>
9+
<app-bd-panel-button
10+
icon="add"
11+
text="Add File..."
12+
[collapsed]="false"
13+
color="primary"
14+
[disabled]="(loading$ | async) || (noactive$ | async) || (remoteDirs$ | async)?.length < 1 || !(authService.isCurrentScopeWrite$ | async)"
15+
[route]="['panels', 'instances', 'data-files', 'add']"
16+
></app-bd-panel-button>
1717
}
1818
<app-bd-panel-button
1919
#bulkMode
@@ -34,109 +34,97 @@
3434
</app-bd-dialog-toolbar>
3535
<app-bd-dialog-content>
3636
@if (noactive$ | async) {
37-
<app-bd-no-data
38-
>The current instance does not have an active version yet. {{isDataFiles?'Data':'Log'}} files are not yet
39-
available.</app-bd-no-data
40-
>
41-
} @else {
42-
@if (servers.isCurrentInstanceSynchronized$ | async) {
43-
@if ((remoteDirs$ | async)?.length > 1) {
44-
<mat-tab-group
45-
animationDuration="0ms"
46-
[selectedIndex]="tabIndex"
47-
(selectedTabChange)="onTabChange($event)"
48-
>
49-
@for (node of remoteDirs$ | async; track node) {
50-
<mat-tab [label]="node.minion"> </mat-tab>
51-
}
52-
</mat-tab-group>
53-
}
54-
<div class="mt-2 mx-1.5">
55-
@if (selectedPath) {
56-
<app-bd-breadcrumbs [crumbs]="selectedPath.crumbs"></app-bd-breadcrumbs>
57-
}
58-
</div>
59-
<app-bd-data-table
60-
[records]="records$ | async"
61-
[columns]="columns"
62-
[searchable]="false"
63-
(recordClick)="onClick($event)"
64-
[checkMode]="bulkMode.toggle && !!bulkMode.rla?.isActive"
65-
[(checked)]="filesBulkService.selection"
66-
>
67-
<app-bd-no-data>
68-
<p>No data available. This either means that the instance has no active version, or no files exist.</p>
69-
<p>Try to refresh to fetch current information from the node(s).</p>
70-
<app-bd-button
71-
text="Refresh"
72-
icon="refresh"
73-
(click)="load(instance)"
74-
[collapsed]="false"
75-
[loadingWhen$]="loading$"
76-
[disabled]="loading$ | async"
77-
></app-bd-button>
78-
</app-bd-no-data>
79-
</app-bd-data-table>
80-
} @else {
81-
<app-bd-no-data>
82-
<p class="text-center">
83-
<strong>{{ instance?.instanceConfiguration?.name }}</strong> is not synchronized with the controlling server
84-
<strong>{{ instance?.managedServer?.hostName }}</strong>
85-
</p>
86-
<p>Synchronize the instance to view {{isDataFiles?'data':'log'}} files.</p>
87-
<app-bd-server-sync-button [collapsed]="false" [server]="instance.managedServer"></app-bd-server-sync-button>
88-
</app-bd-no-data>
37+
<app-bd-no-data
38+
>The current instance does not have an active version yet. {{isDataFiles?'Data':'Log'}} files are not yet
39+
available.</app-bd-no-data
40+
>
41+
} @else { @if (servers.isCurrentInstanceSynchronized$ | async) { @if ((remoteDirs$ | async)?.length > 1) {
42+
<mat-tab-group animationDuration="0ms" [selectedIndex]="tabIndex" (selectedTabChange)="onTabChange($event)">
43+
@for (node of remoteDirs$ | async; track node) {
44+
<mat-tab [label]="node.minion"> </mat-tab>
45+
}
46+
</mat-tab-group>
47+
}
48+
<div class="mt-2 mx-1.5">
49+
@if (selectedPath) {
50+
<app-bd-breadcrumbs [crumbs]="selectedPath.crumbs"></app-bd-breadcrumbs>
51+
}
52+
</div>
53+
<app-bd-data-table
54+
[records]="records$ | async"
55+
[columns]="columns"
56+
[searchable]="false"
57+
(recordClick)="onClick($event)"
58+
[checkMode]="bulkMode.toggle && !!bulkMode.rla?.isActive"
59+
[(checked)]="filesBulkService.selection"
60+
>
61+
<app-bd-no-data>
62+
<p>No data available. This either means that the instance has no active version, or no files exist.</p>
63+
<p>Try to refresh to fetch current information from the node(s).</p>
64+
<app-bd-button
65+
text="Refresh"
66+
icon="refresh"
67+
(click)="load(instance)"
68+
[collapsed]="false"
69+
[loadingWhen$]="loading$"
70+
[disabled]="loading$ | async"
71+
></app-bd-button>
72+
</app-bd-no-data>
73+
</app-bd-data-table>
74+
} @else {
75+
<app-bd-no-data>
76+
<p class="text-center">
77+
<strong>{{ instance?.instanceConfiguration?.name }}</strong> is not synchronized with the controlling server
78+
<strong>{{ instance?.managedServer?.hostName }}</strong>
79+
</p>
80+
<p>Synchronize the instance to view {{isDataFiles?'data':'log'}} files.</p>
81+
<app-bd-server-sync-button [collapsed]="false" [server]="instance.managedServer"></app-bd-server-sync-button>
82+
</app-bd-no-data>
83+
} }
84+
<ng-template #active>
85+
@if (servers.isCurrentInstanceSynchronized$ | async) { @if ((remoteDirs$ | async)?.length > 1) {
86+
<mat-tab-group animationDuration="0ms" [selectedIndex]="tabIndex" (selectedTabChange)="onTabChange($event)">
87+
@for (node of remoteDirs$ | async; track node) {
88+
<mat-tab [label]="node.minion"> </mat-tab>
8989
}
90+
</mat-tab-group>
9091
}
91-
<ng-template #active>
92-
@if (servers.isCurrentInstanceSynchronized$ | async) {
93-
@if ((remoteDirs$ | async)?.length > 1) {
94-
<mat-tab-group
95-
animationDuration="0ms"
96-
[selectedIndex]="tabIndex"
97-
(selectedTabChange)="onTabChange($event)"
98-
>
99-
@for (node of remoteDirs$ | async; track node) {
100-
<mat-tab [label]="node.minion"> </mat-tab>
101-
}
102-
</mat-tab-group>
103-
}
104-
<div class="mt-2 mx-1.5">
105-
@if (selectedPath) {
106-
<app-bd-breadcrumbs [crumbs]="selectedPath.crumbs"></app-bd-breadcrumbs>
107-
}
108-
</div>
109-
<app-bd-data-table
110-
[records]="records$ | async"
111-
[columns]="columns"
112-
[searchable]="false"
113-
(recordClick)="onClick($event)"
114-
[checkMode]="bulkMode.toggle && !!bulkMode.rla?.isActive"
115-
[(checked)]="filesBulkService.selection"
116-
>
117-
<app-bd-no-data>
118-
<p>No data available. This either means that the instance has no active version, or no files exist.</p>
119-
<p>Try to refresh to fetch current information from the node(s).</p>
120-
<app-bd-button
121-
text="Refresh"
122-
icon="refresh"
123-
(click)="load(instance)"
124-
[collapsed]="false"
125-
[loadingWhen$]="loading$"
126-
[disabled]="loading$ | async"
127-
></app-bd-button>
128-
</app-bd-no-data>
129-
</app-bd-data-table>
130-
} @else {
131-
<app-bd-no-data>
132-
<p class="text-center">
133-
<strong>{{ instance?.instanceConfiguration?.name }}</strong> is not synchronized with the controlling server
134-
<strong>{{ instance?.managedServer?.hostName }}</strong>
135-
</p>
136-
<p>Synchronize the instance to view {{isDataFiles?'data':'log'}} files.</p>
137-
<app-bd-server-sync-button [collapsed]="false" [server]="instance.managedServer"></app-bd-server-sync-button>
138-
</app-bd-no-data>
92+
<div class="mt-2 mx-1.5">
93+
@if (selectedPath) {
94+
<app-bd-breadcrumbs [crumbs]="selectedPath.crumbs"></app-bd-breadcrumbs>
13995
}
140-
</ng-template>
141-
</app-bd-dialog-content>
142-
</app-bd-dialog>
96+
</div>
97+
<app-bd-data-table
98+
[records]="records$ | async"
99+
[columns]="columns"
100+
[searchable]="false"
101+
(recordClick)="onClick($event)"
102+
[checkMode]="bulkMode.toggle && !!bulkMode.rla?.isActive"
103+
[(checked)]="filesBulkService.selection"
104+
>
105+
<app-bd-no-data>
106+
<p>No data available. This either means that the instance has no active version, or no files exist.</p>
107+
<p>Try to refresh to fetch current information from the node(s).</p>
108+
<app-bd-button
109+
text="Refresh"
110+
icon="refresh"
111+
(click)="load(instance)"
112+
[collapsed]="false"
113+
[loadingWhen$]="loading$"
114+
[disabled]="loading$ | async"
115+
></app-bd-button>
116+
</app-bd-no-data>
117+
</app-bd-data-table>
118+
} @else {
119+
<app-bd-no-data>
120+
<p class="text-center">
121+
<strong>{{ instance?.instanceConfiguration?.name }}</strong> is not synchronized with the controlling server
122+
<strong>{{ instance?.managedServer?.hostName }}</strong>
123+
</p>
124+
<p>Synchronize the instance to view {{isDataFiles?'data':'log'}} files.</p>
125+
<app-bd-server-sync-button [collapsed]="false" [server]="instance.managedServer"></app-bd-server-sync-button>
126+
</app-bd-no-data>
127+
}
128+
</ng-template>
129+
</app-bd-dialog-content>
130+
</app-bd-dialog>

0 commit comments

Comments
 (0)