parent
2352c316c0
commit
9fa61b9849
@ -0,0 +1,38 @@
|
||||
// @ts-nocheck
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
class DeleteCssPlugin {
|
||||
constructor(options) {
|
||||
this.options = options || {};
|
||||
}
|
||||
|
||||
apply(compiler) {
|
||||
compiler.hooks.done.tap('DeleteCssPlugin', (stats) => {
|
||||
const outputPath =
|
||||
this.options.outputPath || path.resolve(__dirname, 'dist');
|
||||
|
||||
fs.readdir(outputPath, (err, files) => {
|
||||
if (err) {
|
||||
console.error(`Failed to read directory: ${outputPath}`, err);
|
||||
return;
|
||||
}
|
||||
|
||||
files.forEach((file) => {
|
||||
if (file.endsWith('.css')) {
|
||||
const filePath = path.join(outputPath, file);
|
||||
fs.unlink(filePath, (err) => {
|
||||
if (err) {
|
||||
console.error(`Failed to delete file: ${filePath}`, err);
|
||||
} else {
|
||||
console.log(`Deleted: ${filePath}`);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = DeleteCssPlugin;
|
||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,61 @@
|
||||
import { Bar } from '@ant-design/plots';
|
||||
|
||||
interface BarChartProps {
|
||||
data: any[];
|
||||
xField: string;
|
||||
yField: string;
|
||||
title?: string;
|
||||
height?: number;
|
||||
}
|
||||
const BarChart: React.FC<BarChartProps> = (props) => {
|
||||
const { data, xField, yField, title, height = 300 } = props;
|
||||
const config = {
|
||||
data,
|
||||
xField,
|
||||
yField,
|
||||
title,
|
||||
// colorField: 'name',
|
||||
direction: 'vertical',
|
||||
height,
|
||||
group: true,
|
||||
legend: {
|
||||
color: {
|
||||
position: 'top',
|
||||
layout: {
|
||||
justifyContent: 'center'
|
||||
}
|
||||
}
|
||||
},
|
||||
axis: {
|
||||
x: {
|
||||
xAxis: true
|
||||
}
|
||||
},
|
||||
|
||||
split: {
|
||||
type: 'line',
|
||||
line: {
|
||||
color: 'red',
|
||||
style: {
|
||||
color: 'red',
|
||||
lineDash: [4, 5]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
style: {
|
||||
fill: '#2fbf85',
|
||||
radiusTopLeft: 8,
|
||||
radiusTopRight: 8,
|
||||
height: 30
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Bar {...config} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default BarChart;
|
||||
@ -0,0 +1,61 @@
|
||||
import { Column } from '@ant-design/plots';
|
||||
|
||||
interface BarChartProps {
|
||||
data: any[];
|
||||
xField: string;
|
||||
yField: string;
|
||||
title?: string;
|
||||
height?: number;
|
||||
}
|
||||
const BarChart: React.FC<BarChartProps> = (props) => {
|
||||
const { data, xField, yField, title, height = 260 } = props;
|
||||
const config = {
|
||||
data,
|
||||
xField,
|
||||
yField,
|
||||
title,
|
||||
// colorField: 'name',
|
||||
direction: 'vertical',
|
||||
height,
|
||||
group: true,
|
||||
legend: {
|
||||
color: {
|
||||
position: 'top',
|
||||
layout: {
|
||||
justifyContent: 'center'
|
||||
}
|
||||
}
|
||||
},
|
||||
axis: {
|
||||
x: {
|
||||
xAxis: true
|
||||
}
|
||||
},
|
||||
|
||||
split: {
|
||||
type: 'line',
|
||||
line: {
|
||||
color: 'red',
|
||||
style: {
|
||||
color: 'red',
|
||||
lineDash: [4, 5]
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
style: {
|
||||
fill: '#2fbf85',
|
||||
radiusTopLeft: 8,
|
||||
radiusTopRight: 8,
|
||||
width: 30
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<Column {...config} />
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default BarChart;
|
||||
@ -0,0 +1,17 @@
|
||||
.content-wrapper {
|
||||
.content {
|
||||
padding-block-start: 0;
|
||||
padding-block-end: 32px;
|
||||
padding-inline: 40px;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: var(--font-size-large);
|
||||
font-weight: 600;
|
||||
line-height: 32px;
|
||||
padding-block-start: 8px;
|
||||
padding-block-end: 16px;
|
||||
padding-inline-start: 40px;
|
||||
padding-inline-end: 40px;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,24 @@
|
||||
import React from 'react';
|
||||
import './index.less';
|
||||
|
||||
const ContentWrapper: React.FC<{
|
||||
children: React.ReactNode;
|
||||
title: React.ReactNode;
|
||||
titleStyle?: React.CSSProperties;
|
||||
contentStyle?: React.CSSProperties;
|
||||
}> = ({ children, title = false, titleStyle, contentStyle }) => {
|
||||
return (
|
||||
<div className="content-wrapper">
|
||||
{title && (
|
||||
<div className="title" style={{ ...titleStyle }}>
|
||||
{title}
|
||||
</div>
|
||||
)}
|
||||
<div className="content" style={{ ...contentStyle }}>
|
||||
{children}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ContentWrapper;
|
||||
@ -0,0 +1,17 @@
|
||||
.value-box {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
|
||||
.value-healthy {
|
||||
color: var(--ant-green-6);
|
||||
}
|
||||
|
||||
.value-warning {
|
||||
color: var(--ant-gold-6);
|
||||
}
|
||||
|
||||
.value-danger {
|
||||
color: var(--ant-red-6);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in new issue