mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-17 01:24:36 +01:00
24 lines
468 B
TypeScript
24 lines
468 B
TypeScript
import React from 'react'
|
|
|
|
import {invoke} from '@tauri-apps/api/tauri'
|
|
|
|
async function startProxy() {
|
|
await invoke('connect', { port: 2222 })
|
|
}
|
|
|
|
async function stopProxy() {
|
|
await invoke('disconnect')
|
|
}
|
|
|
|
class Test extends React.Component<any, any>{
|
|
render() {
|
|
return (
|
|
<div className="App">
|
|
<button onClick={startProxy}>start proxy</button>
|
|
<button onClick={stopProxy}>stop proxy</button>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
|
|
export default Test |