context-dashboard/dashboard-settings/typed-dashboard-settings.component.ts
ControlValueAccessor
OnInit
providers |
{
provide: NG_VALUE_ACCESSOR, useExisting: forwardRef(() => TypedDashboardSettingsComponent), multi: true
}
|
selector | c8y-typed-dashboard-settings |
templateUrl | ./typed-dashboard-settings.component.html |
Properties |
Methods |
|
Inputs |
Outputs |
constructor(inventory: InventoryService, interAppService: InterAppService, route: ActivatedRoute)
|
||||||||||||
Parameters :
|
allowTypeDashboard |
Type : AllowTypeDashboard
|
deviceTypeValue |
Type : string
|
displayDeviceTypeValue |
Type : string
|
formInvalid |
Type : boolean
|
isDevice |
Type : boolean
|
mo |
Type : ContextDashboardManagedObject
|
onDuplicateWithoutType |
Type : EventEmitter
|
Async goToDeviceView |
goToDeviceView()
|
Returns :
Promise<void>
|
markAsTouched |
markAsTouched()
|
Returns :
void
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
registerOnChange | ||||||
registerOnChange(fn: any)
|
||||||
Parameters :
Returns :
void
|
registerOnTouched | ||||||
registerOnTouched(onTouched: any)
|
||||||
Parameters :
Returns :
void
|
setDisabledState | ||||||
setDisabledState(disabled: boolean)
|
||||||
Parameters :
Returns :
void
|
Async toggle |
toggle()
|
Returns :
Promise<void>
|
writeValue | ||||||
writeValue(value: boolean)
|
||||||
Parameters :
Returns :
void
|
context |
Type : any
|
deviceManagementAppKey |
Type : SupportedAppKey
|
Default value : SupportedApps.devicemanagement
|
deviceManagementLinkTitle |
Default value : gettext('Device Info page in {{ deviceManagementAppName }}')
|
deviceTypeInstancesCount |
Type : number
|
disabled |
Default value : false
|
infoText |
Type : string
|
onChange |
Default value : () => {...}
|
onTouched |
Default value : () => {...}
|
showSourceNavigationLink$ |
Type : Observable<boolean>
|
touched |
Default value : false
|
typedDashboardStatus |
Type : string
|
userDeviceManagementApp$ |
Type : Observable<IApplication>
|
value |
Type : boolean
|
<fieldset class="c8y-fieldset c8y-fieldset--lg">
<legend>{{ 'Dashboard template' | translate }}</legend>
<div class="d-flex p-b-16 gap-16">
<label class="c8y-switch flex-no-shrink">
<input
type="checkbox"
[checked]="value"
[disabled]="disabled"
(click)="toggle()"
/>
<span></span>
<span>{{ typedDashboardStatus | translate }}</span>
</label>
<div class="flex-grow d-flex d-col">
<div
class="flex-grow"
[innerHtml]="infoText | translate: { displayDeviceTypeValue: displayDeviceTypeValue }"
></div>
<button
class="btn-link p-0 m-r-auto"
type="button"
*ngIf="allowTypeDashboard === 'allow_if_type_filled' && showSourceNavigationLink$ | async"
(click)="goToDeviceView()"
>
{{
deviceManagementLinkTitle
| translate
: {
deviceManagementAppName:
userDeviceManagementApp$ | async | humanizeAppName | async
}
}}
<i c8yIcon="external-link"></i>
</button>
</div>
</div>
<c8y-type-dashboard-info
*ngIf="allowTypeDashboard === 'allow'"
[context]="mo"
[deviceTypeValue]="deviceTypeValue"
[displayDeviceTypeValue]="displayDeviceTypeValue"
></c8y-type-dashboard-info>
<div
class="p-t-8 p-b-16"
*ngIf="mo?.c8y_Dashboard && value"
>
<button
class="btn btn-default btn-sm"
type="button"
(click)="onDuplicateWithoutType.emit()"
[disabled]="formInvalid"
>
{{ 'Duplicate as regular dashboard' | translate }}
</button>
</div>
</fieldset>