device-profile/add-device-profile.component.ts
selector | c8y-add-device-profile |
templateUrl | ./add-device-profile-component.html |
Properties |
Methods |
constructor(modal: BsModalRef, deviceProfileService: DeviceProfileService)
|
|||||||||
Parameters :
|
close |
close()
|
Returns :
void
|
Async create |
create()
|
Returns :
any
|
DEVICE_TYPE_POPOVER |
Default value : gettext('The device profile will be available for assignments on devices of the specified type. Otherwise, it will be available for all device types.')
|
deviceProfile |
Type : Partial<DeviceProfile>
|
Default value : {
name: '',
type: 'c8y_Profile',
c8y_Filter: {},
c8y_DeviceProfile : {
}
}
|
result |
Type : Promise<any>
|
Default value : new Promise((resolve, reject) => {
this._save = resolve;
this._cancel = reject;
})
|
<div class="viewport-modal">
<div class="modal-header dialog-header">
<i [c8yIcon]="'c8y-device-profile'"></i>
<h4 translate>
Add device profile
</h4>
</div>
<div class="modal-inner-scroll">
<div class="modal-body">
<form #createDeviceProfile="ngForm">
<c8y-form-group>
<label translate for="name">Name</label>
<input
id="name"
type="text"
class="form-control"
autocomplete="off"
name="name"
[(ngModel)]="deviceProfile.name"
placeholder="{{ 'e.g. My device profile' | translate }}"
required
/>
</c8y-form-group>
<c8y-form-group>
<label>
{{ 'Device type' | translate }}
<button
class="btn btn-clean"
popover="{{ DEVICE_TYPE_POPOVER | translate }}"
triggers="focus"
>
<i [c8yIcon]="'question-circle-o'"></i>
</button>
</label>
<input
id="deviceType"
class="form-control"
name="deviceType"
[(ngModel)]="deviceProfile.c8y_Filter.type"
placeholder="{{ 'e.g.' | translate }} c8y_Linux"
/>
</c8y-form-group>
</form>
</div>
</div>
<div class="modal-footer">
<button title="{{ 'Cancel' | translate }}" class="btn btn-default" (click)="close()" translate>
Cancel
</button>
<button
title="{{ 'Continue' | translate }}"
class="btn btn-primary"
(click)="create()"
[disabled]="createDeviceProfile.form.invalid"
translate
>
Continue
</button>
</div>
</div>