refs #1726 Add translation support for disk and RAM usage labels in Global Status component

pull/18/head
Lucas Lara García 2025-03-25 12:42:37 +01:00
parent 2f47b2ec66
commit 4998463ba1
3 changed files with 13 additions and 14 deletions

View File

@ -8,13 +8,10 @@
[labels]="showLabels"> [labels]="showLabels">
</ngx-charts-pie-chart> </ngx-charts-pie-chart>
<div class="disk-usage-info"> <div class="disk-usage-info">
<p>{{ 'totalLabel' | translate }}: <strong>{{ formatBytes(diskUsage.total) }}</strong> <p>{{ 'totalLabel' | translate }}: <strong>{{ isRepository ? diskUsage.total : formatBytes(diskUsage.total) }}</strong></p>
</p> <p>{{ 'usedLabel' | translate }}: <strong>{{ isRepository ? diskUsage.used : formatBytes(diskUsage.used) }}</strong></p>
<p>{{ 'usedLabel' | translate }}: <strong>{{ formatBytes(diskUsage.used) }}</strong> <p>{{ 'availableLabel' | translate }}: <strong>{{ isRepository ? diskUsage.available : formatBytes(diskUsage.available) }}</strong></p>
</p> <p>{{ 'usedPercentageLabel' | translate }}: <strong>{{ isRepository ? diskUsage.used_percentage : diskUsage.percentage }}</strong></p>
<p>{{ 'availableLabel' | translate }}: <strong>{{ formatBytes(diskUsage.available)
}}</strong></p>
<p>{{ 'freeLabel' | translate }}: <strong>{{ diskUsage.percentage }}</strong></p>
</div> </div>
</div> </div>
</div> </div>
@ -27,10 +24,10 @@
[labels]="showLabels"> [labels]="showLabels">
</ngx-charts-pie-chart> </ngx-charts-pie-chart>
<div class="ram-usage-info"> <div class="ram-usage-info">
<p>Total: <strong>{{ ramUsage.total }}</strong></p> <p>{{ 'totalLabel' | translate }}: <strong>{{ ramUsage.total }}</strong></p>
<p>Usado: <strong>{{ ramUsage.used }}</strong></p> <p>{{ 'usedLabel' | translate }}: <strong>{{ ramUsage.used }}</strong></p>
<p>Disponible: <strong>{{ ramUsage.available }}</strong></p> <p>{{ 'availableLabel' | translate }}: <strong>{{ ramUsage.available }}</strong></p>
<p>Usado (%): <strong>{{ ramUsage.used_percentage }}</strong></p> <p>{{ 'usedPercentageLabel' | translate }}: <strong>{{ ramUsage.used_percentage }}</strong></p>
</div> </div>
</div> </div>
</div> </div>
@ -39,7 +36,7 @@
<div class="cpu-usage-container" *ngIf="isRepository"> <div class="cpu-usage-container" *ngIf="isRepository">
<h3 class="cpu-title">{{ 'CpuUsage' | translate }}</h3> <h3 class="cpu-title">{{ 'CpuUsage' | translate }}</h3>
<div class="cpu-usage"> <div class="cpu-usage">
<p>Usado: <strong>{{ cpuUsage.used_percentage }}</strong></p> <p>{{ 'usedLabel' | translate }}: <strong>{{ cpuUsage.used_percentage }}</strong></p>
</div> </div>
</div> </div>

View File

@ -472,5 +472,6 @@
"GlobalStatus": "Global Status", "GlobalStatus": "Global Status",
"RamUsage": "RAM Usage", "RamUsage": "RAM Usage",
"CpuUsage": "CPU Usage", "CpuUsage": "CPU Usage",
"processes": "Processes" "processes": "Processes",
"usedPercentageLabel": "Used"
} }

View File

@ -473,5 +473,6 @@
"GlobalStatus": "Estado Global", "GlobalStatus": "Estado Global",
"RamUsage": "Uso de RAM", "RamUsage": "Uso de RAM",
"CpuUsage": "Uso de CPU", "CpuUsage": "Uso de CPU",
"processes": "Procesos" "processes": "Procesos",
"usedPercentageLabel": "Usado"
} }