File

device-profile/device-profile-list.component.ts

Implements

OnInit

Metadata

Index

Properties
Methods

Constructor

constructor(repositoryService: RepositoryService, gridService: DataGridService, modalService: ModalService, bsModalService: BsModalService, translateService: TranslateService, alertService: AlertService, router: Router, activatedRoute: ActivatedRoute, deviceProfileService: DeviceProfileService)
Parameters :
Name Type Optional
repositoryService RepositoryService No
gridService DataGridService No
modalService ModalService No
bsModalService BsModalService No
translateService TranslateService No
alertService AlertService No
router Router No
activatedRoute ActivatedRoute No
deviceProfileService DeviceProfileService No

Methods

Async createDeviceProfile
createDeviceProfile()
Returns : any
Async deleteDeviceProfile
deleteDeviceProfile(deviceProfile)
Parameters :
Name Optional
deviceProfile No
Returns : any
Async duplicateDeviceProfile
duplicateDeviceProfile(deviceProfile)
Parameters :
Name Optional
deviceProfile No
Returns : any
editDeviceProfile
editDeviceProfile(deviceProfile: Partial)
Parameters :
Name Type Optional
deviceProfile Partial<IManagedObject> No
Returns : void
ngOnInit
ngOnInit()
Returns : void
Async onDataSourceModifier
onDataSourceModifier(dataSourceModifier: DataSourceModifier)
Parameters :
Name Type Optional
dataSourceModifier DataSourceModifier No
trackByName
trackByName(_index, column: Column)
Parameters :
Name Type Optional
_index No
column Column No
Returns : string

Properties

actionControls
Type : ActionControl[]
Default value : []
columns
Type : Column[]
Default value : [ new RepositoryItemNameGridColumn({ filterLabel: gettext('Filter device profile by name'), placeholder: gettext('ubuntu core') }), new DeviceTypeGridColumn({ filterLabel: gettext('Filter device profile by device type') }) ]
isDataPresent$
Type : Observable<boolean>
Default value : from( this.repositoryService.listRepositoryEntries(RepositoryType.PROFILE, { skipLegacy: true }) ).pipe(map(({ data }) => data.length > 0))
noDataMessage
Default value : gettext('No device profiles to display.')
noDataSubtitle
Default value : gettext('Add a new device profile by clicking below.')
noResultsMessage
Default value : gettext('No results to display.')
noResultsSubtitle
Default value : gettext('Refine your search terms or check your spelling.')
pagination
Type : object
Default value : { pageSize: 50, currentPage: 1 }
productExperienceEvent
Type : ProductExperienceEvent
Default value : { eventName: PRODUCT_EXPERIENCE_DEVICE_PROFILE.EVENTS.REPOSITORY, data: { component: PRODUCT_EXPERIENCE_DEVICE_PROFILE.COMPONENTS.DEVICE_PROFILE_LIST } }
refresh$
Type : EventEmitter<void>
Default value : new EventEmitter()
serverSideDataCallback
Type : ServerSideDataCallback
sizeRequest
Type : Promise<number>
sizeRequestDone
Default value : false
<c8y-title>{{ 'Device profiles' | translate }}</c8y-title>

<c8y-breadcrumb>
  <c8y-breadcrumb-item
    icon="c8y-management"
    label="{{ 'Management' | translate }}"
  ></c8y-breadcrumb-item>
  <c8y-breadcrumb-item
    icon="c8y-device-profile"
    label="{{ 'Device profiles' | translate }}"
  ></c8y-breadcrumb-item>
</c8y-breadcrumb>

<c8y-action-bar-item [placement]="'right'">
  <button
    class="btn btn-link"
    title="{{ 'Add device profile' | translate }}"
    data-cy="device-profile-list--Add-device-profile"
    (click)="createDeviceProfile()"
  >
    <i c8yIcon="plus-circle"></i>
    {{ 'Add device profile' | translate }}
  </button>
</c8y-action-bar-item>

<c8y-help
  src="/docs/device-management-application/managing-device-data/#managing-device-profiles"
></c8y-help>

<div class="content-fullpage border-top border-bottom">
  <c8y-data-grid
    [title]="'Device profiles' | translate"
    [refresh]="refresh$"
    [pagination]="pagination"
    [columns]="columns"
    [actionControls]="actionControls"
    [infiniteScroll]="'auto'"
    [serverSideDataCallback]="serverSideDataCallback"
  >
    <c8y-ui-empty-state
      [icon]="stats?.size > 0 ? 'search' : 'c8y-tools'"
      [title]="stats?.size > 0 ? (noResultsMessage | translate) : (noDataMessage | translate)"
      [subtitle]="stats?.size > 0 ? (noResultsSubtitle | translate) : (noDataSubtitle | translate)"
      *emptyStateContext="let stats"
      [horizontal]="stats?.size > 0"
    >
      <p *ngIf="stats?.size === 0">
        <button
          class="btn btn-primary"
          title="{{ 'Add device profile' | translate }}"
          type="button"
          (click)="createDeviceProfile()"
        >
          {{ 'Add device profile' | translate }}
        </button>
      </p>
    </c8y-ui-empty-state>
    <ng-container *ngFor="let column of columns; trackBy: trackByName">
      <c8y-column [name]="column.name"></c8y-column>
    </ng-container>
  </c8y-data-grid>
</div>

results matching ""

    No results matching ""