Skip to content

Commit edf5f6d

Browse files
authored
Merge pull request ceph#60819 from rhcs-dashboard/smb-cluster-form
mgr/dashboard: create smb cluster Reviewed-by: Afreen Misbah <[email protected]>
2 parents 880c3db + 3571c6d commit edf5f6d

19 files changed

+1140
-52
lines changed

src/pybind/mgr/dashboard/frontend/src/app/app-routing.module.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ import { MultiClusterComponent } from './ceph/cluster/multi-cluster/multi-cluste
5252
import { MultiClusterListComponent } from './ceph/cluster/multi-cluster/multi-cluster-list/multi-cluster-list.component';
5353
import { MultiClusterDetailsComponent } from './ceph/cluster/multi-cluster/multi-cluster-details/multi-cluster-details.component';
5454
import { SmbClusterListComponent } from './ceph/smb/smb-cluster-list/smb-cluster-list.component';
55+
import { SmbClusterFormComponent } from './ceph/smb/smb-cluster-form/smb-cluster-form.component';
5556

5657
@Injectable()
5758
export class PerformanceCounterBreadcrumbsResolver extends BreadcrumbsResolver {
@@ -444,7 +445,14 @@ const routes: Routes = [
444445
},
445446
breadcrumbs: 'File/SMB'
446447
},
447-
children: [{ path: '', component: SmbClusterListComponent }]
448+
children: [
449+
{ path: '', component: SmbClusterListComponent },
450+
{
451+
path: `${URLVerbs.CREATE}`,
452+
component: SmbClusterFormComponent,
453+
data: { breadcrumbs: ActionLabels.CREATE }
454+
}
455+
]
448456
}
449457
]
450458
},

src/pybind/mgr/dashboard/frontend/src/app/ceph/block/rbd-trash-move-modal/rbd-trash-move-modal.component.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ describe('RbdTrashMoveModalComponent', () => {
104104
component.moveImage();
105105
const req = httpTesting.expectOne('api/block/image/foo%2Fbar/move_trash');
106106
req.flush(null);
107-
expect(req.request.body.delay).toBeGreaterThan(76390);
107+
expect(req.request.body.delay).toBeGreaterThan(56666);
108108
});
109109
});
110110
});

src/pybind/mgr/dashboard/frontend/src/app/ceph/cephfs/cephfs-snapshotschedule-form/cephfs-snapshotschedule-form.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@
126126
<div cdsCol
127127
[columnNumbers]="{lg: 1}"
128128
class="item-action-btn">
129-
<cds-icon-button kind="tertiary"
129+
<cds-icon-button kind="danger"
130130
size="sm"
131131
(click)="removeRetentionPolicy(i)">
132132
<svg cdsIcon="trash-can"
Lines changed: 330 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,330 @@
1+
<div cdsCol
2+
[columnNumbers]="{ md: 4 }"
3+
*ngIf="orchStatus$ | async as orchStatus">
4+
<form name="smbForm"
5+
#formDir="ngForm"
6+
[formGroup]="smbForm"
7+
novalidate>
8+
<div i18n="form title"
9+
class="form-header">
10+
{{ action | titlecase }} {{ resource | upperFirst }}
11+
</div>
12+
13+
<!-- Cluster Id -->
14+
<div class="form-item">
15+
<cds-text-label
16+
labelInputID="cluster_id"
17+
i18n
18+
helperText="Unique cluster identifier"
19+
i18n-helperText
20+
cdRequiredField="Cluster Name"
21+
[invalid]="smbForm.controls.cluster_id.invalid && smbForm.controls.cluster_id.dirty"
22+
[invalidText]="clusterError"
23+
>Cluster Name
24+
<input
25+
cdsText
26+
type="text"
27+
placeholder="Cluster Name..."
28+
i18n-placeholder
29+
id="cluster_id"
30+
formControlName="cluster_id"
31+
[invalid]="smbForm.controls.cluster_id.invalid && smbForm.controls.cluster_id.dirty"
32+
/>
33+
</cds-text-label>
34+
<ng-template #clusterError>
35+
<span
36+
class="invalid-feedback"
37+
*ngIf="smbForm.showError('cluster_id', formDir, 'required')"
38+
i18n
39+
>This field is required.</span
40+
>
41+
</ng-template>
42+
</div>
43+
44+
<!-- Auth Mode -->
45+
<div class="form-item">
46+
<cds-select
47+
formControlName="auth_mode"
48+
label="Authentication Mode"
49+
cdRequiredField="Authentication Mode"
50+
id="auth_mode"
51+
[invalid]="smbForm.controls.auth_mode.invalid && smbForm.controls.auth_mode.dirty"
52+
[invalidText]="authModeError"
53+
(change)="onAuthModeChange()"
54+
helperText="Active-directory authentication for domain member servers and User authentication for
55+
Stand-alone servers configuration."
56+
i18n-helperText
57+
>
58+
<option value="active-directory"
59+
i18n>Active Directory</option>
60+
<option value="user"
61+
i18n>User</option>
62+
</cds-select>
63+
<ng-template #authModeError>
64+
<span
65+
class="invalid-feedback"
66+
*ngIf="smbForm.showError('auth_mode', formDir, 'required')"
67+
i18n
68+
>This field is required.</span
69+
>
70+
</ng-template>
71+
</div>
72+
73+
<!-- Domain Settings -->
74+
<div class="form-item"
75+
*ngIf="this.smbForm.get('auth_mode').value === 'active-directory'">
76+
<div cdsCol
77+
[columnNumbers]="{ md: 12 }"
78+
class="d-flex">
79+
<cds-text-label labelInputID="domain_settings"
80+
i18n
81+
cdRequiredField="Domain Settings">Domain Settings
82+
<div class="cds-input-group">
83+
<input
84+
cdsText
85+
type="text"
86+
placeholder="Domain Settings..."
87+
i18n-placeholder
88+
id="domain_settings"
89+
formControlName="domain_settings"
90+
[value]="domainSettingsObject?.realm"
91+
(click)="editDomainSettingsModal()"
92+
[invalid]="
93+
!smbForm.controls.domain_settings.valid &&
94+
smbForm.controls.domain_settings.dirty &&
95+
smbForm.controls.domain_settings.touched
96+
"
97+
/>
98+
<cds-icon-button kind="ghost"
99+
(click)="editDomainSettingsModal()"
100+
size="md">
101+
<svg cdsIcon="edit"
102+
size="32"
103+
class="cds--btn__icon"
104+
icon></svg>
105+
</cds-icon-button>
106+
107+
<cds-icon-button kind="danger"
108+
(click)="deleteDomainSettingsModal()"
109+
size="md">
110+
<svg cdsIcon="trash-can"
111+
size="32"
112+
class="cds--btn__icon"
113+
icon></svg>
114+
</cds-icon-button>
115+
</div>
116+
</cds-text-label>
117+
</div>
118+
<span
119+
class="invalid-feedback"
120+
*ngIf="
121+
smbForm.get('domain_settings').hasError('required') &&
122+
smbForm.controls.domain_settings.touched
123+
"
124+
i18n>Specify the Realm and Join Sources in the Domain Settings field.</span
125+
>
126+
<div></div>
127+
</div>
128+
129+
<!-- User Group Settings -->
130+
<ng-container formArrayName="joinSources"
131+
*ngFor="let dns of joinSources.controls; index as i">
132+
<div
133+
cdsRow
134+
*ngIf="this.smbForm.get('auth_mode').value === 'user'"
135+
class="form-item form-item-append"
136+
>
137+
<div cdsCol
138+
[columnNumbers]="{ lg: 14 }">
139+
<cds-text-label for="joinSources"
140+
i18n
141+
cdRequiredField="User Group Id">User Group Id
142+
<input
143+
cdsText
144+
type="text"
145+
placeholder="User Group Id"
146+
i18n-placeholder
147+
[id]="'joinSources-' + i"
148+
[formControlName]="i"
149+
[invalid]="
150+
smbForm.controls['joinSources'].controls[i].invalid &&
151+
smbForm.controls['joinSources'].dirty
152+
"
153+
/>
154+
</cds-text-label>
155+
<ng-template #refError>
156+
<span
157+
class="invalid-feedback"
158+
*ngIf="smbForm.showError('joinSources[i]', formDir, 'required')"
159+
i18n
160+
>This field is required.</span
161+
>
162+
</ng-template>
163+
</div>
164+
<div cdsCol
165+
[columnNumbers]="{ lg: 1 }">
166+
<cds-icon-button
167+
kind="danger"
168+
*ngIf="i > 0"
169+
size="sm"
170+
(click)="removeUserGroupSetting(i)"
171+
>
172+
<svg cdsIcon="trash-can"
173+
size="32"
174+
class="cds--btn__icon"></svg>
175+
</cds-icon-button>
176+
</div>
177+
</div>
178+
</ng-container>
179+
180+
<div class="form-item"
181+
*ngIf="this.smbForm.get('auth_mode').value === 'user'">
182+
<button cdsButton="tertiary"
183+
type="button"
184+
(click)="addUserGroupSetting()"
185+
i18n>
186+
Add User Group Id
187+
<svg cdsIcon="add"
188+
size="32"
189+
class="cds--btn__icon"
190+
icon></svg>
191+
</button>
192+
</div>
193+
194+
<!-- Placement -->
195+
<ng-container *ngIf="orchStatus.available">
196+
<div class="form-item">
197+
<cds-select
198+
label="Placement"
199+
for="placement"
200+
formControlName="placement"
201+
id="placement"
202+
>
203+
<option value="hosts"
204+
i18n>Hosts</option>
205+
<option value="label"
206+
i18n>Labels</option>
207+
</cds-select>
208+
</div>
209+
<ng-container *ngIf="hostsAndLabels$ | async as data">
210+
<!-- Label -->
211+
<div *ngIf="smbForm.controls.placement.value === 'label'"
212+
class="form-item">
213+
<cds-combo-box
214+
type="multi"
215+
selectionFeedback="top-after-reopen"
216+
label="Label"
217+
formControlName="label"
218+
id="label"
219+
placeholder="Select labels..."
220+
[appendInline]="true"
221+
[items]="data.labels"
222+
i18n-placeholder
223+
(selected)="multiSelector($event, 'label')"
224+
[invalid]="smbForm.controls.label.invalid && smbForm.controls.label.dirty"
225+
[invalidText]="labelError"
226+
cdRequiredField="Label"
227+
i18n
228+
>
229+
<cds-dropdown-list></cds-dropdown-list>
230+
</cds-combo-box>
231+
<ng-template #labelError>
232+
<span
233+
class="invalid-feedback"
234+
*ngIf="smbForm.showError('label', formDir, 'required')"
235+
i18n
236+
>This field is required.</span
237+
>
238+
</ng-template>
239+
</div>
240+
241+
<!-- Hosts -->
242+
<div *ngIf="smbForm.controls.placement.value === 'hosts'"
243+
class="form-item">
244+
<cds-combo-box
245+
type="multi"
246+
selectionFeedback="top-after-reopen"
247+
label="Hosts"
248+
formControlName="hosts"
249+
id="hosts"
250+
placeholder="Select hosts..."
251+
i18n-placeholder
252+
[appendInline]="true"
253+
[items]="data.hosts"
254+
(selected)="multiSelector($event, 'hosts')"
255+
i18n
256+
>
257+
<cds-dropdown-list></cds-dropdown-list>
258+
</cds-combo-box>
259+
</div>
260+
</ng-container>
261+
</ng-container>
262+
263+
<div class="form-item">
264+
<cds-number
265+
[id]="'count'"
266+
[formControlName]="'count'"
267+
[label]="'Count'"
268+
[min]="1"
269+
></cds-number>
270+
</div>
271+
272+
<!-- Clustering -->
273+
<div class="form-item">
274+
<cds-select
275+
formControlName="clustering"
276+
for="clustering"
277+
label="Clustering"
278+
id="clustering"
279+
helperText="Control if a cluster abstraction actually uses Samba’s clustering mechanism."
280+
i18n-helperText
281+
>
282+
<option *ngFor="let data of allClustering"
283+
i18n>{{ data | upperFirst }}</option>
284+
</cds-select>
285+
</div>
286+
287+
<!-- Custom DNS -->
288+
<ng-container formArrayName="custom_dns"
289+
*ngFor="let dns of custom_dns.controls; index as i">
290+
<div cdsRow
291+
class="form-item form-item-append">
292+
<div cdsCol
293+
[columnNumbers]="{ lg: 14 }">
294+
<input cdsText
295+
[formControlName]="i"
296+
placeholder="Custom DNS"/>
297+
</div>
298+
<div cdsCol
299+
[columnNumbers]="{ lg: 1 }">
300+
<cds-icon-button kind="danger"
301+
size="sm"
302+
(click)="removeCustomDNS(i)">
303+
<svg cdsIcon="trash-can"
304+
size="32"
305+
class="cds--btn__icon"></svg>
306+
</cds-icon-button>
307+
</div>
308+
</div>
309+
</ng-container>
310+
311+
<div class="form-item">
312+
<button cdsButton="tertiary"
313+
type="button"
314+
(click)="addCustomDns()"
315+
i18n>
316+
Add Custom DNS
317+
<svg cdsIcon="add"
318+
size="32"
319+
class="cds--btn__icon"
320+
icon></svg>
321+
</button>
322+
</div>
323+
<cd-form-button-panel
324+
(submitActionEvent)="submitAction()"
325+
[form]="smbForm"
326+
[submitText]="(action | titlecase) + ' ' + (resource | upperFirst)"
327+
wrappingClass="text-right"
328+
></cd-form-button-panel>
329+
</form>
330+
</div>

src/pybind/mgr/dashboard/frontend/src/app/ceph/smb/smb-cluster-form/smb-cluster-form.component.scss

Whitespace-only changes.

0 commit comments

Comments
 (0)