add controller

This commit is contained in:
VillanCh
2024-03-21 00:03:54 +08:00
parent 977f74dc19
commit acb8307c98
3 changed files with 31 additions and 11 deletions
+29
View File
@@ -0,0 +1,29 @@
import React, {useEffect} from "react";
import {Card} from "antd";
export interface ControllerProp {
}
export const Controller: React.FC<ControllerProp> = (props) => {
const [connected, setConnected] = React.useState<boolean>(false)
const ref = React.useRef<HTMLAnchorElement>(null)
useEffect(() => {
if (!ref) {
return
}
// const update = () => {
// ref.current.click()
// }
// const id = setInterval(update, 10000)
// return () => {
// clearInterval(id)
// }
}, [ref])
return <Card size={"small"} title={"连接器"}>
<a href={"yakitctrl://start/"} ref={ref}>Yakit 启动</a>
</Card>
};