fix(oggui): ocultar botones de escritura de infraestructura para ou-admin
Los botones de crear, editar y eliminar en servidores DHCP, Boot, Comandos y Repositorios quedan visibles unicamente para super-admin, alineando la UI con las restricciones de backend anadidas en ogcore.pull/95/head
parent
9addf93660
commit
9872b9c7e4
|
|
@ -6,7 +6,7 @@
|
|||
<h2 joyrideStep="titleStep" text="{{ 'titleStepText' | translate }}">{{ 'CommandsTitle' | translate }}</h2>
|
||||
</div>
|
||||
<div class="command-button-row" joyrideStep="addCommandStep" text="{{ 'addCommandStepText' | translate }}">
|
||||
<button class="action-button" (click)="openCreateCommandModal()">{{ 'addCommand' | translate }}</button>
|
||||
<button *ngIf="auth.isSuperAdmin" class="action-button" (click)="openCreateCommandModal()">{{ 'addCommand' | translate }}</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -44,8 +44,8 @@
|
|||
<th mat-header-cell *matHeaderCellDef style="text-align: center;">{{ 'actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let command" style="text-align: center;" joyrideStep="actionsStep" text="{{ 'actionsStepText' | translate }}">
|
||||
<button mat-icon-button color="info" (click)="viewDetails($event, command)"><mat-icon>visibility</mat-icon></button>
|
||||
<button mat-icon-button color="primary" [disabled]="command.readOnly" (click)="editCommand($event, command)"><mat-icon>edit</mat-icon></button>
|
||||
<button mat-icon-button color="warn" [disabled]="command.readOnly" (click)="deleteCommand($event, command)"><mat-icon>delete</mat-icon></button>
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="primary" [disabled]="command.readOnly" (click)="editCommand($event, command)"><mat-icon>edit</mat-icon></button>
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="warn" [disabled]="command.readOnly" (click)="deleteCommand($event, command)"><mat-icon>delete</mat-icon></button>
|
||||
</td>
|
||||
</ng-container>
|
||||
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import { DeleteModalComponent } from '../../../shared/delete_modal/delete-modal/
|
|||
import { MatTableDataSource } from '@angular/material/table';
|
||||
import { DatePipe } from '@angular/common';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { AuthService } from '@services/auth.service';
|
||||
import { JoyrideService } from 'ngx-joyride';
|
||||
|
||||
@Component({
|
||||
|
|
@ -19,6 +20,7 @@ import { JoyrideService } from 'ngx-joyride';
|
|||
})
|
||||
export class CommandsComponent implements OnInit {
|
||||
public translate = inject(TranslateService);
|
||||
public auth = inject(AuthService);
|
||||
baseUrl: string;
|
||||
private apiUrl: string;
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
{{ 'ogbootServers' | translate }}</h2>
|
||||
</div>
|
||||
<div class="images-button-row">
|
||||
<button
|
||||
<button *ngIf="auth.isSuperAdmin"
|
||||
class="action-button" (click)="addServer()"
|
||||
joyrideStep="addStep"
|
||||
text="Añadir Servidor Boot">{{ 'addBootServer' | translate }}</button>
|
||||
|
|
@ -51,10 +51,10 @@
|
|||
<button mat-icon-button color="primary" (click)="syncServer(server)" [matTooltip]="'syncServer' | translate">
|
||||
<mat-icon>sync</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="primary" (click)="editServer($event, server)" [matTooltip]="'editServerTitle' | translate">
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="primary" (click)="editServer($event, server)" [matTooltip]="'editServerTitle' | translate">
|
||||
<mat-icon>edit</mat-icon>
|
||||
</button>
|
||||
<button mat-icon-button color="warn" (click)="deleteServer($event, server)" [matTooltip]="'buttonDeleteServer' | translate">
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="warn" (click)="deleteServer($event, server)" [matTooltip]="'buttonDeleteServer' | translate">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {DeleteModalComponent} from "../../../shared/delete_modal/delete-modal/de
|
|||
import { JoyrideService } from 'ngx-joyride';
|
||||
import { Router } from '@angular/router';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { AuthService } from '@services/auth.service';
|
||||
import {ManageBootServerComponent} from "../manage-boot-server/manage-boot-server.component";
|
||||
import { forkJoin } from 'rxjs';
|
||||
|
||||
|
|
@ -20,6 +21,7 @@ import { forkJoin } from 'rxjs';
|
|||
})
|
||||
export class BootServersComponent implements OnInit {
|
||||
public translate = inject(TranslateService);
|
||||
public auth = inject(AuthService);
|
||||
baseUrl: string;
|
||||
private apiUrl: string;
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
{{ 'dhcpServers' | translate }}</h2>
|
||||
</div>
|
||||
<div class="images-button-row">
|
||||
<button
|
||||
<button *ngIf="auth.isSuperAdmin"
|
||||
class="action-button" (click)="addServer()"
|
||||
joyrideStep="addStep"
|
||||
text="Añadir Servidor DHCP">{{ 'addDhcpServer' | translate }}</button>
|
||||
|
|
@ -54,9 +54,9 @@
|
|||
<ng-container matColumnDef="actions">
|
||||
<th mat-header-cell *matHeaderCellDef style="text-align: center;">{{ 'actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let server" style="text-align: center;" joyrideStep="actionsStep">
|
||||
<button mat-icon-button color="primary" (click)="editServer($event, server)" [matTooltip]="'editServerTitle' | translate">
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="primary" (click)="editServer($event, server)" [matTooltip]="'editServerTitle' | translate">
|
||||
<mat-icon>edit</mat-icon></button>
|
||||
<button mat-icon-button color="warn" (click)="deleteServer($event, server)" [matTooltip]="'buttonDeleteServer' | translate">
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="warn" (click)="deleteServer($event, server)" [matTooltip]="'buttonDeleteServer' | translate">
|
||||
<mat-icon>delete</mat-icon>
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {DeleteModalComponent} from "../../../shared/delete_modal/delete-modal/de
|
|||
import { JoyrideService } from 'ngx-joyride';
|
||||
import { Router } from '@angular/router';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { AuthService } from '@services/auth.service';
|
||||
import {ManageDhcpServerComponent} from "../manage-dhcp-server/manage-dhcp-server.component";
|
||||
|
||||
@Component({
|
||||
|
|
@ -19,6 +20,7 @@ import {ManageDhcpServerComponent} from "../manage-dhcp-server/manage-dhcp-serve
|
|||
})
|
||||
export class DhcpServersComponent implements OnInit {
|
||||
public translate = inject(TranslateService);
|
||||
public auth = inject(AuthService);
|
||||
baseUrl: string;
|
||||
private apiUrl: string;
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@
|
|||
</h2>
|
||||
</div>
|
||||
<div class="images-button-row">
|
||||
<button
|
||||
<button *ngIf="auth.isSuperAdmin"
|
||||
class="action-button" (click)="addImage()"
|
||||
joyrideStep="addStep"
|
||||
text="{{ 'addRepositoryStepText' | translate }}">{{ 'addRepository' | translate }}</button>
|
||||
|
|
@ -68,9 +68,9 @@
|
|||
<th mat-header-cell *matHeaderCellDef i18n="@@columnActions" style="text-align: center;">{{ 'actions' | translate }}</th>
|
||||
<td mat-cell *matCellDef="let repository" style="text-align: center;" joyrideStep="actionsStep"
|
||||
[text]="'actionsDescription' | translate">
|
||||
<button mat-icon-button color="primary" (click)="editRepository($event, repository)" i18n="@@editImage">
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="primary" (click)="editRepository($event, repository)" i18n="@@editImage">
|
||||
<mat-icon>edit</mat-icon></button>
|
||||
<button mat-icon-button color="warn" (click)="deleteRepository($event, repository)">
|
||||
<button *ngIf="auth.isSuperAdmin" mat-icon-button color="warn" (click)="deleteRepository($event, repository)">
|
||||
<mat-icon i18n="@@deleteElementTooltip">delete</mat-icon>
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import {DeleteModalComponent} from "../../shared/delete_modal/delete-modal/delet
|
|||
import { JoyrideService } from 'ngx-joyride';
|
||||
import { Router } from '@angular/router';
|
||||
import { ConfigService } from '@services/config.service';
|
||||
import { AuthService } from '@services/auth.service';
|
||||
import {Subnet} from "../ogdhcp/og-dhcp-subnets.component";
|
||||
import {ShowMonoliticImagesComponent} from "./show-monolitic-images/show-monolitic-images.component";
|
||||
import {ShowGitCommitsComponent} from "./show-git-images/show-git-images.component";
|
||||
|
|
@ -22,6 +23,7 @@ import {ManageRepositoryComponent} from "./manage-repository/manage-repository.c
|
|||
})
|
||||
export class RepositoriesComponent implements OnInit {
|
||||
public translate = inject(TranslateService);
|
||||
public auth = inject(AuthService);
|
||||
baseUrl: string;
|
||||
private apiUrl: string;
|
||||
dataSource = new MatTableDataSource<any>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue