Skip to content

Commit

Permalink
feat: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Fine0830 committed Apr 10, 2024
1 parent f8a1650 commit 5c37a04
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 24 deletions.
3 changes: 1 addition & 2 deletions src/locales/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,7 @@ const msg = {
import: "Import Dashboard Templates",
yes: "Yes",
no: "No",
tableHeaderCol1: "Name of the first column of the table",
tableHeaderCol2: "Name of the second column of the table",
tableHeaderCol2: "Name of the last column of the table",
showXAxis: "Show X Axis",
showYAxis: "Show Y Axis",
nameError: "The dashboard name cannot be duplicate",
Expand Down
3 changes: 1 addition & 2 deletions src/locales/lang/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,7 @@ const msg = {
import: "Importar Plantilla Panel",
yes: "Sí",
no: "No",
tableHeaderCol1: "Nombre de la primera columna de la tabla",
tableHeaderCol2: "Nombre de la segunda columna de la tabla",
tableHeaderCol2: "Nombre de la Último columna de la tabla",
showXAxis: "Mostrar Eje X",
showYAxis: "Mostrar Eje Y",
nameError: "El nombre del panel no puede ser duplicado",
Expand Down
3 changes: 2 additions & 1 deletion src/locales/lang/menus/es.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ const titles = {
workflow_scheduler: "Flujo de trabajo",
workflow_scheduler_desc: "Proporcionar monitoreo para sistemas de programación de flujos de trabajo.",
workflow_scheduler_airflow: "Airflow",
workflow_scheduler_airflow_desc: "Observando tareas a través de los datos de telemetría recopilados desde Apache Airflow.",
workflow_scheduler_airflow_desc:
"Observando tareas a través de los datos de telemetría recopilados desde Apache Airflow.",
// Service Mesh
service_mesh: "Malla de Servicios",
service_mesh_desc:
Expand Down
3 changes: 1 addition & 2 deletions src/locales/lang/zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,7 @@ const msg = {
import: "导入仪表板模板",
yes: "是",
no: "否",
tableHeaderCol1: "表格的第一列的名称",
tableHeaderCol2: "表格的第二列的名称",
tableHeaderCol2: "表格的最后一列的名称",
showXAxis: "显示X轴",
showYAxis: "显示Y轴",
nameError: "仪表板名称不能重复",
Expand Down
1 change: 0 additions & 1 deletion src/types/dashboard.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,6 @@ export interface TextConfig {
export interface TableConfig {
type?: string;
showTableValues: boolean;
tableHeaderCol1: string;
tableHeaderCol2: string;
}

Expand Down
11 changes: 0 additions & 11 deletions src/views/dashboard/configuration/widget/graph-styles/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,6 @@ limitations under the License. -->
@change="updateConfig({ showTableValues })"
/>
</div>
<div class="item">
<span class="label">{{ t("tableHeaderCol1") }}</span>
<el-input
class="input"
v-model="tableHeaderCol1"
size="small"
placeholder="none"
@change="updateConfig({ tableHeaderCol1 })"
/>
</div>
<div class="item">
<span class="label">{{ t("tableHeaderCol2") }}</span>
<el-input
Expand All @@ -52,7 +42,6 @@ limitations under the License. -->
const dashboardStore = useDashboardStore();
const graph = dashboardStore.selectedGrid.graph || {};
const showTableValues = ref(graph.showTableValues);
const tableHeaderCol1 = ref(graph.tableHeaderCol1);
const tableHeaderCol2 = ref(graph.tableHeaderCol2);
function updateConfig(param: { [key: string]: unknown }) {
Expand Down
1 change: 0 additions & 1 deletion src/views/dashboard/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ export const DefaultGraphConfig: { [key: string]: any } = {
Table: {
type: "Table",
showTableValues: true,
tableHeaderCol1: "",
tableHeaderCol2: "",
},
TopList: {
Expand Down
18 changes: 14 additions & 4 deletions src/views/dashboard/graphs/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,26 @@ limitations under the License. -->
<template>
<div class="chart-table">
<div class="row header flex-h">
<div class="name" :style="`width: ${nameWidth}%`">
{{ config.tableHeaderCol1 || t("name") }}
<div
v-for="key in dataKeys[0]"
:key="key"
class="name"
:style="`width: ${dataKeys[0].length > 1 ? (nameWidth as number) / (dataKeys[0].length || 1) : nameWidth}%`"
>
{{ key.split("=")[0] || t("name") }}
</div>
<div class="value-col" v-if="config.showTableValues">
{{ config.tableHeaderCol2 || t("value") }}
</div>
</div>
<div class="row flex-h" v-for="(keys, index) in dataKeys" :key="index">
<div v-for="k in keys" class="name" :style="`width: ${(nameWidth as number) / 2}%`" :key="k">{{ k }}</div>
<div
v-for="k in keys"
class="name"
:style="`width: ${keys.length > 1 ? (nameWidth as number) / (keys.length || 1) : nameWidth}%`"
:key="k"
>{{ k.split("=")[1] }}</div
>
<div class="value-col" v-if="config.showTableValues">
{{
(config.metricTypes && config.metricTypes[0] === "readMetricsValue") ||
Expand All @@ -51,7 +62,6 @@ limitations under the License. -->
type: Object as PropType<{
showTableValues: boolean;
tableHeaderCol2: string;
tableHeaderCol1: string;
metricTypes: string[];
typesOfMQE: string[];
}>,
Expand Down

0 comments on commit 5c37a04

Please sign in to comment.