File
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 id="addDeviceProfileModalTitle">Add device profile</h4>
</div>
<div class="modal-inner-scroll">
<div class="modal-body" id="addDeviceProfileModalDescription">
<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-help btn-help--sm"
[attr.aria-label]="'Help' | translate"
type="button"
popover="{{ DEVICE_TYPE_POPOVER | translate }}"
placement="right"
triggers="focus"
></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 }}"
type="button"
class="btn btn-default"
(click)="close()"
>
{{ 'Cancel' | translate }}
</button>
<button
title="{{ 'Continue' | translate }}"
class="btn btn-primary"
(click)="create()"
[disabled]="createDeviceProfile.form.invalid"
>
{{ 'Continue' | translate }}
</button>
</div>
</div>