Skip to content

Commit

Permalink
UI: Tooltip on the host information card to display the CPU speed in …
Browse files Browse the repository at this point in the history
…MHz and the memory value in MB (to 3 decimal places) (apache#9971)

Co-authored-by: layon.oliveira <[email protected]>
  • Loading branch information
LayonRibeiro and layon.oliveira authored Dec 2, 2024
1 parent b6937b6 commit 7cfeab1
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions ui/src/components/view/InfoCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,14 @@
<div class="resource-detail-item__label">{{ $t('label.cpu') }}</div>
<div class="resource-detail-item__details">
<appstore-outlined />
<span v-if="'cpunumber' in resource && 'cpuspeed' in resource">{{ resource.cpunumber }} CPU x {{ parseFloat(resource.cpuspeed / 1000.0).toFixed(2) }} Ghz</span>
<span v-if="'cpunumber' in resource && 'cpuspeed' in resource">{{ resource.cpunumber }} CPU x {{ (resource.cpuspeed / 1000.0).toFixed(2) }} GHz
<a-tooltip placement="top">
<template #title>
{{ resource.cpuspeed }} MHz
</template>
<QuestionCircleOutlined />
</a-tooltip>
</span>
<span v-else>{{ resource.cputotal }}</span>
</div>
<div>
Expand Down Expand Up @@ -224,7 +231,16 @@
<div class="resource-detail-item" v-else-if="resource.memorytotalgb">
<div class="resource-detail-item__label">{{ $t('label.memory') }}</div>
<div class="resource-detail-item__details">
<bulb-outlined />{{ resource.memorytotalgb + ' ' + $t('label.memory') }}
<bulb-outlined />
<span>
{{ resource.memorytotalgb + ' ' + $t('label.memory') }}
<a-tooltip placement="top">
<template #title>
{{ (resource.memorytotal/(1024**2)).toFixed(3) }} MB
</template>
<QuestionCircleOutlined />
</a-tooltip>
</span>
</div>
<div>
<span v-if="resource.memoryusedgb">
Expand Down

0 comments on commit 7cfeab1

Please sign in to comment.