refs #1864. Added ssh_port and user in imageRepository in UX.

pull/19/head
Manuel Aranda Rosales 2025-04-11 11:45:15 +02:00
parent 9e9d7b9873
commit 411491091b
4 changed files with 26 additions and 4 deletions

View File

@ -12,6 +12,18 @@
<input matInput formControlName="ip" name="description"> <input matInput formControlName="ip" name="description">
</mat-form-field> </mat-form-field>
<mat-form-field appearance="fill" class="form-field">
<mat-label>Puerto ssh</mat-label>
<input matInput formControlName="sshPort" name="sshPort">
<mat-hint>Valor que utilizará el sistema para algunas acciones como transferir imagenes.</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill" class="form-field">
<mat-label>Usuario</mat-label>
<input matInput formControlName="user" name="user">
<mat-hint>Este usuario se utilizara para conectarse al repositorio.</mat-hint>
</mat-form-field>
<mat-form-field appearance="fill" class="form-field"> <mat-form-field appearance="fill" class="form-field">
<mat-label>Comentarios</mat-label> <mat-label>Comentarios</mat-label>
<input matInput formControlName="comments" name="comments"> <input matInput formControlName="comments" name="comments">

View File

@ -30,6 +30,8 @@ export class ManageRepositoryComponent implements OnInit {
this.imageForm = this.fb.group({ this.imageForm = this.fb.group({
name: [null, Validators.required], name: [null, Validators.required],
ip: [null], ip: [null],
sshPort: [null],
user: [null],
comments: [null], comments: [null],
}); });
} }
@ -46,6 +48,8 @@ export class ManageRepositoryComponent implements OnInit {
this.imageForm = this.fb.group({ this.imageForm = this.fb.group({
name: [response.name, Validators.required], name: [response.name, Validators.required],
ip: [response.ip], ip: [response.ip],
sshPort: [response.sshPort?? '22' ],
user: [response.user?? 'opengnsys'],
comments: [response.comments], comments: [response.comments],
}); });
this.repositoryId = response['@id']; this.repositoryId = response['@id'];
@ -60,6 +64,8 @@ export class ManageRepositoryComponent implements OnInit {
const payload = { const payload = {
name: this.imageForm.value.name, name: this.imageForm.value.name,
ip: this.imageForm.value.ip, ip: this.imageForm.value.ip,
sshPort: this.imageForm.value.sshPort,
user: this.imageForm.value.user,
comments: this.imageForm.value.comments, comments: this.imageForm.value.comments,
}; };

View File

@ -5,7 +5,7 @@
<mat-icon>help</mat-icon> <mat-icon>help</mat-icon>
</button> </button>
<div class="header-container-title"> <div class="header-container-title">
<h2 joyrideStep="groupsTitleStepText" text="{{ 'groupsTitleStepText' | translate }}"> <h2 joyrideStep="repositoryTitleStep" text="{{ 'groupsTitleStepText' | translate }}">
{{ 'repositoryTitle' | translate }} {{ 'repositoryTitle' | translate }}
</h2> </h2>
</div> </div>

View File

@ -39,6 +39,11 @@ export class RepositoriesComponent implements OnInit {
header: 'Nombre de repositorio', header: 'Nombre de repositorio',
cell: (repository: any) => `${repository.name}` cell: (repository: any) => `${repository.name}`
}, },
{
columnDef: 'user',
header: 'Usuario',
cell: (repository: any) => `${repository.user?? 'opengnsys'}`
},
{ {
columnDef: 'ip', columnDef: 'ip',
header: 'Ip', header: 'Ip',
@ -55,8 +60,8 @@ export class RepositoriesComponent implements OnInit {
cell: (repository: any) => `${this.datePipe.transform(repository.createdAt, 'dd/MM/yyyy hh:mm:ss')}` cell: (repository: any) => `${this.datePipe.transform(repository.createdAt, 'dd/MM/yyyy hh:mm:ss')}`
} }
]; ];
displayedColumns: string[] = ['id', 'name', 'ip', 'images', 'createdAt', 'actions'];
isGitModuleInstalled: boolean = true; isGitModuleInstalled: boolean = true;
displayedColumns: string[] = ['id', 'name', 'ip', 'user', 'images', 'createdAt', 'actions'];
constructor( constructor(
public dialog: MatDialog, public dialog: MatDialog,
@ -93,7 +98,6 @@ export class RepositoriesComponent implements OnInit {
this.loading = false; this.loading = false;
}, },
error => { error => {
console.error('Error fetching images', error);
this.loading = false; this.loading = false;
} }
); );
@ -165,7 +169,7 @@ export class RepositoriesComponent implements OnInit {
iniciarTour(): void { iniciarTour(): void {
this.joyrideService.startTour({ this.joyrideService.startTour({
steps: [ steps: [
'titleStep', 'repositoryTitleStep',
'addStep', 'addStep',
], ],
showPrevButton: true, showPrevButton: true,