Skip to content

Commit

Permalink
fix: polish (#390)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 authored Apr 16, 2024
1 parent 7f6e4d0 commit 731d652
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 14 deletions.
10 changes: 4 additions & 6 deletions src/components/Graph.vue
Original file line number Diff line number Diff line change
Expand Up @@ -235,12 +235,10 @@ limitations under the License. -->
.no-data {
font-size: $font-size-smaller;
height: 100%;
box-sizing: border-box;
display: -webkit-box;
-webkit-box-orient: horizontal;
-webkit-box-pack: center;
-webkit-box-align: center;
color: #666;
align-items: center;
justify-content: center;
display: flex;
color: var(--text-color-placeholder);
}

.chart {
Expand Down
12 changes: 11 additions & 1 deletion src/views/dashboard/graphs/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. -->

<template>
<div class="chart-table">
<div class="chart-table" v-if="dataKeys.length">
<div class="row header flex-h">
<div
v-for="key in dataKeys[0]"
Expand All @@ -41,6 +41,7 @@ limitations under the License. -->
</div>
</div>
</div>
<div class="no-data" v-else>No Data</div>
</template>
<script lang="ts" setup>
import { computed } from "vue";
Expand Down Expand Up @@ -131,4 +132,13 @@ limitations under the License. -->
width: 50%;
}
}

.no-data {
font-size: $font-size-smaller;
height: 100%;
align-items: center;
justify-content: center;
display: flex;
color: var(--text-color-placeholder);
}
</style>
6 changes: 4 additions & 2 deletions src/views/dashboard/related/topology/pod/InstanceMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,13 @@ limitations under the License. -->
const html = exprssions.map((m: string, index: number) => {
const metric =
topologyStore.hierarchyInstanceNodeMetrics[data.layer || ""][m].values.find(
(val: { id: string; value: unknown }) => val.id === data.id,
(val: { id: string; value: string }) => val.id === data.id,
) || {};
const opt: MetricConfigOpt = nodeMetricConfig[index] || {};

return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value} ${opt.unit || ""}</div>`;
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value || NaN} ${
opt.unit || ""
}</div>`;
});
const tipHtml = [
`<div class="mb-5"><span class="grey">name: </span>${data.name}</div><div class="mb-5"><span class="grey">layer: </span>${data.layer}</div>`,
Expand Down
6 changes: 4 additions & 2 deletions src/views/dashboard/related/topology/service/HierarchyMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,12 @@ limitations under the License. -->
const html = exprssions.map((m: string, index: number) => {
const metric =
topologyStore.hierarchyNodeMetrics[data.layer || ""][m].values.find(
(val: { id: string; value: unknown }) => val.id === data.id,
(val: { id: string; value: string }) => val.id === data.id,
) || {};
const opt: MetricConfigOpt = nodeMetricConfig[index] || {};
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value} ${opt.unit || ""}</div>`;
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value || NaN} ${
opt.unit || ""
}</div>`;
});
const tipHtml = [
`<div class="mb-5"><span class="grey">name: </span>${data.name}</div><div class="mb-5"><span class="grey">layer: </span>${data.layer}</div>`,
Expand Down
6 changes: 3 additions & 3 deletions src/views/dashboard/related/topology/service/ServiceMap.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ limitations under the License. -->
const html = nodeMetrics.map((m, index) => {
const metric =
(topologyStore.nodeMetricValue[m] &&
topologyStore.nodeMetricValue[m].values.find((val: { id: string; value: unknown }) => val.id === data.id)) ||
topologyStore.nodeMetricValue[m].values.find((val: { id: string; value: string }) => val.id === data.id)) ||
{};
const opt: MetricConfigOpt = nodeMetricConfig[index] || {};
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value || NaN} ${
Expand Down Expand Up @@ -344,7 +344,7 @@ limitations under the License. -->
);
if (metric) {
const opt: MetricConfigOpt = linkServerMetricConfig[index] || {};
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value} ${
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value || NaN} ${
opt.unit || ""
}</div>`;
}
Expand All @@ -355,7 +355,7 @@ limitations under the License. -->
(val: { id: string; value: unknown }) => val.id === data.id,
);
if (metric) {
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value} ${
return ` <div class="mb-5"><span class="grey">${opt.label || m}: </span>${metric.value || NaN} ${
opt.unit || ""
}</div>`;
}
Expand Down

0 comments on commit 731d652

Please sign in to comment.