Skip to content

Commit

Permalink
fix(frontend): 资源池问题修复_统计试图 TencentBlueKing#9347
Browse files Browse the repository at this point in the history
  • Loading branch information
3octaves committed Mar 4, 2025
1 parent 43bb57a commit 9cbbbd3
Show file tree
Hide file tree
Showing 3 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions dbm-ui/frontend/src/locales/zh-cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -4136,5 +4136,7 @@
"主机回收": "主机回收",
"版本升级:主从接入层和单节点采用原地升级,存储层小版本升级采用原地升级(注意:暂不支持一主多从),大版本需提供新机迁移方式执行。同一主机所有关联集群将一并同步升级": "版本升级:主从接入层和单节点采用原地升级,存储层小版本升级采用原地升级(注意:暂不支持一主多从),大版本需提供新机迁移方式执行。同一主机所有关联集群将一并同步升级",
"仅新导入且无被申请、转移等使用事件的主机,可执行撤销导入": "仅新导入且无被申请、转移等使用事件的主机,可执行撤销导入",
"无规格类型的 IP 共 n 个": "无规格类型的 IP 共 {n} 个",
"跳转查看": "跳转查看",
"这行勿动!新增翻译请在上一行添加!": ""
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
:data="allTableData"
:dimension="dimension" />
</div>
<Test class="mb-12"></Test>
<BkLoading :loading="loading">
<BkTable
ref="tableRef"
Expand Down Expand Up @@ -102,6 +103,7 @@
import DimensionSelect from './DimensionSelect.vue';
import Export from './Export.vue';
import SearchBox from './search-box/Index.vue';
import Test from './Test.vue';
const { t } = useI18n();
const router = useRouter();
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
<template>
<div class="test">
<div class="test-title">{{ t('无规格类型的 IP 共 n 个', { n: 1 }) }}:</div>
<div>{{ hostList.join(',') }}</div>
<div>
<BkButton
v-bk-tooltips="t('复制')"
class="copy-button ml-4"
text
theme="primary"
@click="handleCopy">
<DbIcon type="copy" />
</BkButton>
<BkButton
v-bk-tooltips="t('跳转查看')"
class="link-button ml-4"
text
theme="primary"
@click="handleRedirect">
<DbIcon type="link" />
</BkButton>
</div>
</div>
</template>

<script setup lang="ts">
import { useI18n } from 'vue-i18n';
// import type SummaryModel from '@services/model/db-resource/summary';
import { execCopy } from '@utils';
// interface Props {
// data: SummaryModel[];
// dimension: string;
// }
// defineProps<Props>();
const router = useRouter();
const { t } = useI18n();
const hostList = ['1.2.3.4', '5.5.6.4'];
const handleCopy = () => {
execCopy(hostList.join('\n'), t('复制成功,共n条', { n: hostList.length }));
};
const handleRedirect = () => {
router.push({
name: 'resourcePool',
params: {
page: 'host-list',
},
query: {
hosts: hostList.join(','),
},
});
};
</script>

<style lang="less" scoped>
.test {
display: flex;
padding: 8px 12px;
font-size: 12px;
background: #f0f1f5;
border-radius: 2px;
.test-title {
font-weight: 700;
color: #313238;
}
.copy-button {
font-size: 15px;
}
.link-button {
font-size: 14px;
}
}
</style>

0 comments on commit 9cbbbd3

Please sign in to comment.