repository/configuration-device-tab/text-based-configuration.component.ts
selector | c8y-text-based-configuration |
templateUrl | ./text-based-configuration.component.html |
Properties |
Methods |
|
Accessors |
constructor(route: ActivatedRoute, alertService: AlertService, repositoryService: RepositoryService, deviceConfigurationService: DeviceConfigurationService, inventoryService: InventoryService)
|
||||||||||||||||||
Parameters :
|
Async load |
load()
|
Returns :
any
|
Async loadOperation |
loadOperation()
|
Returns :
any
|
Async ngOnInit |
ngOnInit()
|
Returns :
any
|
Async reloadConfiguration |
reloadConfiguration()
|
Returns :
any
|
Async updateConfiguration | ||||
updateConfiguration(config)
|
||||
Parameters :
Returns :
any
|
config |
config:
|
Type : string
|
device |
device:
|
Type : IManagedObject
|
latestOperation |
latestOperation:
|
Type : IOperation
|
reloadingConfig |
reloadingConfig:
|
Default value : false
|
showTextBasedConfigReload |
showTextBasedConfigReload:
|
Type : boolean
|
showTextBasedConfigSave |
showTextBasedConfigSave:
|
Type : boolean
|
savingConfig |
getsavingConfig()
|
<div class="d-flex d-col fit-h">
<fieldset *ngIf="latestOperation !== undefined" class="card-block bg-gray-white fit-w">
<div class="content-flex-50">
<c8y-single-operation [operation]="latestOperation" class="flex-grow"></c8y-single-operation>
<div class="flex-item-right d-flex">
<button
title="{{ 'Get snapshot from device' | translate }}"
type="button"
class="btn btn-default btn-sm flex-item-v-center m-t-8 m-b-8"
*ngIf="showTextBasedConfigReload"
(click)="reloadConfiguration()"
[disabled]="reloadingConfig || savingConfig"
>
<i
c8yIcon="refresh"
*ngIf="reloadingConfig"
class="m-r-4"
[ngClass]="{ 'icon-spin': reloadingConfig }"
></i>
<i c8yIcon="download" *ngIf="!reloadingConfig" class="m-r-4"></i>
{{ 'Get snapshot from device' | translate }}
</button>
</div>
</div>
</fieldset>
<div class="flex-grow">
<textarea
[(ngModel)]="config"
class="form-control fit-h p-r-16 p-l-16"
[disabled]="reloadingConfig || savingConfig"
c8y-spellcheck="false"
></textarea>
</div>
<div class="card-footer fit-w separator" *ngIf="showTextBasedConfigSave">
<button
type="button"
(click)="updateConfiguration(config)"
[disabled]="reloadingConfig || savingConfig"
class="btn btn-primary"
[ngClass]="{ 'btn-pending': savingConfig }"
>
<span title="{{ 'Send' | translate }}" *ngIf="!savingConfig">
{{ 'Send configuration to device' | translate }}
</span>
<span title="{{ 'Sending…' | translate }}" *ngIf="savingConfig">
{{ 'Sending…' | translate }}
</span>
</button>
</div>
</div>