fix: update YggdrasilSetter
All checks were successful
CI / release-image (push) Successful in 2m22s
All checks were successful
CI / release-image (push) Successful in 2m22s
This commit is contained in:
parent
0d6117c374
commit
80a9c3e5d8
@ -1,23 +0,0 @@
|
||||
version: "3.9"
|
||||
|
||||
networks:
|
||||
traefik:
|
||||
name: traefik
|
||||
external: true
|
||||
|
||||
|
||||
services:
|
||||
tinyskin:
|
||||
build: .
|
||||
container_name: tinyskin
|
||||
volumes:
|
||||
- /srv/server/tinyskin:/app/config
|
||||
restart: always
|
||||
labels:
|
||||
- traefik.enable=true
|
||||
- traefik.http.routers.tinyskin.rule=Host(`auth.hfbz.net`)
|
||||
- traefik.http.routers.tinyskin.entrypoints=web,websecure
|
||||
- traefik.http.routers.tinyskin.middlewares=CORS@file
|
||||
- traefik.http.services.tinyskin.loadbalancer.server.port=8080
|
||||
networks:
|
||||
- traefik
|
24
frontend/src/components/YggdrasilSetter.tsx
Normal file
24
frontend/src/components/YggdrasilSetter.tsx
Normal file
@ -0,0 +1,24 @@
|
||||
import Button from "@mui/material/Button"
|
||||
import { useCallback } from "react"
|
||||
|
||||
export default function QuickSetter() {
|
||||
const url = "https://auth.hfbz.net/api/yggdrasil"
|
||||
|
||||
const handleDragStart = useCallback(
|
||||
(event: React.DragEvent<HTMLButtonElement>) => {
|
||||
const uri = "authlib-injector:yggdrasil-server:" + encodeURIComponent(url)
|
||||
|
||||
if (event.dataTransfer) {
|
||||
event.dataTransfer.setData("text/plain", uri)
|
||||
event.dataTransfer.dropEffect = "copy"
|
||||
}
|
||||
},
|
||||
[url]
|
||||
)
|
||||
|
||||
return (
|
||||
<Button variant="contained" draggable onDragStart={handleDragStart}>
|
||||
拖拽配置 Yggdrasil
|
||||
</Button>
|
||||
)
|
||||
}
|
@ -11,6 +11,7 @@ import Box from '@mui/material/Box';
|
||||
import useTitle from '@/hooks/useTitle';
|
||||
import SkinViewUUID from '@/components/SkinViewUUID';
|
||||
import root from '@/utils/root';
|
||||
import YggdrasilSetter from '@/components/YggdrasilSetter';
|
||||
|
||||
const Profile = function Profile() {
|
||||
const navigate = useNavigate();
|
||||
@ -54,14 +55,7 @@ const Profile = function Profile() {
|
||||
<Typography>本站 Yggdrasil 认证服务器地址</Typography>
|
||||
<code style={{ wordBreak: "break-all" }}>{getYggRoot()}</code>
|
||||
<Typography>点击下方按钮复制 API 地址,或者将按钮拖动至启动器的任意界面即可快速添加认证服务器。</Typography>
|
||||
<Button
|
||||
variant="contained"
|
||||
href="https://auth.hfbz.net/api/yggdrasil"
|
||||
draggable='true'
|
||||
data-clipboard-text="https://auth.hfbz.net/api/yggdrasil"
|
||||
>
|
||||
将此按钮拖到启动器
|
||||
</Button>
|
||||
<YggdrasilSetter />
|
||||
</CardContent>
|
||||
</Card>
|
||||
<Box sx={{ gridArea: "d" }}></Box>
|
||||
|
Loading…
x
Reference in New Issue
Block a user