Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 客户端查询列表展示“最后一次拉取配置耗时”字段--story=119690480 #3528

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bcs-services/bcs-bscp/ui/src/i18n/en-us.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,7 @@ export default {
'组件类型 / 版本分布': 'Component type / Version distribution',
下钻: 'Drill down',
总和: 'Total',
最后一次拉取配置耗时: 'Last pull time-consuming',

// 跨页全选
跨页全选: 'AcrossChecked',
Expand Down
1 change: 1 addition & 0 deletions bcs-services/bcs-bscp/ui/src/i18n/zh-cn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ export default {
'组件类型 / 版本分布': '组件类型 / 版本分布',
下钻: '下钻',
总和: '总和',
最后一次拉取配置耗时: '最后一次拉取配置耗时',

// 跨页全选
跨页全选: '跨页全选',
Expand Down
27 changes: 27 additions & 0 deletions bcs-services/bcs-bscp/ui/src/views/space/client/search/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
@page-limit-change="handlePageLimitChange"
@page-value-change="loadList(true)"
@column-filter="handleFilter"
@column-sort="handleSort"
@setting-change="handleSettingsChange">
<template #prepend>
<render-table-tip />
Expand Down Expand Up @@ -106,6 +107,21 @@
</div>
</template>
</bk-table-column>
<bk-table-column
v-if="selectedShowColumn.includes('online-status')"
:label="t('最后一次拉取配置耗时')"
:width="200"
:sort="true">
<template #default="{ row }">
<span v-if="row.client">
{{
row.client.spec.total_seconds > 1
? `${Math.round(row.client.spec.total_seconds)}s`
: `${Math.round(row.client.spec.total_seconds * 1000)}ms`
}}
</span>
</template>
</bk-table-column>
<!-- <bk-table-column label="附加信息" :width="244"></bk-table-column> -->
<bk-table-column
v-if="selectedShowColumn.includes('online-status')"
Expand Down Expand Up @@ -321,6 +337,7 @@
];
const onlineStatusFilterChecked = ref<string[]>([]);
const pollTimer = ref(0);
const updateSortType = ref('null');

// 当前页数据,不含禁用
const selecTableData = computed(() => {
Expand Down Expand Up @@ -545,6 +562,11 @@
desc: 'online_status',
},
};
if (updateSortType.value === 'desc') {
params.order!.desc = 'online_status,total_seconds';
} else if (updateSortType.value === 'asc') {
params.order!.asc = 'total_seconds';
}
try {
listLoading.value = true;
const res = await getClientQueryList(bkBizId.value, appId.value, params);
Expand Down Expand Up @@ -608,6 +630,11 @@
}
};

const handleSort = ({ type }: any) => {
updateSortType.value = type;
loadList();
};

const handleSettingsChange = ({ checked, size }: any) => {
selectedShowColumn.value = [...checked];
localStorage.setItem('client-show-column', JSON.stringify({ checked, size }));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,9 @@
<RecycleScroller class="table-body" :items="data" :item-size="44" key-field="fileAP" v-slot="{ item, index }">
<div class="table-row">
<div class="not-editable td-cell name">
{{ item.fileAP }}
<span class="text-ov">
{{ item.fileAP }}
</span>
</div>
<div class="not-editable td-cell type">
{{ item.file_type === 'text' ? t('文本') : t('二进制') }}
Expand Down
Loading