File
Metadata
selector |
cd-rgw-user-swift-key-modal |
styleUrls |
./rgw-user-swift-key-modal.component.scss |
templateUrl |
./rgw-user-swift-key-modal.component.html |
Constructor
constructor(bsModalRef: BsModalRef, i18n: I18n, actionLabels: ActionLabelsI18n)
|
|
Parameters :
Name |
Type |
Optional |
bsModalRef |
BsModalRef
|
No
|
i18n |
I18n
|
No
|
actionLabels |
ActionLabelsI18n
|
No
|
|
Methods
setValues
|
setValues(user: string, secret_key: string)
|
|
Set the values displayed in the dialog.
|
Public
bsModalRef
|
Type : BsModalRef
|
|
import { Component } from '@angular/core';
import { I18n } from '@ngx-translate/i18n-polyfill';
import { BsModalRef } from 'ngx-bootstrap/modal';
import { ActionLabelsI18n } from '../../../shared/constants/app.constants';
@Component({
selector: 'cd-rgw-user-swift-key-modal',
templateUrl: './rgw-user-swift-key-modal.component.html',
styleUrls: ['./rgw-user-swift-key-modal.component.scss']
})
export class RgwUserSwiftKeyModalComponent {
user: string;
secret_key: string;
resource: string;
action: string;
constructor(
public bsModalRef: BsModalRef,
private i18n: I18n,
public actionLabels: ActionLabelsI18n
) {
this.resource = this.i18n('Swift Key');
this.action = this.actionLabels.SHOW;
}
/**
* Set the values displayed in the dialog.
*/
setValues(user: string, secret_key: string) {
this.user = user;
this.secret_key = secret_key;
}
}
<div class="modal-header">
<h4 i18n="form title|Example: Create Pool@@formTitle"
class="modal-title pull-left">{{ action | titlecase }} {{ resource | upperFirst }}</h4>
<button type="button"
class="close pull-right"
aria-label="Close"
(click)="bsModalRef.hide()">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<form class="form-horizontal"
novalidate>
<!-- Username -->
<div class="form-group">
<label class="control-label col-sm-3"
for="user"
i18n>Username</label>
<div class="col-sm-9">
<input id="user"
name="user"
class="form-control"
type="text"
[readonly]="true"
[(ngModel)]="user">
</div>
</div>
<!-- Secret key -->
<div class="form-group">
<label class="control-label col-sm-3"
for="secret_key"
i18n>Secret key</label>
<div class="col-sm-9">
<div class="input-group">
<input id="secret_key"
name="secret_key"
class="form-control"
type="password"
[(ngModel)]="secret_key"
[readonly]="true">
<span class="input-group-btn">
<button type="button"
class="btn btn-default"
cdPasswordButton="secret_key">
</button>
<button type="button"
class="btn btn-default"
cdCopy2ClipboardButton="secret_key">
</button>
</span>
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<cd-back-button [back]="bsModalRef.hide"></cd-back-button>
</div>
Legend
Html element with directive