|
|
|
|
@ -23,7 +23,7 @@ interface PageProps {}
|
|
|
|
|
const Page: FC<PageProps> = () => {
|
|
|
|
|
const [type, setType] = useState<string>('1');
|
|
|
|
|
const [algorithm, setAlgorithm] = useState<string>('0');
|
|
|
|
|
const [length, setLength] = useState<string>('16');
|
|
|
|
|
const [length, setLength] = useState<string>('2');
|
|
|
|
|
const [pushNode, setPushNode] = useState<string>('节点一');
|
|
|
|
|
const [count, setCount] = useState<number>(1000);
|
|
|
|
|
const [data, setData] = useState<any>([]);
|
|
|
|
|
@ -82,19 +82,32 @@ const Page: FC<PageProps> = () => {
|
|
|
|
|
inputObj.onchange = async (e: any) => {
|
|
|
|
|
const data: any = new FormData();
|
|
|
|
|
data.append('file', e?.target?.files?.[0]);
|
|
|
|
|
const res = await Fetch('/openi/secretKey/resourceImport', {
|
|
|
|
|
const res = await Fetch(`/openi/secretKey/resourceImport/${type}`, {
|
|
|
|
|
method: 'post',
|
|
|
|
|
data,
|
|
|
|
|
});
|
|
|
|
|
if (res.result === 'success') {
|
|
|
|
|
message.success('导入成功');
|
|
|
|
|
getData();
|
|
|
|
|
} else {
|
|
|
|
|
message.error(res.errorMsg);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const title = item.find((e: any) => e.key === type).name;
|
|
|
|
|
|
|
|
|
|
const items = [
|
|
|
|
|
{
|
|
|
|
|
key: '1',
|
|
|
|
|
name: 'ECC359',
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
key: '2',
|
|
|
|
|
name: 'ECC281',
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const option = {
|
|
|
|
|
tooltip: {
|
|
|
|
|
trigger: 'axis',
|
|
|
|
|
@ -115,7 +128,12 @@ const Page: FC<PageProps> = () => {
|
|
|
|
|
},
|
|
|
|
|
yAxis: {
|
|
|
|
|
type: 'category',
|
|
|
|
|
data: data?.map((e: any) => e.length),
|
|
|
|
|
data: data?.map((e: any) => {
|
|
|
|
|
if (type !== '2') {
|
|
|
|
|
return e.length;
|
|
|
|
|
}
|
|
|
|
|
return items.find((k: any) => k.key === e.algorithm)?.name;
|
|
|
|
|
}),
|
|
|
|
|
},
|
|
|
|
|
series: [
|
|
|
|
|
{
|
|
|
|
|
@ -142,6 +160,10 @@ const Page: FC<PageProps> = () => {
|
|
|
|
|
algorithm,
|
|
|
|
|
},
|
|
|
|
|
});
|
|
|
|
|
if (res.errorCode === 500) {
|
|
|
|
|
message.warn(res.errorMsg);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (res.result === 'success') {
|
|
|
|
|
message.success('推出成功');
|
|
|
|
|
getData();
|
|
|
|
|
@ -204,11 +226,11 @@ const Page: FC<PageProps> = () => {
|
|
|
|
|
value={length}
|
|
|
|
|
onChange={(k) => setLength(k)}
|
|
|
|
|
>
|
|
|
|
|
<Select.Option key="16">{'16'}</Select.Option>
|
|
|
|
|
<Select.Option key="20">{'20'}</Select.Option>
|
|
|
|
|
<Select.Option key="32">{'32'}</Select.Option>
|
|
|
|
|
<Select.Option key="64">{'64'}</Select.Option>
|
|
|
|
|
<Select.Option key="128">{'128'}</Select.Option>
|
|
|
|
|
<Select.Option key={'2'}>2</Select.Option>
|
|
|
|
|
<Select.Option key={'4'}>4</Select.Option>
|
|
|
|
|
<Select.Option key={'8'}>8</Select.Option>
|
|
|
|
|
<Select.Option key={'16'}>16</Select.Option>
|
|
|
|
|
<Select.Option key={'32'}>32</Select.Option>
|
|
|
|
|
</Select>
|
|
|
|
|
</Row>
|
|
|
|
|
<Row align="middle" className={mr}>
|
|
|
|
|
@ -230,8 +252,9 @@ const Page: FC<PageProps> = () => {
|
|
|
|
|
onChange={(k) => setAlgorithm(k)}
|
|
|
|
|
style={{ width: 100 }}
|
|
|
|
|
>
|
|
|
|
|
<Select.Option key="1">{'ECC359'}</Select.Option>
|
|
|
|
|
<Select.Option key="2">{'ECC281'}</Select.Option>
|
|
|
|
|
{items.map((e: any) => (
|
|
|
|
|
<Select.Option key={e.key}>{e.name}</Select.Option>
|
|
|
|
|
))}
|
|
|
|
|
</Select>
|
|
|
|
|
</Row>
|
|
|
|
|
)}
|
|
|
|
|
|