repository/configuration/device-tab/configuration-preview.component.ts
selector | c8y-device-configuration-preview |
templateUrl | ./configuration-preview.component.html |
Properties |
Methods |
Inputs |
Accessors |
constructor(deviceConfigurationService: DeviceConfigurationService, operationRealtime: OperationRealtimeService, bsModal: BsModalService, user: UserService, appState: AppStateService, repositoryService: RepositoryService, operationService: OperationService, alertService: AlertService)
|
|||||||||||||||||||||||||||
Parameters :
|
actionButtonIcon |
Type : string
|
actionButtonText |
Type : string
|
canSaveSnapshot |
Type : boolean
|
configSnapshot |
Type : ConfigurationSnapshot
|
configurationType |
Type : string
|
device |
Type : IManagedObject
|
isLegacy |
Type : boolean
|
Default value : false
|
operationToTrigger |
Type : DeviceConfigurationOperation.UPLOAD_CONFIG | DeviceConfigurationOperation.DOWNLOAD_CONFIG
|
Async createDeviceOperation |
createDeviceOperation()
|
Returns :
any
|
download |
download()
|
Returns :
void
|
hasPermission |
hasPermission()
|
Returns :
boolean
|
isCreateOperationDisabled |
isCreateOperationDisabled()
|
Returns :
boolean
|
ngOnDestroy |
ngOnDestroy()
|
Returns :
void
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
Async saveToRepository |
saveToRepository()
|
Returns :
any
|
setCanCallAction |
setCanCallAction()
|
Returns :
void
|
Async setOperation | ||||
setOperation(configType)
|
||||
Parameters :
Returns :
Promise<void>
|
showBinary |
showBinary()
|
Returns :
boolean
|
showOperation |
showOperation()
|
Returns :
boolean
|
updatePreview | ||||||
updatePreview(operation: IOperation)
|
||||||
Parameters :
Returns :
void
|
canCallAction |
Default value : true
|
deviceConfigurationOperation |
Default value : DeviceConfigurationOperation
|
operation |
Type : IOperation
|
configurationType | ||||||
getconfigurationType()
|
||||||
setconfigurationType(type: string)
|
||||||
Parameters :
Returns :
void
|
<div class="content-flex-55 p-b-16">
<div class="col-7 p-t-4">
<p>
<span class="text-label-small text-uppercase m-r-4" translate>Configuration</span>
<span *ngIf="configSnapshot?.name; else emptyText">
<strong>{{ configSnapshot.name }}</strong>
</span>
<ng-template #emptyText> --- </ng-template>
</p>
<p>
<span class="text-label-small text-uppercase m-r-4" translate>Last updated</span>
<small *ngIf="configSnapshot?.time; else emptyDate">
{{ configSnapshot.time | c8yDate }}
</small>
<ng-template #emptyDate> --- </ng-template>
</p>
</div>
<div class="col-5">
<button
id="action-btn"
class="btn btn-default btn-sm pull-right"
type="button"
title="{{ actionButtonText | translate }}"
(click)="createDeviceOperation()"
[disabled]="isCreateOperationDisabled()"
*ngIf="canCallAction"
>
<i [c8yIcon]="actionButtonIcon"></i> {{ actionButtonText | translate }}
</button>
</div>
</div>
<div class="c8y-empty-state text-left" *ngIf="!configSnapshot?.binary && showBinary()">
<h1 [c8yIcon]="'file-image-o'"></h1>
<p>
<strong translate>No preview available.</strong><br />
<small *ngIf="configSnapshot?.binary !== ''; else emptyFile" translate
>The file is not available.</small
>
<ng-template #emptyFile>
<small translate>The file is empty.</small>
</ng-template>
</p>
</div>
<div *ngIf="configSnapshot?.binary && showBinary()" class="flex-grow d-flex d-col">
<c8y-source-code-preview
[text]="configSnapshot.binary"
[isDisabled]="true"
class="d-contents"
></c8y-source-code-preview>
<div *ngIf="canSaveSnapshot" class="p-t-16">
<button
type="button"
class="btn btn-primary btn-sm pull-right m-l-8"
(click)="download()"
translate
>
Download
</button>
<button
*ngIf="hasPermission()"
type="button"
class="btn btn-default btn-sm pull-right"
(click)="saveToRepository()"
translate
>
Save to repository
</button>
</div>
</div>
<div *ngIf="showOperation()">
<c8y-operation-details [operation]="operation"></c8y-operation-details>
</div>