mirror of
https://github.com/yaklang/yaklang-chrome-extension.git
synced 2026-09-25 20:51:52 +08:00
add controller
This commit is contained in:
@@ -1,10 +0,0 @@
|
||||
import React, {useState} from "react";
|
||||
|
||||
export const Controller = (props) => {
|
||||
const [connected, setConnected] = useState(false);
|
||||
return (
|
||||
<div>
|
||||
|
||||
</div>
|
||||
)
|
||||
}
|
||||
@@ -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>
|
||||
};
|
||||
Reference in New Issue
Block a user