Skip to content

Commit 8171cfb

Browse files
committed
fix: cpu usage card and other minor fixes
1 parent 173bdd2 commit 8171cfb

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

core/ui/public/i18n/en/translation.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,6 +1539,8 @@
15391539
"free": "Free",
15401540
"used": "Used",
15411541
"usage": "Usage",
1542+
"average_cpu_usage": "Average CPU usage",
1543+
"average_cpu_usage_tooltip": "Average percentage of CPU time used by active (non-idle) processes over the past 2 minutes.",
15421544
"load": "Load",
15431545
"core": "Core",
15441546
"num_core": "{num}-core",

core/ui/src/components/nodes/NodeCard.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@
100100
<div class="tr">
101101
<div class="td label">{{ $t("nodes.applications") }}</div>
102102
<div class="td">
103-
<cv-link @click.prevent="goToApplications">
103+
<cv-link v-if="applications" @click.prevent="goToApplications">
104104
{{ applications }}
105105
</cv-link>
106+
<span v-else>-</span>
106107
</div>
107108
</div>
108109
</div>
@@ -134,7 +135,7 @@
134135
</template>
135136
<!-- alerts -->
136137
<template v-if="!loading && online && role !== 'ns7migration'">
137-
<div class="card-row icon-and-text mg-top-lg">
138+
<div class="card-row icon-and-text mg-top-md">
138139
<NsSvg
139140
:svg="alertsCount > 0 ? Warning16 : CheckmarkFilled16"
140141
:class="alertsCount > 0 ? 'icon ns-warning' : 'icon ns-success'"

core/ui/src/views/NodeDetail.vue

Lines changed: 26 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -102,18 +102,18 @@
102102
></cv-skeleton-text>
103103
</template>
104104
<template v-else>
105-
<template v-if="!loading.listNodes && nodeStatus.fqdn">
106-
<div class="mg-bottom-lg long-text-row">
107-
<span class="label">{{ $t("node_detail.fqdn") }}</span>
108-
<span class="long-text">{{ nodeStatus.fqdn }}</span>
109-
</div>
110-
</template>
111105
<div class="mg-bottom-lg">
112106
<span class="label">{{ $t("node_detail.node_id") }}</span>
113107
<span>{{
114108
loading.listNodes ? "-" : nodeStatus.node_id
115109
}}</span>
116110
</div>
111+
<template v-if="!loading.listNodes && nodeStatus.fqdn">
112+
<div class="mg-bottom-lg long-text-row">
113+
<span class="label">{{ $t("node_detail.fqdn") }}</span>
114+
<span class="long-text">{{ nodeStatus.fqdn }}</span>
115+
</div>
116+
</template>
117117
<template v-if="!loading.listNodes && nodeStatus.app_count">
118118
<div class="mg-bottom-lg">
119119
<span class="label">{{
@@ -270,8 +270,22 @@
270270
>
271271
<cv-tile :light="true">
272272
<h4 class="mg-bottom-lg">{{ $t("node_detail.cpu") }}</h4>
273-
<div class="mg-bottom-lg">
274-
{{ $t("node_detail.usage") }}
273+
<div class="mg-bottom-sm">
274+
<span class="label"
275+
>{{ $t("node_detail.average_cpu_usage") }}
276+
<cv-interactive-tooltip
277+
alignment="start"
278+
direction="bottom"
279+
class="info"
280+
>
281+
<template slot="trigger">
282+
<Information16 />
283+
</template>
284+
<template slot="content">
285+
{{ $t("node_detail.average_cpu_usage_tooltip") }}
286+
</template>
287+
</cv-interactive-tooltip>
288+
</span>
275289
{{ loading.listNodes ? 0 : nodeStatus.cpu.usage }}%
276290
</div>
277291
<NsProgressBar
@@ -355,8 +369,8 @@
355369
</cv-tile>
356370
<cv-tile :light="true">
357371
<h4 class="mg-bottom-lg">{{ $t("node_detail.memory") }}</h4>
358-
<div class="mg-bottom-lg">
359-
{{ $t("node_detail.usage") }}
372+
<div class="mg-bottom-sm">
373+
<span class="label">{{ $t("node_detail.usage") }}</span>
360374
{{ loading.listNodes ? 0 : nodeStatus.memory.usage }}%
361375
</div>
362376
<NsProgressBar
@@ -389,8 +403,8 @@
389403
</cv-tile>
390404
<cv-tile :light="true">
391405
<h4 class="mg-bottom-lg">{{ $t("node_detail.swap") }}</h4>
392-
<div class="mg-bottom-lg">
393-
{{ $t("node_detail.usage") }}
406+
<div class="mg-bottom-sm">
407+
<span class="label">{{ $t("node_detail.usage") }}</span>
394408
{{ loading.listNodes ? 0 : nodeStatus.swap.usage }}%
395409
</div>
396410
<NsProgressBar
@@ -968,7 +982,6 @@ export default {
968982
display: flex;
969983
align-items: baseline;
970984
flex-wrap: wrap; /* allows wrapping only if really needed */
971-
gap: 0.5rem;
972985
}
973986
974987
.long-text {

core/ui/src/views/NodeFirewall.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@
175175
$t('common.no_search_results_description')
176176
"
177177
:isLoading="loading.getFirewallStatus"
178-
:skeletonRows="5"
178+
:skeletonRows="3"
179179
:isErrorShown="!!error.getFirewallStatus"
180180
:errorTitle="$t('action.get-firewall-status')"
181181
:errorDescription="error.getFirewallStatus"

0 commit comments

Comments
 (0)