Commit 8f00e57d authored by Sebastian Chicoma's avatar Sebastian Chicoma

Correcciones y cambios:

se agergó al usuario en la sincronización
parent 64eb3b1f
......@@ -12,6 +12,8 @@ export class AgentStatusPipe implements PipeTransform {
return 'label.created';
case 'DP':
return 'label.deployed';
case 'PS':
return 'label.sync-pending';
}
}
......
......@@ -40,8 +40,12 @@ export class AgentService extends DynaDataService {
return this.httpClient.get(this.serviceURL + '/channels');
}
synchronize(id: number) {
return this.httpClient.get(this.serviceURL + '/synchronize/' + id);
synchronize(id: number, user:string) {
return this.httpClient.get(this.serviceURL + '/synchronize/' + id, {
params: {
user
}
});
}
}
import { Component, OnInit, ViewChild, ViewContainerRef, Input } from '@angular/core';
import { MatPaginator, MatSort } from '@angular/material';
import { ColumnTemplate, DynaDataSource, ConfirmationDialogService, extractRSQL, FieldFilter } from '@xdf/gallery';
import { Pagination, SortField, NotificationType, NotificationService } from '@xdf/commons';
import { Pagination, SortField, NotificationType, NotificationService, AuthenticationService } from '@xdf/commons';
import { Router, ActivatedRoute } from '@angular/router';
import { first, tap } from 'rxjs/operators';
import { TagFilter } from '@xdf/gallery/lib/views/gallery/ngx-tags-input/model/tag-filter';
......@@ -169,6 +169,7 @@ export class AgentListComponent implements OnInit {
private notificationService: NotificationService,
private translateService: TranslateService,
protected confirmationDialogService: ConfirmationDialogService,
private authenticationService: AuthenticationService,
protected vcRef: ViewContainerRef
) { }
......@@ -307,7 +308,9 @@ export class AgentListComponent implements OnInit {
}
synchronize(item) {
this.agentService.synchronize(item.id).pipe(first()).subscribe(() => {
let user = (this.authenticationService.currentUserValue ? this.authenticationService.currentUserValue.username : 'admin');
this.agentService.synchronize(item.id, user).pipe(first()).subscribe(() => {
this.notificationService.showMessage(this.translateService.instant("agent.synchronize.success"), undefined, NotificationType.success);
this.onRefresh();
});
......
......@@ -46,7 +46,7 @@
<!-- Position Column -->
<ng-container [matColumnDef]="column" *ngFor="let column of displayedColumns">
<th mat-header-cell *matHeaderCellDef> {{ 'header.' + column | translate}} </th>
<td mat-cell *matCellDef="let element"> {{element[column] | translate</td>
<td mat-cell *matCellDef="let element"> {{element[column] | translate}}</td>
</ng-container>
<tr mat-header-row *matHeaderRowDef="displayedColumns; sticky: true"></tr>
......
......@@ -27,6 +27,7 @@
"label.status.off" : "Disabled",
"label.created": "Created",
"label.deployed": "Deployed",
"label.sync-pending": "Sync pending",
"breadcrumb.agent": "Agents",
"label.general-information.title" : "General information",
"label.general-information.description" : "Register the basic information for the agent",
......@@ -54,6 +55,15 @@
"label.delete-channel": "Delete channel",
"agent.edit.success": "The agent was successfully edited",
"agent.create.success": "The agent was created successfully",
"agent.synchronize.success": "Synchronization was successful",
"error.message.complete-form": "Complete the form correctly",
"label.file.tooltip" : "For security reasones, you cannot edit uploaded files. Please delete and upload a new file"
"label.file.tooltip" : "For security reasons, you cannot edit uploaded files. Please delete and upload a new file",
"EMPTY.VALUE": "Empty value",
"NOT.FOUND.VALUE": "Value not found",
"header.type": "Column",
"header.header": "Column",
"header.line": "Line",
"header.value": "Value",
"HEADER.REPETEAD": "Repeated column",
"HEADER.NOT.FOUND": "Column not found"
}
\ No newline at end of file
......@@ -27,6 +27,7 @@
"label.status.off": "En Baja",
"label.created": "Creado",
"label.deployed": "Desplegado",
"label.sync-pending": "Pendiente de sincronización",
"breadcrumb.agent": "Agentes",
"label.general-information.title": "Información general",
"label.general-information.description": "Registre la información correspondiente al agente",
......@@ -54,6 +55,15 @@
"label.delete-channel": "Borrar canal",
"agent.edit.success": "El agente fue editado correctamente",
"agent.create.success": "El agente fue creado correctamente",
"agent.synchronize.success": "La sincronización se realizó correctamente",
"error.message.complete-form": "Complete correctamente el formulario",
"label.file.tooltip" : "Por seguridad, no se pueden editar los archivos validados"
"label.file.tooltip": "Por seguridad, no se pueden editar los archivos validados",
"EMPTY.VALUE": "Celda vacía",
"NOT.FOUND.VALUE": "Valor no encontrado",
"header.type": "Columna",
"header.header": "Columna",
"header.line": "Línea",
"header.value": "Valor",
"HEADER.REPETEAD": "Columna repetida",
"HEADER.NOT.FOUND": "Columna no encontrado"
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment