86133 | aaa3f5d | 2025-04-20 21:33:29 +0800 | [diff] [blame^] | 1 | import React, { useEffect } from 'react'; |
| 2 | |
| 3 | /** |
| 4 | * |
| 5 | * @author whiteshader@163.com |
| 6 | * |
| 7 | * */ |
| 8 | |
| 9 | const CacheInfo: React.FC = () => { |
| 10 | useEffect(() => { |
| 11 | const frame = document.getElementById('bdIframe'); |
| 12 | if (frame) { |
| 13 | const deviceWidth = document.documentElement.clientWidth; |
| 14 | const deviceHeight = document.documentElement.clientHeight; |
| 15 | frame.style.width = `${Number(deviceWidth) - 260}px`; |
| 16 | frame.style.height = `${Number(deviceHeight) - 120}px`; |
| 17 | } |
| 18 | }); |
| 19 | |
| 20 | return ( |
| 21 | <div style={{}}> |
| 22 | <iframe |
| 23 | style={{ width: '100%', border: '0px', height: '100%' }} |
| 24 | src={`/api/swagger-ui/index.html`} |
| 25 | id="bdIframe" |
| 26 | /> |
| 27 | </div> |
| 28 | ); |
| 29 | }; |
| 30 | |
| 31 | export default CacheInfo; |