Skip to content

Commit a2c6b20

Browse files
authored
Merge pull request ceph#58618 from rhcs-dashboard/mgmt-gateway-ui
mgr/dashboard: add service management for mgmt-gateway Reviewed-by: afreen23 <NOT@FOUND> Reviewed-by: Ankush Behl <[email protected]> Reviewed-by: Redouane Kachach <[email protected]>
2 parents 82e3d59 + bc830a3 commit a2c6b20

File tree

6 files changed

+284
-19
lines changed

6 files changed

+284
-19
lines changed

src/pybind/mgr/dashboard/frontend/cypress/e2e/orchestrator/05-services.e2e-spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,5 +49,14 @@ describe('Services page', () => {
4949

5050
services.deleteService('oauth2-proxy');
5151
});
52+
53+
it('should create and delete a mgmt-gateway service', () => {
54+
services.navigateTo('create');
55+
services.addService('mgmt-gateway');
56+
57+
services.checkExist('mgmt-gateway', true);
58+
59+
services.deleteService('mgmt-gateway');
60+
});
5261
});
5362
});

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/cluster.module.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { NgModule } from '@angular/core';
33
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
44
import { RouterModule } from '@angular/router';
55

6+
import { ComboBoxModule, DropdownModule, CheckboxModule } from 'carbon-components-angular';
7+
68
import { TreeModule } from '@circlon/angular-tree-component';
79
import {
810
NgbActiveModal,
@@ -87,7 +89,10 @@ import { MultiClusterDetailsComponent } from './multi-cluster/multi-cluster-deta
8789
NgbDropdownModule,
8890
NgxPipeFunctionModule,
8991
NgbProgressbarModule,
90-
DashboardV3Module
92+
DashboardV3Module,
93+
ComboBoxModule,
94+
DropdownModule,
95+
CheckboxModule
9196
],
9297
declarations: [
9398
HostsComponent,

src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/services/service-form/service-form.component.html

Lines changed: 110 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,12 @@
2222
i18n>
2323
Authentication must be enabled in an active `mgtm-gateway` service to enable Single Sign-On(SSO) with `oauth2-proxy`
2424
</cd-alert-panel>
25+
<cd-alert-panel *ngIf="serviceForm.controls.service_type.value === 'mgmt-gateway'"
26+
type="info"
27+
spacingClass="mb-3"
28+
i18n>
29+
With an active mgmt-gateway service, the dashboard will continue to be served on {{currentURL}}:{{port}} and all other services will be accessible from {{currentURL}}:{{port}}/service_name
30+
</cd-alert-panel>
2531

2632
<!-- Service type -->
2733
<div class="form-group row">
@@ -1052,25 +1058,106 @@
10521058
</div>
10531059
</ng-container>
10541060

1055-
<!-- RGW, Ingress, iSCSI & Oauth2-proxy -->
1056-
<ng-container *ngIf="!serviceForm.controls.unmanaged.value && ['rgw', 'iscsi', 'ingress', 'oauth2-proxy'].includes(serviceForm.controls.service_type.value)">
1057-
<!-- ssl -->
1061+
<ng-container *ngIf="!serviceForm.controls.unmanaged.value && ['mgmt-gateway'].includes(serviceForm.controls.service_type.value)">
1062+
<!-- port -->
10581063
<div class="form-group row">
1059-
<div class="cd-col-form-offset">
1060-
<div class="custom-control custom-checkbox">
1061-
<input class="custom-control-input"
1062-
id="ssl"
1063-
type="checkbox"
1064-
formControlName="ssl">
1065-
<label class="custom-control-label"
1066-
for="ssl"
1067-
i18n>SSL</label>
1068-
</div>
1064+
<label i18n
1065+
class="cd-col-form-label"
1066+
for="port">Port</label>
1067+
<div class="cd-col-form-input">
1068+
<input id="port"
1069+
class="form-control"
1070+
type="number"
1071+
formControlName="port"
1072+
min="1"
1073+
max="65535">
1074+
<span class="invalid-feedback"
1075+
*ngIf="serviceForm.showError('port', frm, 'pattern')"
1076+
i18n>The entered value needs to be a number.</span>
1077+
<span class="invalid-feedback"
1078+
*ngIf="serviceForm.showError('port', frm, 'min')"
1079+
i18n>The value must be at least 1.</span>
1080+
<span class="invalid-feedback"
1081+
*ngIf="serviceForm.showError('port', frm, 'max')"
1082+
i18n>The value cannot exceed 65535.</span>
10691083
</div>
10701084
</div>
1071-
1085+
<!-- enable_auth -->
1086+
<div class="form-item">
1087+
<fieldset>
1088+
<label class="cds--label"
1089+
for="pools"
1090+
i18n>Authentication</label>
1091+
<cds-checkbox i18n-label
1092+
id="enable_auth"
1093+
name="enable_auth"
1094+
formControlName="enable_auth">
1095+
Enable
1096+
<cd-help-text i18n>
1097+
Allows to enable authentication through an external Identity Provider (IdP) using Single Sign-On (SSO)
1098+
</cd-help-text>
1099+
</cds-checkbox>
1100+
</fieldset>
1101+
</div>
1102+
<!-- ssl_protocols -->
1103+
<div class="form-item">
1104+
<cds-combo-box type="multi"
1105+
label="SSL protocols"
1106+
selectionFeedback="top-after-reopen"
1107+
for="ssl_protocols"
1108+
name="ssl_protocols"
1109+
formControlName="ssl_protocols"
1110+
id="ssl_protocols"
1111+
placeholder="Select protocols..."
1112+
[appendInline]="true"
1113+
[items]="sslProtocolsItems"
1114+
i18n-placeholder
1115+
i18n>
1116+
<cds-dropdown-list></cds-dropdown-list>
1117+
</cds-combo-box>
1118+
</div>
1119+
<!-- ssl_ciphers -->
1120+
<div class="form-group row">
1121+
<label class="cd-col-form-label"
1122+
for="ssl_ciphers">
1123+
<span i18n>SSL ciphers</span>
1124+
</label>
1125+
<div class="cd-col-form-input">
1126+
<div class="input-group">
1127+
<input id="ssl_ciphers"
1128+
class="form-control"
1129+
type="text"
1130+
formControlName="ssl_ciphers"
1131+
placeholder="ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256">
1132+
</div>
1133+
<cd-help-text i18n>Default cipher list used: <a href="https://ssl-config.mozilla.org/#server=nginx"
1134+
target="_blank">https://ssl-config.mozilla.org/#server=nginx</a></cd-help-text>
1135+
<span class="invalid-feedback"
1136+
*ngIf="serviceForm.showError('ssl_ciphers', frm, 'invalidPattern')"
1137+
i18n>Invalid cipher suite. Each cipher must be separated by '-' and each cipher suite must be separated by ':'</span>
1138+
</div>
1139+
</div>
1140+
</ng-container>
1141+
<!-- RGW, Ingress, iSCSI, Oauth2-proxy & mgmt-gateway -->
1142+
<ng-container *ngIf="!serviceForm.controls.unmanaged.value && ['rgw', 'iscsi', 'ingress', 'oauth2-proxy', 'mgmt-gateway'].includes(serviceForm.controls.service_type.value)">
1143+
<!-- ssl -->
1144+
<ng-container *ngIf="!['mgmt-gateway'].includes(serviceForm.controls.service_type.value)">
1145+
<div class="form-group row">
1146+
<div class="cd-col-form-offset">
1147+
<div class="custom-control custom-checkbox">
1148+
<input class="custom-control-input"
1149+
id="ssl"
1150+
type="checkbox"
1151+
formControlName="ssl">
1152+
<label class="custom-control-label"
1153+
for="ssl"
1154+
i18n>SSL</label>
1155+
</div>
1156+
</div>
1157+
</div>
1158+
</ng-container>
10721159
<!-- ssl_cert -->
1073-
<div *ngIf="serviceForm.controls.ssl.value"
1160+
<div *ngIf="serviceForm.controls.ssl.value || ['mgmt-gateway'].includes(serviceForm.controls.service_type.value)"
10741161
class="form-group row">
10751162
<label class="cd-col-form-label"
10761163
for="ssl_cert">
@@ -1095,7 +1182,7 @@
10951182
</div>
10961183

10971184
<!-- ssl_key -->
1098-
<div *ngIf="serviceForm.controls.ssl.value && !(['rgw', 'ingress'].includes(serviceForm.controls.service_type.value))"
1185+
<div *ngIf="(serviceForm.controls.ssl.value && !(['rgw', 'ingress'].includes(serviceForm.controls.service_type.value))) || ['mgmt-gateway'].includes(serviceForm.controls.service_type.value)"
10991186
class="form-group row">
11001187
<label class="cd-col-form-label"
11011188
for="ssl_key">
@@ -1178,6 +1265,13 @@
11781265
</div>
11791266
</div>
11801267
</ng-container>
1268+
1269+
<cd-alert-panel *ngIf="serviceForm.controls.service_type.value === 'mgmt-gateway' && showMgmtGatewayMessage"
1270+
type="warning"
1271+
spacingClass="mb-3"
1272+
i18n>
1273+
Modifying the default settings could lead to a weaker security configuration
1274+
</cd-alert-panel>
11811275
</div>
11821276

11831277
<div class="modal-footer">

0 commit comments

Comments
 (0)