fix: fix the pool data
Update the custom key name to better filter the tab data, the api's response data may have the key 'type'. Change-Id: Ibde82772c509babfbde06d6ce1db663a2340b317
This commit is contained in:
parent
f6535f71d8
commit
d792dfc654
@ -35,7 +35,7 @@ const RenderTabs = () => {
|
||||
get(pool, 'data.result', []).forEach((r) => {
|
||||
const { metric, value } = r;
|
||||
retData.push({
|
||||
type: 'pool',
|
||||
tabType: 'pool',
|
||||
...metric,
|
||||
value: parseFloat(value[1]) || 0,
|
||||
});
|
||||
@ -43,7 +43,7 @@ const RenderTabs = () => {
|
||||
get(osd, 'data.result', []).forEach((r) => {
|
||||
const { metric, value } = r;
|
||||
retData.push({
|
||||
type: 'osd',
|
||||
tabType: 'osd',
|
||||
...metric,
|
||||
value: parseFloat(value[1]) || 0,
|
||||
});
|
||||
@ -53,7 +53,7 @@ const RenderTabs = () => {
|
||||
});
|
||||
|
||||
function getListData(data) {
|
||||
let originData = data.filter((d) => d.type === tab);
|
||||
let originData = data.filter((d) => d.tabType === tab);
|
||||
Object.keys(filters).forEach((key) => {
|
||||
originData = originData.filter((i) => i[key] === filters[key]);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user