File

repository/firmware/list/firmware-list.component.ts

Metadata

Index

Properties
Methods

Constructor

constructor(repositoryService: RepositoryService, gridService: DataGridService, modalService: ModalService, bsModalService: BsModalService, translateService: TranslateService, alertService: AlertService, router: Router, activatedRoute: ActivatedRoute)
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

Methods

addFirmware
addFirmware()
Returns : void
addFirmwarePatch
addFirmwarePatch()
Returns : void
Async deleteFirmware
deleteFirmware(firmware: IManagedObject)
Parameters :
Name Type Optional
firmware IManagedObject No
Returns : any
editFirmware
editFirmware(firmware: Partial)
Parameters :
Name Type Optional
firmware 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 firmware by name'), placeholder: gettext('ubuntu core') }), new DescriptionGridColumn({ filterLabel: gettext('Filter firmware by description'), placeholder: gettext('Firmware for hardware revision B') }), new DeviceTypeGridColumn({ filterLabel: gettext('Filter firmware by device type') }), new VersionsGridColumn() ]
isDataPresent$
Type : Observable<boolean>
Default value : from( this.repositoryService.listRepositoryEntries(RepositoryType.FIRMWARE, { skipLegacy: true }) ).pipe(map(({ data }) => data.length > 0))
noDataMessage
Default value : gettext('No firmware to display.')
noDataSubtitle
Default value : gettext('Add a new firmware 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 }
refresh$
Type : EventEmitter<void>
Default value : new EventEmitter()
serverSideDataCallback
Type : ServerSideDataCallback
sizeRequest
Type : Promise<number>
sizeRequestDone
Default value : false
<c8y-title>
  {{ 'Firmware repository' | translate }}
</c8y-title>

<c8y-breadcrumb>
  <c8y-breadcrumb-item
    icon="c8y-management"
    label="{{ 'Management' | translate }}"
  ></c8y-breadcrumb-item>
  <c8y-breadcrumb-item
    icon="c8y-firmware"
    label="{{ 'Firmware repository' | translate }}"
  ></c8y-breadcrumb-item>
</c8y-breadcrumb>

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

<c8y-action-bar-item [placement]="'right'">
  <button
    class="btn btn-link"
    title="{{ 'Add firmware patch' | translate }}"
    *ngIf="isDataPresent$ | async"
    (click)="addFirmwarePatch()"
  >
    <i c8yIcon="plus-circle"></i>
    {{ 'Add firmware patch' | translate }}
  </button>
</c8y-action-bar-item>

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

<div class="content-fullpage border-top border-bottom">
  <c8y-data-grid
    [title]="'Firmware' | 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 firmware' | translate }}"
          type="button"
          (click)="addFirmware()"
        >
          {{ 'Add firmware' | 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 ""