Skip to content

Commit

Permalink
feat:dbprovider modify the monitoring disk unit (labring#3637)
Browse files Browse the repository at this point in the history
Signed-off-by: jingyang <[email protected]>
  • Loading branch information
zjy365 authored Aug 4, 2023
1 parent 19f10b1 commit 6ed0859
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 9 deletions.
3 changes: 2 additions & 1 deletion frontend/providers/dbprovider/public/locales/en/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@
"Hits Ratio": "Hits Ratio",
"Running Time": "Running Time",
"InnoDB Buffer Pool": "InnoDB Buffer Pool",
"Database Usage": "Database Usage"
"Database Usage": "Database Usage",
"Disk": "Disk"
}
3 changes: 2 additions & 1 deletion frontend/providers/dbprovider/public/locales/zh/common.json
Original file line number Diff line number Diff line change
Expand Up @@ -165,5 +165,6 @@
"Hits Ratio": "命中率",
"Running Time": "运行时长",
"InnoDB Buffer Pool": "InnoDB 缓冲池",
"Database Usage": "数据库用量"
"Database Usage": "数据库用量",
"Disk": "磁盘空间"
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ const AdapterChartData = {
const temp = data?.data?.result;
let XTimePoint: number[] = [];
const desiredResult = temp.map((dataObject, index) => {
let lineStyleType = dataObject.metric?.type === 'used' ? 'solid' : 'dashed';
const name = dataObject.metric?.persistentvolumeclaim;
if (index === 0) {
XTimePoint = dataObject.values.map((timePoint) => timePoint[0]);
}
const data = dataObject.values.map((item) =>
convertBytes(parseFloat(item[1]), 'gb').toFixed(2)
);
return { name, data, lineStyleType: lineStyleType };
const data = dataObject.values.map((item) => parseFloat(item[1]));
return { name, data };
});
return {
xData: XTimePoint,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ const Monitor = ({ db, dbName, dbType }: { dbName: string; dbType: string; db?:
/>
<ChartTemplate
apiUrl="/api/monitor/getMonitorData"
chartTitle={'DataBase Size'}
chartTitle={'Disk'}
dbName={dbName}
dbType={dbType}
db={db}
unit="GiB"
unit="%"
isShowLegend={false}
queryKey={'disk'}
/>
Expand Down

0 comments on commit 6ed0859

Please sign in to comment.