File

context-dashboard/dashboard-settings/typed-dashboard-settings.component.ts

Implements

ControlValueAccessor OnInit

Metadata

Index

Properties
Methods
Inputs
Outputs

Constructor

constructor(inventory: InventoryService, interAppService: InterAppService, route: ActivatedRoute)
Parameters :
Name Type Optional
inventory InventoryService No
interAppService InterAppService No
route ActivatedRoute No

Inputs

allowTypeDashboard
Type : AllowTypeDashboard
deviceTypeValue
Type : string
displayDeviceTypeValue
Type : string
formInvalid
Type : boolean
isDevice
Type : boolean
mo
Type : ContextDashboardManagedObject

Outputs

onDuplicateWithoutType
Type : EventEmitter

Methods

Async goToDeviceView
goToDeviceView()
Returns : Promise<void>
markAsTouched
markAsTouched()
Returns : void
Async ngOnInit
ngOnInit()
Returns : any
registerOnChange
registerOnChange(fn: any)
Parameters :
Name Type Optional
fn any No
Returns : void
registerOnTouched
registerOnTouched(onTouched: any)
Parameters :
Name Type Optional
onTouched any No
Returns : void
setDisabledState
setDisabledState(disabled: boolean)
Parameters :
Name Type Optional
disabled boolean No
Returns : void
Async toggle
toggle()
Returns : Promise<void>
writeValue
writeValue(value: boolean)
Parameters :
Name Type Optional
value boolean No
Returns : void

Properties

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>

results matching ""

    No results matching ""