Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/cephPublic

Wip 74233 tentacle : mgr/dashboard: carbonized-multisite-export-realm-token-modal#66649

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
sagargopale2233 wants to merge1 commit intoceph:tentacle
base:tentacle
Choose a base branch
Loading
fromrhcs-dashboard:wip-74233-tentacle
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Signed-off-by: Sagar Gopale <sagar.gopale@ibm.com>(cherry picked from commit25644b4) Conflicts:src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-export/rgw-multisite-export.component.html
  • Loading branch information
Sagar Gopale committedDec 16, 2025
commit5fe36233fe7ac161cedbe0e6b3d0e82458b072b5
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -66,3 +66,8 @@ export interface Zone {
added: string[];
removed: string[];
}

export interface RgwRealmToken {
realm: string;
token: string;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -193,9 +193,7 @@ export class RgwMultisiteDetailsComponent implements OnDestroy, OnInit {
defaultsInfo: this.defaultsInfo,
multisiteInfo: this.multisiteInfo
};
this.bsModalRef = this.modalService.show(RgwMultisiteExportComponent, initialState, {
size: 'lg'
});
this.cdsModalService.show(RgwMultisiteExportComponent, initialState);
}

getDisableExport() {
Expand Down
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,65 +1,89 @@
<cd-modal [modalRef]="activeModal">
<ng-container i18n="form title"
class="modal-title">Export Multi-site Realm Token</ng-container>
<cds-modal
size="sm"
[open]="open"
[hasScrollingContent]="true"
(overlaySelected)="closeModal()"
>
<cds-modal-header
(closeSelect)="closeModal()"
i18n
>
Export multi-site realm token
</cds-modal-header>

<ng-container class="modal-content">
<form name="exportTokenForm"
#frm="ngForm"
[formGroup]="exportTokenForm">
<span *ngIf="loading"
class="d-flex justify-content-center">
<i [ngClass]="[icons.large3x, icons.spinner, icons.spin]"></i></span>
<div class="modal-body"
*ngIf="!loading">
<cd-alert-panel *ngIf="!tokenValid"
type="warning"
class="mx-3"
i18n>
<div *ngFor="let realminfo of realms">
<b>{{realminfo.realm}}</b> -
{{realminfo.token}}
</div>
</cd-alert-panel>
<div *ngFor="let realminfo of realms">
<div class="form-group row">
<label class="cd-col-form-label"
for="realmName"
i18n>Realm Name
</label>
<div class="cd-col-form-input">
<input id="realmName"
name="realmName"
type="text"
value="{{ realminfo.realm }}"
readonly>
</div>
<ng-container *cdFormLoading="loading">
<form
name="exportTokenForm"
[formGroup]="exportTokenForm"
novalidate
>
<div cdsModalContent>
<div class="form-item">
@if (!tokenValid) {
<cd-alert-panel
type="warning"
i18n
>
@for (realminfo of realms; track realminfo) {
<div>
<b>{{ realminfo.realm }}</b> - {{ realminfo.token }}
</div>
}
</cd-alert-panel>
}
</div>
<div class="form-group row">
<label class="cd-col-form-label"
for="token"
i18n>Token
</label>
<div class="cd-col-form-input">
<input id="realmToken"
name="realmToken"
type="text"
value="{{ realminfo.token }}"
class="me-2 mb-4"
readonly>

@for (realminfo of realms; track realminfo) {
<div>
<div class="form-item">
<cds-text-label
labelInputID="realmName"
i18n
>
Realm Name
<input
cdsText
readonly
type="text"
id="realmName"
[value]="realminfo.realm"
modal-primary-focus
[autofocus]="true"
/>
</cds-text-label>
</div>

<div class="form-item form-item-append">
<cds-text-label
labelInputID="realmToken"
i18n
>
Token
<input
cdsText
readonly
type="text"
id="realmToken"
[value]="realminfo.token"
/>
</cds-text-label>
<cd-copy-2-clipboard-button
source="{{ realminfo.token }}"
[byId]="false">
class="clipboard"
[source]="realminfo.token"
[byId]="false"
size="md"
>
</cd-copy-2-clipboard-button>
</div>
<hr *ngIf="realms.length > 1">
</div>
}
</div>
</div>
<div class="modal-footer">
<cd-back-button class="m-2 float-end"
aria-label="Close"
(backAction)="activeModal.close()"></cd-back-button>
</div>
<cd-form-button-panel
[modalForm]="true"
[showSubmit]="false"
(backActionEvent)="closeModal()"
>
</cd-form-button-panel>
</form>
</ng-container>
</cd-modal>
</cds-modal>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
@use '@carbon/layout';

.clipboard {
margin-top: layout.$spacing-06;
}
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,21 +4,19 @@ import { RgwRealmService } from '~/app/shared/api/rgw-realm.service';
import { ActionLabelsI18n } from '~/app/shared/constants/app.constants';
import { CdFormGroup } from '~/app/shared/forms/cd-form-group';
import { NotificationService } from '~/app/shared/services/notification.service';
import {RgwRealm } from '../models/rgw-multisite';
import {RgwRealmToken } from '../models/rgw-multisite';
import { Icons } from '~/app/shared/enum/icons.enum';
import { CdForm } from '~/app/shared/forms/cd-form';

@Component({
selector: 'cd-rgw-multisite-export',
templateUrl: './rgw-multisite-export.component.html',
styleUrls: ['./rgw-multisite-export.component.scss']
})
export class RgwMultisiteExportComponent implements OnInit, AfterViewChecked {
export class RgwMultisiteExportComponentextends CdFormimplements OnInit, AfterViewChecked {
exportTokenForm: CdFormGroup;
realms: any;
realmList: RgwRealm[];
multisiteInfo: any;
realms: RgwRealmToken[];
tokenValid = false;
loading = true;
icons = Icons;

constructor(
Expand All@@ -28,6 +26,7 @@ export class RgwMultisiteExportComponent implements OnInit, AfterViewChecked {
public notificationService: NotificationService,
private readonly changeDetectorRef: ChangeDetectorRef
) {
super();
this.createForm();
}

Expand All@@ -36,17 +35,17 @@ export class RgwMultisiteExportComponent implements OnInit, AfterViewChecked {
}

onSubmit() {
this.activeModal.close();
this.closeModal();
}

ngOnInit(): void {
this.rgwRealmService.getRealmTokens().subscribe((data:object[]) => {
this.loading = false;
this.rgwRealmService.getRealmTokens().subscribe((data:RgwRealmToken[]) => {
this.loadingReady();
this.realms = data;
var base64Matcher = new RegExp(
'^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{4})$'
);
this.realms.forEach((realmInfo:any) => {
this.realms.forEach((realmInfo:RgwRealmToken) => {
if (base64Matcher.test(realmInfo.token)) {
this.tokenValid = true;
} else {
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp