mirror of
https://github.com/clash-verge-rev/clash-verge-rev.git
synced 2024-11-16 03:32:36 +08:00
feat: change rule page
This commit is contained in:
parent
b0dabbe55a
commit
03b3a0b8b3
|
@ -1,40 +0,0 @@
|
|||
import { useState } from "react";
|
||||
import { invoke } from "@tauri-apps/api";
|
||||
import { Button, Grid, TextField } from "@mui/material";
|
||||
|
||||
const ProfilesPage = () => {
|
||||
const [url, setUrl] = useState("");
|
||||
|
||||
const onClick = async () => {
|
||||
if (!url) return;
|
||||
const data = await invoke("get_config_data", { url });
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
return (
|
||||
<div>
|
||||
<Grid
|
||||
container
|
||||
spacing={2}
|
||||
justifyContent="space-between"
|
||||
alignItems="center"
|
||||
>
|
||||
<Grid item xs={9}>
|
||||
<TextField
|
||||
label="Profile Url"
|
||||
fullWidth
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button size="large" variant="contained" onClick={onClick}>
|
||||
View
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ProfilesPage;
|
|
@ -1,11 +1,42 @@
|
|||
import { Box, Typography } from "@mui/material";
|
||||
import { useState } from "react";
|
||||
import { invoke } from "@tauri-apps/api";
|
||||
import { Box, Button, Grid, TextField, Typography } from "@mui/material";
|
||||
|
||||
const RulesPage = () => {
|
||||
const [url, setUrl] = useState("");
|
||||
|
||||
const onClick = async () => {
|
||||
if (!url) return;
|
||||
const data = await invoke("cmd_import_profile", { url });
|
||||
console.log(data);
|
||||
};
|
||||
|
||||
return (
|
||||
<Box sx={{ width: 0.9, maxWidth: "850px", mx: "auto", mb: 2 }}>
|
||||
<Typography variant="h4" component="h1" sx={{ py: 2 }}>
|
||||
Rules
|
||||
</Typography>
|
||||
|
||||
<Grid
|
||||
container
|
||||
spacing={2}
|
||||
justifyContent="space-between"
|
||||
alignItems="center"
|
||||
>
|
||||
<Grid item xs={9}>
|
||||
<TextField
|
||||
label="Profile Url"
|
||||
fullWidth
|
||||
value={url}
|
||||
onChange={(e) => setUrl(e.target.value)}
|
||||
/>
|
||||
</Grid>
|
||||
<Grid item>
|
||||
<Button size="large" variant="contained" onClick={onClick}>
|
||||
View
|
||||
</Button>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Box>
|
||||
);
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue
Block a user