feat(inventory): display network speed and disk type badges
oggui-debian-package/pipeline/head This commit looks good Details
testing/ogGui-multibranch/pipeline/head There was a failure building this commit Details

pull/98/head
Juan Manuel Bardallo 2026-07-31 13:38:41 +02:00
parent 4c3e6556d6
commit 47d7506877
6 changed files with 48 additions and 4 deletions

View File

@ -1464,3 +1464,5 @@
.badge-disk-type { display: inline-block; padding: 2px 6px; font-size: 11px; font-weight: bold; color: #fff; background-color: #607d8b; border-radius: 4px; margin-left: 8px; vertical-align: middle; }

View File

@ -104,7 +104,7 @@
<mat-option *ngFor="let disk of disks" [value]="disk.diskNumber">
<div class="disk-option">
<div class="disk-info">
<span class="disk-name">Disco {{ disk.diskNumber }}</span>
<span class="disk-name">Disco {{ disk.diskNumber }} <span *ngIf="disk.diskType" class="badge-disk-type">{{ disk.diskType }}</span></span>
<span class="disk-size"> {{ (disk.totalDiskSize / 1024).toFixed(2) }} GB</span>
</div>
<div class="disk-details">

View File

@ -17,6 +17,7 @@ import { MatTableDataSource } from '@angular/material/table';
interface Partition {
uuid?: string;
partitionNumber: number;
diskType?: string;
size: number;
partitionCode: string;
filesystem: string;
@ -46,7 +47,7 @@ export class PartitionAssistantComponent implements OnInit, AfterViewInit, OnDes
selectedDiskNumber: number | null = null;
updateRequests: any[] = [];
data: any = {};
disks: { diskNumber: number; totalDiskSize: number; partitions: Partition[]; chartData: any[]; used: number; percentage: number }[] = [];
disks: { diskNumber: number; totalDiskSize: number; partitions: Partition[]; chartData: any[]; used: number; percentage: number; diskType?: string }[] = [];
clientData: any = [];
loading: boolean = false;
runScriptContext: any = null;
@ -234,7 +235,7 @@ export class PartitionAssistantComponent implements OnInit, AfterViewInit, OnDes
const partitionsFromData = this.data.partitions;
this.originalPartitions = JSON.parse(JSON.stringify(partitionsFromData));
const disksMap = new Map<number, { totalDiskSize: number; partitions: Partition[] }>();
const disksMap = new Map<number, { totalDiskSize: number; partitions: Partition[]; diskType?: string }>();
partitionsFromData.forEach((partition: any) => {
if (!disksMap.has(partition.diskNumber)) {
@ -244,6 +245,7 @@ export class PartitionAssistantComponent implements OnInit, AfterViewInit, OnDes
const disk = disksMap.get(partition.diskNumber);
if (partition.partitionNumber === 0) {
disk!.totalDiskSize = this.convertBytesToGB(partition.size);
disk!.diskType = partition.diskType;
} else {
const isFirstPartitionGPT = partition.partitionNumber === 1 && this.partitionCode === 'GPT';
const hasValidExistingData = partition.size > 0 && partition.partitionCode && partition.filesystem;
@ -297,7 +299,8 @@ export class PartitionAssistantComponent implements OnInit, AfterViewInit, OnDes
partitions: disk.partitions,
chartData: chartData,
used: used,
percentage: percentage
percentage: percentage,
diskType: disk.diskType
});
});
this.disks.forEach((disk) => {

View File

@ -1597,6 +1597,33 @@ mat-button-toggle-group {
opacity: 1;
}
.badge-net-speed {
display: flex;
align-items: center;
gap: 4px;
background-color: #e3f2fd;
color: #1976d2;
font-size: 0.75rem;
font-weight: 600;
padding: 2px 8px;
border-radius: 12px;
width: fit-content;
margin-top: 4px;
}
.badge-net-speed .net-speed-icon {
font-size: 14px;
width: 14px;
height: 14px;
}
.list-view-badge {
display: inline-flex;
margin-top: 0;
margin-left: 8px;
vertical-align: middle;
}
.stat-icon {
display: flex;
align-items: center;

View File

@ -419,6 +419,11 @@
<span class="client-name truncate-cell-wide" [matTooltip]="client.name">{{ client.name }}</span>
<span class="client-ip">{{ client.ip }}</span>
<span class="client-mac">{{ client.mac }}</span>
@if (client.netSpeed) {
<span class="badge-net-speed" [matTooltip]="client.netSpeed + ' Mbps'">
<mat-icon class="net-speed-icon">speed</mat-icon> {{ client.netSpeed }} Mbps
</span>
}
@if (client.isRemotePcActive) {
<span class="remote-pc-badge">
<mat-icon class="remote-pc-icon">computer</mat-icon>
@ -540,6 +545,11 @@
<div class="client-cell">
<span class="client-ip">{{ client.ip }}</span>
<span class="client-mac">{{ client.mac }}</span>
@if (client.netSpeed) {
<span class="badge-net-speed list-view-badge" [matTooltip]="client.netSpeed + ' Mbps'">
<mat-icon class="net-speed-icon">speed</mat-icon> {{ client.netSpeed }} Mbps
</span>
}
</div>
</td>
</ng-container>

View File

@ -42,6 +42,8 @@ export interface Client {
type: string;
serialNumber: string;
netiface: string;
netDriver?: string;
netSpeed?: number;
organizationalUnit: OrganizationalUnit;
partitions: any[];
createdAt: string;