mirror of
https://github.com/Grasscutters/Cultivation.git
synced 2025-12-15 08:34:43 +01:00
Add testing page
This commit is contained in:
24
src/ui/Test.tsx
Normal file
24
src/ui/Test.tsx
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
import React from 'react'
|
||||||
|
|
||||||
|
import {invoke} from '@tauri-apps/api/tauri'
|
||||||
|
|
||||||
|
async function startProxy() {
|
||||||
|
await invoke('connect')
|
||||||
|
}
|
||||||
|
|
||||||
|
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
|
||||||
Reference in New Issue
Block a user