refs #1485 Refactor components to replace mat-spinner with loading component for improved loading indication
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
testing/ogGui-multibranch/pipeline/head There was a failure building this commit
Details
parent
218816d1f1
commit
bada1762aa
|
@ -12,6 +12,7 @@ import { MatIcon } from '@angular/material/icon';
|
||||||
import { MatHint } from '@angular/material/form-field';
|
import { MatHint } from '@angular/material/form-field';
|
||||||
import { MatPaginator } from '@angular/material/paginator';
|
import { MatPaginator } from '@angular/material/paginator';
|
||||||
import { TranslateModule } from '@ngx-translate/core';
|
import { TranslateModule } from '@ngx-translate/core';
|
||||||
|
import { LoadingComponent } from '../../../../shared/loading/loading.component';
|
||||||
describe('RolesComponent', () => {
|
describe('RolesComponent', () => {
|
||||||
let component: RolesComponent;
|
let component: RolesComponent;
|
||||||
let fixture: ComponentFixture<RolesComponent>;
|
let fixture: ComponentFixture<RolesComponent>;
|
||||||
|
@ -27,7 +28,7 @@ describe('RolesComponent', () => {
|
||||||
const dataServiceSpy = jasmine.createSpyObj('DataService', ['getRoles']);
|
const dataServiceSpy = jasmine.createSpyObj('DataService', ['getRoles']);
|
||||||
|
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [RolesComponent],
|
declarations: [RolesComponent, LoadingComponent],
|
||||||
imports: [MatDivider, MatFormField, MatLabel, MatIcon, MatHint, MatPaginator,
|
imports: [MatDivider, MatFormField, MatLabel, MatIcon, MatHint, MatPaginator,
|
||||||
TranslateModule.forRoot()],
|
TranslateModule.forRoot()],
|
||||||
providers: [
|
providers: [
|
||||||
|
|
|
@ -1,8 +1,6 @@
|
||||||
<h2 mat-dialog-title>{{ editing ? ('editCommandGroup' | translate) : ('createCommandGroup' | translate) }}</h2>
|
<h2 mat-dialog-title>{{ editing ? ('editCommandGroup' | translate) : ('createCommandGroup' | translate) }}</h2>
|
||||||
<mat-dialog-content class="form-container">
|
<mat-dialog-content class="form-container">
|
||||||
<div *ngIf="loading" class="loading-container">
|
<app-loading [isLoading]="loading"></app-loading>
|
||||||
<mat-spinner></mat-spinner>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<form *ngIf="!loading" class="command-group-form" (ngSubmit)="onSubmit()">
|
<form *ngIf="!loading" class="command-group-form" (ngSubmit)="onSubmit()">
|
||||||
<mat-form-field>
|
<mat-form-field>
|
||||||
|
@ -58,4 +56,4 @@
|
||||||
<mat-dialog-actions align="end">
|
<mat-dialog-actions align="end">
|
||||||
<button mat-button (click)="close()">{{ 'buttonCancel' | translate }}</button>
|
<button mat-button (click)="close()">{{ 'buttonCancel' | translate }}</button>
|
||||||
<button mat-button (click)="onSubmit()" cdkFocusInitial>{{ 'buttonSave' | translate }}</button>
|
<button mat-button (click)="onSubmit()" cdkFocusInitial>{{ 'buttonSave' | translate }}</button>
|
||||||
</mat-dialog-actions>
|
</mat-dialog-actions>
|
|
@ -1,10 +1,7 @@
|
||||||
<div class="detail-command-group-container">
|
<div class="detail-command-group-container">
|
||||||
<h2>{{ 'commandGroupDetailsTitle' | translate }}</h2>
|
<h2>{{ 'commandGroupDetailsTitle' | translate }}</h2>
|
||||||
|
|
||||||
<!-- Indicador de carga -->
|
<app-loading [isLoading]="loading"></app-loading>
|
||||||
<div *ngIf="loading" class="loading-container">
|
|
||||||
<mat-spinner></mat-spinner>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<mat-card *ngIf="!loading">
|
<mat-card *ngIf="!loading">
|
||||||
<mat-card-header>
|
<mat-card-header>
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
<h2 class="title">{{ 'clientDetailsTitle' | translate }}</h2>
|
<h2 class="title">{{ 'clientDetailsTitle' | translate }}</h2>
|
||||||
<div class="client-button-row">
|
<div class="client-button-row">
|
||||||
<button mat-flat-button color="primary" (click)="onEditClick($event, clientData.uuid)" i18n="@@editImage">Editar</button>
|
<button mat-flat-button color="primary" (click)="onEditClick($event, clientData.uuid)"
|
||||||
<button mat-flat-button color="primary" [matMenuTriggerFor]="commandMenu">{{ 'commandsButton' | translate }}</button>
|
i18n="@@editImage">Editar</button>
|
||||||
|
<button mat-flat-button color="primary" [matMenuTriggerFor]="commandMenu">{{ 'commandsButton' | translate
|
||||||
|
}}</button>
|
||||||
</div>
|
</div>
|
||||||
<mat-menu #commandMenu="matMenu">
|
<mat-menu #commandMenu="matMenu">
|
||||||
<button mat-menu-item *ngFor="let command of arrayCommands" (click)="onCommandSelect(command.slug)">
|
<button mat-menu-item *ngFor="let command of arrayCommands" (click)="onCommandSelect(command.slug)">
|
||||||
|
@ -17,9 +19,7 @@
|
||||||
{{ 'Back' | translate }}
|
{{ 'Back' | translate }}
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div *ngIf="loading" class="loading-container">
|
<app-loading [isLoading]="loading"></app-loading>
|
||||||
<mat-spinner></mat-spinner>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="!loading" class="client-info">
|
<div *ngIf="!loading" class="client-info">
|
||||||
<div class="info-section">
|
<div class="info-section">
|
||||||
|
@ -67,11 +67,7 @@
|
||||||
<div class="charts-container">
|
<div class="charts-container">
|
||||||
<ng-container *ngIf="diskUsageData && diskUsageData.length > 0">
|
<ng-container *ngIf="diskUsageData && diskUsageData.length > 0">
|
||||||
<div *ngFor="let disk of chartDisk" class="disk-usage">
|
<div *ngFor="let disk of chartDisk" class="disk-usage">
|
||||||
<ngx-charts-pie-chart
|
<ngx-charts-pie-chart [view]="view" [results]="disk.chartData" [doughnut]="true">
|
||||||
[view]="view"
|
|
||||||
[results]="disk.chartData"
|
|
||||||
[doughnut]="true"
|
|
||||||
>
|
|
||||||
</ngx-charts-pie-chart>
|
</ngx-charts-pie-chart>
|
||||||
|
|
||||||
<h3>Disco {{ disk.diskNumber }}</h3>
|
<h3>Disco {{ disk.diskNumber }}</h3>
|
||||||
|
@ -80,5 +76,4 @@
|
||||||
</div>
|
</div>
|
||||||
</ng-container>
|
</ng-container>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -181,9 +181,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="isLoadingClients">
|
<app-loading [isLoading]="isLoadingClients"></app-loading>
|
||||||
<app-loading [isLoading]="isLoadingClients"></app-loading>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="!isLoadingClients">
|
<div *ngIf="!isLoadingClients">
|
||||||
<div *ngIf="hasClients; else noClientsTemplate">
|
<div *ngIf="hasClients; else noClientsTemplate">
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<h2 mat-dialog-title>{{ isEditMode ? 'Editar' : 'Añadir' }} imagen ogLive</h2>
|
<h2 mat-dialog-title>{{ isEditMode ? 'Editar' : 'Añadir' }} imagen ogLive</h2>
|
||||||
<mat-dialog-content>
|
<mat-dialog-content>
|
||||||
<mat-spinner class="spinner" *ngIf="loading"></mat-spinner>
|
<app-loading [isLoading]="loading"></app-loading>
|
||||||
|
|
||||||
<mat-form-field *ngIf="!loading" appearance="fill" class="full-width">
|
<mat-form-field *ngIf="!loading" appearance="fill" class="full-width">
|
||||||
<mat-label>Seleccionar ISO</mat-label>
|
<mat-label>Seleccionar ISO</mat-label>
|
||||||
|
|
|
@ -6,13 +6,8 @@
|
||||||
<div class="row top-row">
|
<div class="row top-row">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>Uso de Disco</h3>
|
<h3>Uso de Disco</h3>
|
||||||
<ngx-charts-pie-chart
|
<ngx-charts-pie-chart [view]="view" [scheme]="colorScheme" [results]="diskUsageChartData"
|
||||||
[view]="view"
|
[gradient]="gradient" [doughnut]="isDoughnut" [labels]="showLabels">
|
||||||
[scheme]="colorScheme"
|
|
||||||
[results]="diskUsageChartData"
|
|
||||||
[gradient]="gradient"
|
|
||||||
[doughnut]="isDoughnut"
|
|
||||||
[labels]="showLabels" >
|
|
||||||
</ngx-charts-pie-chart>
|
</ngx-charts-pie-chart>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p>Total: {{ diskUsage.total }}</p>
|
<p>Total: {{ diskUsage.total }}</p>
|
||||||
|
@ -24,13 +19,8 @@
|
||||||
|
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>Uso de RAM</h3>
|
<h3>Uso de RAM</h3>
|
||||||
<ngx-charts-pie-chart
|
<ngx-charts-pie-chart [view]="view" [scheme]="colorScheme" [results]="ramUsageChartData" [gradient]="gradient"
|
||||||
[view]="view"
|
[doughnut]="isDoughnut" [labels]="showLabels">
|
||||||
[scheme]="colorScheme"
|
|
||||||
[results]="ramUsageChartData"
|
|
||||||
[gradient]="gradient"
|
|
||||||
[doughnut]="isDoughnut"
|
|
||||||
[labels]="showLabels">
|
|
||||||
</ngx-charts-pie-chart>
|
</ngx-charts-pie-chart>
|
||||||
<div class="info">
|
<div class="info">
|
||||||
<p>Total: {{ ramUsage.total }}</p>
|
<p>Total: {{ ramUsage.total }}</p>
|
||||||
|
@ -45,7 +35,8 @@
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<h3>Uso de CPU</h3>
|
<h3>Uso de CPU</h3>
|
||||||
<div class="cpu-usage-bar">
|
<div class="cpu-usage-bar">
|
||||||
<div class="cpu-bar" [style.width]="cpuUsage.percentage" [ngClass]="{'high': cpuUsage.percentage > '80%'}"></div>
|
<div class="cpu-bar" [style.width]="cpuUsage.percentage" [ngClass]="{'high': cpuUsage.percentage > '80%'}">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<p>Usado: {{ cpuUsage.percentage }}</p>
|
<p>Usado: {{ cpuUsage.percentage }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
@ -54,17 +45,17 @@
|
||||||
<h3>Servicios</h3>
|
<h3>Servicios</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let service of getServices()">
|
<li *ngFor="let service of getServices()">
|
||||||
<span class="status-led" [ngClass]="{
|
<span class="status-led" [ngClass]="{
|
||||||
'active': service.status === 'active',
|
'active': service.status === 'active',
|
||||||
'inactive': service.status === 'stopped' || service.status === 'status not accesible'
|
'inactive': service.status === 'stopped' || service.status === 'status not accesible'
|
||||||
}"></span>
|
}"></span>
|
||||||
{{ service.name }}:
|
{{ service.name }}:
|
||||||
<span [ngSwitch]="service.status">
|
<span [ngSwitch]="service.status">
|
||||||
<span *ngSwitchCase="'active'">Activo</span>
|
<span *ngSwitchCase="'active'">Activo</span>
|
||||||
<span *ngSwitchCase="'stopped'">Detenido</span>
|
<span *ngSwitchCase="'stopped'">Detenido</span>
|
||||||
<span *ngSwitchCase="'status not accesible'">No accesible</span>
|
<span *ngSwitchCase="'status not accesible'">No accesible</span>
|
||||||
<span *ngSwitchDefault>{{ service.status }}</span>
|
<span *ngSwitchDefault>{{ service.status }}</span>
|
||||||
</span>
|
</span>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
@ -73,7 +64,7 @@
|
||||||
<h3>Procesos</h3>
|
<h3>Procesos</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li *ngFor="let process of getProcesses()">
|
<li *ngFor="let process of getProcesses()">
|
||||||
<span class="status-led" [ngClass]="{
|
<span class="status-led" [ngClass]="{
|
||||||
'active': process.status === 'running',
|
'active': process.status === 'running',
|
||||||
'inactive': process.status === 'stopped'
|
'inactive': process.status === 'stopped'
|
||||||
}"></span>
|
}"></span>
|
||||||
|
@ -94,9 +85,8 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<h2>Editar datos repositorio</h2>
|
<h2>Editar datos repositorio</h2>
|
||||||
<div *ngIf="loading" class="loading-container">
|
|
||||||
<mat-spinner></mat-spinner>
|
<app-loading [isLoading]="loading"></app-loading>
|
||||||
</div>
|
|
||||||
|
|
||||||
<div *ngIf="!loading" class="client-info form-container">
|
<div *ngIf="!loading" class="client-info form-container">
|
||||||
<form [formGroup]="repositoryForm" (ngSubmit)="save()" class="repository-form">
|
<form [formGroup]="repositoryForm" (ngSubmit)="save()" class="repository-form">
|
||||||
|
@ -116,7 +106,7 @@
|
||||||
<input matInput formControlName="comments" name="comments">
|
<input matInput formControlName="comments" name="comments">
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
|
|
||||||
<button mat-flat-button color="primary" class="save-button"(click)="save()">Guardar</button>
|
<button mat-flat-button color="primary" class="save-button" (click)="save()">Guardar</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -125,4 +115,4 @@
|
||||||
<mat-tab label="Listado de imágenes">
|
<mat-tab label="Listado de imágenes">
|
||||||
<app-images [repositoryUuid]="repositoryId"></app-images>
|
<app-images [repositoryUuid]="repositoryId"></app-images>
|
||||||
</mat-tab>
|
</mat-tab>
|
||||||
</mat-tab-group>
|
</mat-tab-group>
|
|
@ -16,6 +16,7 @@ import { DataService } from '../../calendar/data.service';
|
||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
import { NO_ERRORS_SCHEMA } from '@angular/core';
|
||||||
import { provideRouter } from '@angular/router';
|
import { provideRouter } from '@angular/router';
|
||||||
|
import { LoadingComponent } from '../../../shared/loading/loading.component';
|
||||||
|
|
||||||
describe('MainRepositoryViewComponent', () => {
|
describe('MainRepositoryViewComponent', () => {
|
||||||
let component: MainRepositoryViewComponent;
|
let component: MainRepositoryViewComponent;
|
||||||
|
@ -23,7 +24,7 @@ describe('MainRepositoryViewComponent', () => {
|
||||||
|
|
||||||
beforeEach(async () => {
|
beforeEach(async () => {
|
||||||
await TestBed.configureTestingModule({
|
await TestBed.configureTestingModule({
|
||||||
declarations: [MainRepositoryViewComponent],
|
declarations: [MainRepositoryViewComponent, LoadingComponent],
|
||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
ReactiveFormsModule,
|
ReactiveFormsModule,
|
||||||
|
|
Loading…
Reference in New Issue